docker-build.sh 808 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. # Builds the RPM inside the Docker container
  3. set -o errexit
  4. set -o xtrace
  5. # Move to source directory
  6. pushd ${SOURCE_DIR}
  7. # Prepare the source
  8. source "$HOME/.nvm/nvm.sh"
  9. nvm use v8
  10. make -f .copr/Makefile srpm outdir=/root/rpmbuild/SRPMS
  11. # Remove dep for nodejs/yarn since our build env won't have these (NVM instead)
  12. sed -i '/BuildRequires: nodejs >= 8 yarn/d' SPECS/jellyfin.spec
  13. # Build the RPMs
  14. rpmbuild -bs SPECS/jellyfin.spec --define "_sourcedir ${SOURCE_DIR}/SOURCES/pkg-src/"
  15. rpmbuild -bb SPECS/jellyfin.spec --define "_sourcedir ${SOURCE_DIR}/SOURCES/pkg-src/"
  16. # Move the artifacts out
  17. mkdir -p ${ARTIFACT_DIR}/rpm
  18. mv /root/rpmbuild/RPMS/x86_64/jellyfin-*.rpm /root/rpmbuild/SRPMS/jellyfin-*.src.rpm ${ARTIFACT_DIR}/rpm/
  19. chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR}