2016-04-30 09:40:40 +02:00
|
|
|
#!/bin/bash -e
|
2015-10-24 17:14:56 +02:00
|
|
|
|
2020-04-30 01:42:39 +02:00
|
|
|
PRODUCT=$(cat scylla-jmx/SCYLLA-PRODUCT-FILE)
|
2018-08-28 03:04:44 +02:00
|
|
|
|
2017-06-15 12:02:30 +02:00
|
|
|
. /etc/os-release
|
|
|
|
print_usage() {
|
2018-10-24 04:45:11 +02:00
|
|
|
echo "build_deb.sh --reloc-pkg build/scylla-jmx-package.tar.gz"
|
|
|
|
echo " --reloc-pkg specify relocatable package path"
|
2017-06-15 12:02:30 +02:00
|
|
|
exit 1
|
|
|
|
}
|
2018-10-24 04:45:11 +02:00
|
|
|
TARGET=stable
|
|
|
|
RELOC_PKG=
|
2017-06-15 12:02:30 +02:00
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
case "$1" in
|
2018-10-24 04:45:11 +02:00
|
|
|
"--reloc-pkg")
|
|
|
|
RELOC_PKG=$2
|
2017-06-15 12:02:30 +02:00
|
|
|
shift 2
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
print_usage
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
is_redhat_variant() {
|
|
|
|
[ -f /etc/redhat-release ]
|
|
|
|
}
|
|
|
|
is_debian_variant() {
|
|
|
|
[ -f /etc/debian_version ]
|
|
|
|
}
|
|
|
|
|
2020-04-30 01:42:39 +02:00
|
|
|
if [ ! -e scylla-jmx/SCYLLA-RELOCATABLE-FILE ]; then
|
2018-10-24 04:45:11 +02:00
|
|
|
echo "do not directly execute build_rpm.sh, use reloc/build_rpm.sh instead."
|
2015-10-24 17:14:56 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2018-10-24 04:45:11 +02:00
|
|
|
|
|
|
|
if [ -z "$RELOC_PKG" ]; then
|
|
|
|
print_usage
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [ ! -f "$RELOC_PKG" ]; then
|
|
|
|
echo "$RELOC_PKG is not found."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-07-06 00:35:09 +02:00
|
|
|
RELOC_PKG=$(readlink -f $RELOC_PKG)
|
2017-01-02 18:24:38 +01:00
|
|
|
|
2020-07-06 00:35:09 +02:00
|
|
|
mv scylla-jmx/debian debian
|
|
|
|
PKG_NAME=$(dpkg-parsechangelog --show-field Source)
|
|
|
|
# XXX: Drop revision number from version string.
|
|
|
|
# Since it always '1', this should be okay for now.
|
|
|
|
PKG_VERSION=$(dpkg-parsechangelog --show-field Version |sed -e 's/-1$//')
|
|
|
|
ln -fv $RELOC_PKG ../"$PKG_NAME"_"$PKG_VERSION".orig.tar.gz
|
2018-10-24 04:45:11 +02:00
|
|
|
debuild -rfakeroot -us -uc
|