From 5fa422c4eada154fe86d274c296df491dcb10090 Mon Sep 17 00:00:00 2001 From: Takuya ASADA Date: Sun, 13 Sep 2020 20:18:56 +0900 Subject: [PATCH] reloc: simplified .deb build process We don't really need to have two build_deb.sh, merge it to reloc. --- dist/debian/build_deb.sh | 54 ---------------------------------------- reloc/build_deb.sh | 20 +++++++++------ 2 files changed, 12 insertions(+), 62 deletions(-) delete mode 100755 dist/debian/build_deb.sh diff --git a/dist/debian/build_deb.sh b/dist/debian/build_deb.sh deleted file mode 100755 index 26e5f25..0000000 --- a/dist/debian/build_deb.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -e - -PRODUCT=$(cat scylla-jmx/SCYLLA-PRODUCT-FILE) - -. /etc/os-release -print_usage() { - echo "build_deb.sh --reloc-pkg build/scylla-jmx-package.tar.gz" - echo " --reloc-pkg specify relocatable package path" - exit 1 -} -TARGET=stable -RELOC_PKG= -while [ $# -gt 0 ]; do - case "$1" in - "--reloc-pkg") - RELOC_PKG=$2 - shift 2 - ;; - *) - print_usage - ;; - esac -done - -is_redhat_variant() { - [ -f /etc/redhat-release ] -} -is_debian_variant() { - [ -f /etc/debian_version ] -} - -if [ ! -e scylla-jmx/SCYLLA-RELOCATABLE-FILE ]; then - echo "do not directly execute build_rpm.sh, use reloc/build_rpm.sh instead." - exit 1 -fi - -if [ -z "$RELOC_PKG" ]; then - print_usage - exit 1 -fi -if [ ! -f "$RELOC_PKG" ]; then - echo "$RELOC_PKG is not found." - exit 1 -fi - -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 diff --git a/reloc/build_deb.sh b/reloc/build_deb.sh index a9408c3..63aed75 100755 --- a/reloc/build_deb.sh +++ b/reloc/build_deb.sh @@ -1,6 +1,5 @@ #!/bin/bash -e -. /etc/os-release print_usage() { echo "build_deb.sh --reloc-pkg build/scylla-jmx-package.tar.gz" echo " --reloc-pkg specify relocatable package path" @@ -8,13 +7,11 @@ print_usage() { exit 1 } -RELOC_PKG=$(readlink -f build/scylla-jmx-package.tar.gz) +RELOC_PKG=build/scylla-jmx-package.tar.gz BUILDDIR=build/debian -OPTS="" while [ $# -gt 0 ]; do case "$1" in "--reloc-pkg") - OPTS="$OPTS $1 $(readlink -f $2)" RELOC_PKG=$2 shift 2 ;; @@ -28,11 +25,18 @@ while [ $# -gt 0 ]; do esac done -if [[ ! $OPTS =~ --reloc-pkg ]]; then - OPTS="$OPTS --reloc-pkg $RELOC_PKG" -fi +RELOC_PKG=$(readlink -f $RELOC_PKG) rm -rf "$BUILDDIR" mkdir -p "$BUILDDIR"/scylla-package tar -C "$BUILDDIR"/scylla-package -xpf $RELOC_PKG cd "$BUILDDIR"/scylla-package -exec ./scylla-jmx/dist/debian/build_deb.sh $OPTS + +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