2020-03-23 16:28:49 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-01-21 12:55:01 -05:00
|
|
|
#= CentOS/RHEL 9+ amd64 .rpm
|
2020-03-23 16:28:49 -04:00
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
set -o xtrace
|
|
|
|
|
|
|
|
# Move to source directory
|
2023-12-03 15:58:26 -05:00
|
|
|
pushd "${SOURCE_DIR}"
|
2020-03-23 16:28:49 -04:00
|
|
|
|
2021-09-25 08:21:48 -04:00
|
|
|
if [[ ${IS_DOCKER} == YES ]]; then
|
2022-12-07 19:51:29 -05:00
|
|
|
# Remove BuildRequires for dotnet, since it's installed manually
|
2024-01-21 12:55:01 -05:00
|
|
|
pushd centos
|
2021-09-25 08:21:48 -04:00
|
|
|
|
|
|
|
cp -a jellyfin.spec /tmp/spec.orig
|
|
|
|
sed -i 's/BuildRequires: dotnet/# BuildRequires: dotnet/' jellyfin.spec
|
|
|
|
|
|
|
|
popd
|
|
|
|
fi
|
|
|
|
|
2020-06-19 16:31:59 -04:00
|
|
|
# Modify changelog to unstable configuration if IS_UNSTABLE
|
|
|
|
if [[ ${IS_UNSTABLE} == 'yes' ]]; then
|
2024-01-21 12:55:01 -05:00
|
|
|
pushd centos
|
2020-06-19 16:31:59 -04:00
|
|
|
|
|
|
|
PR_ID=$( git log --grep 'Merge pull request' --oneline --single-worktree --first-parent | head -1 | grep --color=none -Eo '#[0-9]+' | tr -d '#' )
|
|
|
|
|
|
|
|
sed -i "s/Version:.*/Version: ${BUILD_ID}/" jellyfin.spec
|
|
|
|
sed -i "/%changelog/q" jellyfin.spec
|
|
|
|
|
|
|
|
cat <<EOF >>jellyfin.spec
|
|
|
|
* $( LANG=C date '+%a %b %d %Y' ) Jellyfin Packaging Team <packaging@jellyfin.org>
|
|
|
|
- Jellyfin Server unstable build ${BUILD_ID} for merged PR #${PR_ID}
|
|
|
|
EOF
|
|
|
|
popd
|
|
|
|
fi
|
|
|
|
|
2020-03-23 16:28:49 -04:00
|
|
|
# Build RPM
|
2024-01-21 12:55:01 -05:00
|
|
|
make -f centos/Makefile srpm outdir=/root/rpmbuild/SRPMS
|
2020-03-23 16:28:49 -04:00
|
|
|
rpmbuild --rebuild -bb /root/rpmbuild/SRPMS/jellyfin-*.src.rpm
|
|
|
|
|
|
|
|
# Move the artifacts out
|
2023-12-03 15:58:26 -05:00
|
|
|
mv /root/rpmbuild/RPMS/x86_64/jellyfin-*.rpm /root/rpmbuild/SRPMS/jellyfin-*.src.rpm "${ARTIFACT_DIR}/"
|
2020-03-23 16:28:49 -04:00
|
|
|
|
|
|
|
if [[ ${IS_DOCKER} == YES ]]; then
|
2024-01-17 20:11:03 -05:00
|
|
|
chown -Rc "$(stat -c %u:%g "${ARTIFACT_DIR}")" "${ARTIFACT_DIR}"
|
2020-03-23 16:28:49 -04:00
|
|
|
fi
|
|
|
|
|
2024-01-21 12:55:01 -05:00
|
|
|
rm -f centos/jellyfin*.tar.gz
|
2020-03-23 16:28:49 -04:00
|
|
|
|
2021-09-25 08:21:48 -04:00
|
|
|
if [[ ${IS_DOCKER} == YES ]]; then
|
2024-01-21 12:55:01 -05:00
|
|
|
pushd centos
|
2021-09-25 08:21:48 -04:00
|
|
|
|
|
|
|
cp -a /tmp/spec.orig jellyfin.spec
|
2024-01-17 20:11:03 -05:00
|
|
|
chown -Rc "$(stat -c %u:%g "${ARTIFACT_DIR}")" "${ARTIFACT_DIR}"
|
2022-12-07 19:51:29 -05:00
|
|
|
|
2021-09-25 08:21:48 -04:00
|
|
|
popd
|
|
|
|
fi
|
|
|
|
|
2020-03-23 16:28:49 -04:00
|
|
|
popd
|