scylla-jmx/dist/redhat/build_rpm.sh
Pekka Enberg b177d24d46 dist/redhat: Add version numbering
This adds version proper version numbering for the scylla-jmx RPM. Please note
that the version number in the server is still hard-coded in the Maven POM
file as "1.0". We need to address that later.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-09-17 10:23:25 +03:00

22 lines
965 B
Bash
Executable File

#!/bin/sh -e
RPMBUILD=build/rpmbuild
if [ ! -e dist/redhat/build_rpm.sh ]; then
echo "run build_rpm.sh in top of scylla-jmx dir"
exit 1
fi
if [ ! -f /usr/bin/git ] || [ ! -f /usr/bin/mock ] || [ ! -f /usr/bin/rpmbuild ]; then
sudo yum install -y git mock rpm-build
fi
VERSION=$(./SCYLLA-VERSION-GEN)
SCYLLA_VERSION=$(cat build/SCYLLA-VERSION-FILE)
SCYLLA_RELEASE=$(cat build/SCYLLA-RELEASE-FILE)
mkdir -p $RPMBUILD/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
git archive --format=tar --prefix=scylla-jmx-$VERSION/ HEAD -o build/rpmbuild/SOURCES/scylla-jmx-$VERSION.tar
cp dist/redhat/scylla-jmx.spec.in $RPMBUILD/SPECS/scylla-jmx.spec
sed -i -e "s/@@VERSION@@/$SCYLLA_VERSION/g" $RPMBUILD/SPECS/scylla-jmx.spec
sed -i -e "s/@@RELEASE@@/$SCYLLA_RELEASE/g" $RPMBUILD/SPECS/scylla-jmx.spec
rpmbuild -bs --define "_topdir $RPMBUILD" -ba $RPMBUILD/SPECS/scylla-jmx.spec
mock rebuild --resultdir=`pwd`/build/rpms $RPMBUILD/SRPMS/scylla-jmx-$VERSION*.src.rpm