2018-10-24 04:00:37 +02:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
. /etc/os-release
|
|
|
|
|
|
|
|
print_usage() {
|
|
|
|
echo "build_reloc.sh --clean --nodeps"
|
|
|
|
echo " --clean clean build directory"
|
|
|
|
echo " --nodeps skip installing dependencies"
|
2020-09-22 16:10:08 +02:00
|
|
|
echo " --version V product-version-release string (overriding SCYLLA-VERSION-GEN)"
|
2018-10-24 04:00:37 +02:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
CLEAN=
|
|
|
|
NODEPS=
|
2020-09-22 16:10:08 +02:00
|
|
|
VERSION_OVERRIDE=
|
2018-10-24 04:00:37 +02:00
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
case "$1" in
|
|
|
|
"--clean")
|
|
|
|
CLEAN=yes
|
|
|
|
shift 1
|
|
|
|
;;
|
|
|
|
"--nodeps")
|
|
|
|
NODEPS=yes
|
|
|
|
shift 1
|
|
|
|
;;
|
2020-09-22 16:10:08 +02:00
|
|
|
"--version")
|
|
|
|
VERSION_OVERRIDE="$2"
|
|
|
|
shift 2
|
|
|
|
;;
|
2018-10-24 04:00:37 +02:00
|
|
|
*)
|
|
|
|
print_usage
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2020-10-11 19:17:41 +02:00
|
|
|
VERSION=$(./SCYLLA-VERSION-GEN ${VERSION_OVERRIDE:+ --version "$VERSION_OVERRIDE"})
|
|
|
|
# the former command should generate build/SCYLLA-PRODUCT-FILE and some other version
|
|
|
|
# related files
|
|
|
|
PRODUCT=`cat build/SCYLLA-PRODUCT-FILE`
|
|
|
|
|
2018-10-24 04:00:37 +02:00
|
|
|
is_redhat_variant() {
|
|
|
|
[ -f /etc/redhat-release ]
|
|
|
|
}
|
|
|
|
is_debian_variant() {
|
|
|
|
[ -f /etc/debian_version ]
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if [ ! -e reloc/build_reloc.sh ]; then
|
|
|
|
echo "run build_reloc.sh in top of scylla dir"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$CLEAN" = "yes" ]; then
|
|
|
|
rm -rf build target
|
|
|
|
fi
|
|
|
|
|
2020-10-11 19:17:41 +02:00
|
|
|
if [ -f build/$PRODUCT-jmx-package.tar.gz ]; then
|
|
|
|
rm build/$PRODUCT-jmx-package.tar.gz
|
2018-10-24 04:00:37 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$NODEPS" ]; then
|
|
|
|
sudo ./install-dependencies.sh
|
|
|
|
fi
|
|
|
|
|
2019-07-08 10:54:04 +02:00
|
|
|
mvn -B --file scylla-jmx-parent/pom.xml install
|
2020-09-22 16:10:08 +02:00
|
|
|
./SCYLLA-VERSION-GEN ${VERSION_OVERRIDE:+ --version "$VERSION_OVERRIDE"}
|
2020-05-11 11:17:51 +02:00
|
|
|
./dist/debian/debian_files_gen.py
|
2020-10-11 19:17:41 +02:00
|
|
|
scripts/create-relocatable-package.py build/$PRODUCT-jmx-package.tar.gz
|