2018-10-24 04:45:11 +02:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
print_usage() {
|
|
|
|
echo "build_deb.sh --reloc-pkg build/scylla-jmx-package.tar.gz"
|
|
|
|
echo " --reloc-pkg specify relocatable package path"
|
2020-07-17 10:57:23 +02:00
|
|
|
echo " --builddir specify Debian package build path"
|
2018-10-24 04:45:11 +02:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2020-09-13 13:18:56 +02:00
|
|
|
RELOC_PKG=build/scylla-jmx-package.tar.gz
|
2020-07-17 10:57:23 +02:00
|
|
|
BUILDDIR=build/debian
|
2018-10-24 04:45:11 +02:00
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
case "$1" in
|
|
|
|
"--reloc-pkg")
|
|
|
|
RELOC_PKG=$2
|
|
|
|
shift 2
|
|
|
|
;;
|
2020-07-17 10:57:23 +02:00
|
|
|
"--builddir")
|
|
|
|
BUILDDIR="$2"
|
|
|
|
shift 2
|
|
|
|
;;
|
2018-10-24 04:45:11 +02:00
|
|
|
*)
|
|
|
|
print_usage
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2020-09-13 13:18:56 +02:00
|
|
|
RELOC_PKG=$(readlink -f $RELOC_PKG)
|
2020-07-17 10:57:23 +02:00
|
|
|
rm -rf "$BUILDDIR"
|
|
|
|
mkdir -p "$BUILDDIR"/scylla-package
|
|
|
|
tar -C "$BUILDDIR"/scylla-package -xpf $RELOC_PKG
|
|
|
|
cd "$BUILDDIR"/scylla-package
|
2020-09-13 13:18:56 +02:00
|
|
|
|
|
|
|
RELOC_PKG=$(readlink -f $RELOC_PKG)
|
|
|
|
|
|
|
|
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
|
|
|
|
debuild -rfakeroot -us -uc
|