dist/redhat: support package renaming on build script

To automatically rename packages on enterprise release, added package name
prefix as a variable on build_rpm.sh.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <20180822072105.9420-2-syuu@scylladb.com>
This commit is contained in:
Takuya ASADA 2018-08-22 16:21:04 +09:00 committed by Avi Kivity
parent c6aee9f63e
commit a27d9601f5
2 changed files with 8 additions and 6 deletions

View File

@ -1,5 +1,7 @@
#!/bin/bash -e
PRODUCT=scylla
. /etc/os-release
print_usage() {
echo "build_rpm.sh -target epel-7-x86_64 --configure-user"
@ -73,15 +75,15 @@ fi
VERSION=$(./SCYLLA-VERSION-GEN)
SCYLLA_VERSION=$(cat build/SCYLLA-VERSION-FILE)
SCYLLA_RELEASE=$(cat build/SCYLLA-RELEASE-FILE)
git archive --format=tar --prefix=scylla-jmx-$SCYLLA_VERSION/ HEAD -o build/scylla-jmx-$VERSION.tar
pystache dist/redhat/scylla-jmx.spec.mustache "{ \"version\": \"$SCYLLA_VERSION\", \"release\": \"$SCYLLA_RELEASE\" }" > build/scylla-jmx.spec
git archive --format=tar --prefix=$PRODUCT-jmx-$SCYLLA_VERSION/ HEAD -o build/$PRODUCT-jmx-$VERSION.tar
pystache dist/redhat/scylla-jmx.spec.mustache "{ \"version\": \"$SCYLLA_VERSION\", \"release\": \"$SCYLLA_RELEASE\", \"product\": \"$PRODUCT\", \"$PRODUCT\": true }" > build/scylla-jmx.spec
# mock generates files owned by root, fix this up
fix_ownership() {
sudo chown "$(id -u):$(id -g)" -R "$@"
}
sudo mock --buildsrpm --root=$TARGET --resultdir=`pwd`/build/srpms --spec=build/scylla-jmx.spec --sources=build/scylla-jmx-$VERSION.tar
sudo mock --buildsrpm --root=$TARGET --resultdir=`pwd`/build/srpms --spec=build/scylla-jmx.spec --sources=build/$PRODUCT-jmx-$VERSION.tar
fix_ownership build/srpms
sudo mock --rebuild --root=$TARGET --resultdir=`pwd`/build/rpms build/srpms/scylla-jmx-$VERSION*.src.rpm
sudo mock --rebuild --root=$TARGET --resultdir=`pwd`/build/rpms build/srpms/$PRODUCT-jmx-$VERSION*.src.rpm
fix_ownership build/rpms

View File

@ -1,4 +1,4 @@
Name: scylla-jmx
Name: {{product}}-jmx
Version: {{version}}
Release: {{release}}%{?dist}
Summary: Scylla JMX
@ -12,7 +12,7 @@ BuildArch: noarch
BuildRequires: maven systemd-units java-1.8.0-openjdk-devel
%{?fedora:BuildRequires: python2-pystache}
%{?rhel:BuildRequires: pystache python-setuptools}
Requires: scylla-server java-1.8.0-openjdk-headless
Requires: {{product}}-server java-1.8.0-openjdk-headless
%description