build.centos.amd64 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. #= CentOS/RHEL 7+ amd64 .rpm
  3. set -o errexit
  4. set -o xtrace
  5. # Move to source directory
  6. pushd ${SOURCE_DIR}
  7. # Modify changelog to unstable configuration if IS_UNSTABLE
  8. if [[ ${IS_UNSTABLE} == 'yes' ]]; then
  9. pushd fedora
  10. PR_ID=$( git log --grep 'Merge pull request' --oneline --single-worktree --first-parent | head -1 | grep --color=none -Eo '#[0-9]+' | tr -d '#' )
  11. sed -i "s/Version:.*/Version: ${BUILD_ID}/" jellyfin.spec
  12. sed -i "/%changelog/q" jellyfin.spec
  13. cat <<EOF >>jellyfin.spec
  14. * $( LANG=C date '+%a %b %d %Y' ) Jellyfin Packaging Team <packaging@jellyfin.org>
  15. - Jellyfin Server unstable build ${BUILD_ID} for merged PR #${PR_ID}
  16. EOF
  17. popd
  18. fi
  19. # Build RPM
  20. make -f fedora/Makefile srpm outdir=/root/rpmbuild/SRPMS
  21. rpmbuild --rebuild -bb /root/rpmbuild/SRPMS/jellyfin-*.src.rpm
  22. # Move the artifacts out
  23. mv /root/rpmbuild/RPMS/x86_64/jellyfin-*.rpm /root/rpmbuild/SRPMS/jellyfin-*.src.rpm ${ARTIFACT_DIR}/
  24. if [[ ${IS_DOCKER} == YES ]]; then
  25. chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR}
  26. fi
  27. rm -f fedora/jellyfin*.tar.gz
  28. popd