When we add product name customization, we mistakenly defined the parameter on each package build script. Number of script is increasing since we recently added relocatable python3 package, we should merge it in single place. Also we should save the parameter on relocatable package, just like version-release parameters. So move the definition to SCYLLA-VERSION-GEN, save it to build/SCYLLA-PRODUCT-FILE then archive it to relocatable package. Signed-off-by: Takuya ASADA <syuu@scylladb.com> Message-Id: <20190417163335.10191-1-syuu@scylladb.com>
43 lines
1.2 KiB
Bash
Executable File
43 lines
1.2 KiB
Bash
Executable File
#!/bin/bash -e
|
|
|
|
. /etc/os-release
|
|
print_usage() {
|
|
echo "build_rpm.sh --reloc-pkg build/release/scylla-python3-package.tar.gz"
|
|
echo " --reloc-pkg specify relocatable package path"
|
|
echo " --builddir specify rpmbuild directory"
|
|
exit 1
|
|
}
|
|
RELOC_PKG=build/release/scylla-python3-package.tar.gz
|
|
BUILDDIR=build/redhat
|
|
OPTS=""
|
|
while [ $# -gt 0 ]; do
|
|
case "$1" in
|
|
"--reloc-pkg")
|
|
OPTS="$OPTS $1 $(readlink -f $2)"
|
|
RELOC_PKG=$2
|
|
shift 2
|
|
;;
|
|
"--builddir")
|
|
builddir="$2"
|
|
shift 2
|
|
;;
|
|
*)
|
|
print_usage
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [ ! -e $RELOC_PKG ]; then
|
|
echo "$RELOC_PKG does not exist."
|
|
echo "Run ./reloc/python3/build_reloc.sh first."
|
|
exit 1
|
|
fi
|
|
RELOC_PKG=$(readlink -f $RELOC_PKG)
|
|
if [[ ! $OPTS =~ --reloc-pkg ]]; then
|
|
OPTS="$OPTS --reloc-pkg $RELOC_PKG"
|
|
fi
|
|
mkdir -p $BUILDDIR/scylla-python3-package
|
|
tar -C $BUILDDIR/scylla-python3-package -xpf $RELOC_PKG SCYLLA-RELOCATABLE-FILE SCYLLA-RELEASE-FILE SCYLLA-VERSION-FILE SCYLLA-PRODUCT-FILE dist/redhat/python3
|
|
cd $BUILDDIR/scylla-python3-package
|
|
exec ./dist/redhat/python3/build_rpm.sh $OPTS
|