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>
This commit is contained in:
parent
3259ef9604
commit
b177d24d46
19
SCYLLA-VERSION-GEN
Executable file
19
SCYLLA-VERSION-GEN
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
VERSION=0.8
|
||||
|
||||
if test -f version
|
||||
then
|
||||
SCYLLA_VERSION=$(cat version | awk -F'-' '{print $1}')
|
||||
SCYLLA_RELEASE=$(cat version | awk -F'-' '{print $2}')
|
||||
else
|
||||
DATE=$(date +%Y%m%d)
|
||||
GIT_COMMIT=$(git log --pretty=format:'%h' -n 1)
|
||||
SCYLLA_VERSION=$VERSION
|
||||
SCYLLA_RELEASE=$DATE.$GIT_COMMIT
|
||||
fi
|
||||
|
||||
echo "$SCYLLA_VERSION-$SCYLLA_RELEASE"
|
||||
mkdir -p build
|
||||
echo "$SCYLLA_VERSION" > build/SCYLLA-VERSION-FILE
|
||||
echo "$SCYLLA_RELEASE" > build/SCYLLA-RELEASE-FILE
|
13
dist/redhat/build_rpm.sh
vendored
13
dist/redhat/build_rpm.sh
vendored
@ -1,6 +1,5 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
SCYLLA_VER=0.00
|
||||
RPMBUILD=build/rpmbuild
|
||||
|
||||
if [ ! -e dist/redhat/build_rpm.sh ]; then
|
||||
@ -10,7 +9,13 @@ 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-$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
|
||||
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
|
||||
|
@ -1,12 +1,12 @@
|
||||
Name: scylla-jmx
|
||||
Version: 0.00
|
||||
Release: 1%{?dist}
|
||||
Version: @@VERSION@@
|
||||
Release: @@RELEASE@@%{?dist}
|
||||
Summary: Scylla JMX
|
||||
Group: Applications/Databases
|
||||
|
||||
License: Proprietary
|
||||
URL: http://www.seastar-project.org/
|
||||
Source0: %{name}-%{version}.tar
|
||||
Source0: %{name}-@@VERSION@@-@@RELEASE@@.tar
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: maven java-1.8.0-openjdk systemd-units
|
Loading…
Reference in New Issue
Block a user