2015-09-01 21:32:54 +02:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
SCYLLA_VER=0.00
|
2015-09-14 10:36:38 +02:00
|
|
|
RPMBUILD=build/rpmbuild
|
2015-09-01 21:32:54 +02:00
|
|
|
|
|
|
|
if [ ! -e dist/redhat/build_rpm.sh ]; then
|
|
|
|
echo "run build_rpm.sh in top of scylla-jmx dir"
|
|
|
|
exit 1
|
|
|
|
fi
|
2015-09-14 10:36:38 +02:00
|
|
|
if [ ! -f /usr/bin/git ] || [ ! -f /usr/bin/mock ] || [ ! -f /usr/bin/rpmbuild ]; then
|
|
|
|
sudo yum install -y git mock rpm-build
|
2015-09-01 21:32:54 +02:00
|
|
|
fi
|
|
|
|
mkdir -p $RPMBUILD/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
|
2015-09-14 10:36:38 +02:00
|
|
|
git archive --format=tar --prefix=scylla-jmx-$SCYLLA_VER/ HEAD -o build/rpmbuild/SOURCES/scylla-jmx-$SCYLLA_VER.tar
|
|
|
|
rpmbuild -bs --define "_topdir $RPMBUILD" -ba dist/redhat/scylla-jmx.spec
|
|
|
|
mock rebuild --resultdir=`pwd`/build/rpms $RPMBUILD/SRPMS/scylla-jmx-$SCYLLA_VER*.src.rpm
|