diff --git a/dist/debian/build_deb.sh b/dist/debian/build_deb.sh index 6916338..49c98ab 100755 --- a/dist/debian/build_deb.sh +++ b/dist/debian/build_deb.sh @@ -1,5 +1,7 @@ #!/bin/bash -e +PRODUCT=scylla + . /etc/os-release print_usage() { echo "build_deb.sh -target " @@ -111,9 +113,14 @@ VERSION=$(./SCYLLA-VERSION-GEN) SCYLLA_VERSION=$(cat build/SCYLLA-VERSION-FILE | sed 's/\.rc/~rc/') SCYLLA_RELEASE=$(cat build/SCYLLA-RELEASE-FILE) echo $VERSION > version -./scripts/git-archive-all --extra version --force-submodules --prefix scylla-jmx ../scylla-jmx_$SCYLLA_VERSION-$SCYLLA_RELEASE.orig.tar.gz +./scripts/git-archive-all --extra version --force-submodules --prefix $PRODUCT-jmx ../$PRODUCT-jmx_$SCYLLA_VERSION-$SCYLLA_RELEASE.orig.tar.gz cp -a dist/debian/debian debian +if [ "$PRODUCT" != "scylla" ]; then + for i in debian/scylla-*;do + mv $i ${i/scylla-/$PRODUCT-} + done +fi if is_debian $TARGET; then REVISION="1~$TARGET" elif is_ubuntu $TARGET; then @@ -122,28 +129,28 @@ else echo "Unknown distribution: $TARGET" fi -MUSTACHE_DIST="\"debian\": true, \"$TARGET\": true" -pystache dist/debian/changelog.mustache "{ \"version\": \"$SCYLLA_VERSION\", \"release\": \"$SCYLLA_RELEASE\", \"revision\": \"$REVISION\", \"codename\": \"$TARGET\" }" > debian/changelog +MUSTACHE_DIST="\"debian\": true, \"$TARGET\": true, \"product\": \"$PRODUCT\", \"$PRODUCT\": true" +pystache dist/debian/changelog.mustache "{ $MUSTACHE_DIST, \"version\": \"$SCYLLA_VERSION\", \"release\": \"$SCYLLA_RELEASE\", \"revision\": \"$REVISION\", \"codename\": \"$TARGET\" }" > debian/changelog pystache dist/debian/rules.mustache "{ $MUSTACHE_DIST }" > debian/rules chmod a+rx debian/rules +pystache dist/debian/control.mustache "{ $MUSTACHE_DIST }" > debian/control if [ "$TARGET" != "trusty" ]; then pystache dist/common/systemd/scylla-jmx.service.mustache "{ $MUSTACHE_DIST }" > debian/scylla-jmx.service fi -cp ./dist/debian/pbuilderrc ~/.pbuilderrc -sudo rm -fv /var/cache/pbuilder/scylla-jmx-$TARGET.tgz -sudo -E DIST=$TARGET /usr/sbin/pbuilder clean -sudo -E DIST=$TARGET /usr/sbin/pbuilder create -sudo -E DIST=$TARGET /usr/sbin/pbuilder update +sudo rm -fv /var/cache/pbuilder/$PRODUCT-jmx-$TARGET.tgz +sudo PRODUCT=$PRODUCT DIST=$TARGET /usr/sbin/pbuilder clean --configfile ./dist/debian/pbuilderrc +sudo PRODUCT=$PRODUCT DIST=$TARGET /usr/sbin/pbuilder create --configfile ./dist/debian/pbuilderrc +sudo PRODUCT=$PRODUCT DIST=$TARGET /usr/sbin/pbuilder update --configfile ./dist/debian/pbuilderrc if [ "$TARGET" = "jessie" ]; then echo "apt-get install -y -t jessie-backports ca-certificates-java" > build/jessie-pkginst.sh chmod a+rx build/jessie-pkginst.sh - sudo -E DIST=$TARGET /usr/sbin/pbuilder execute build/jessie-pkginst.sh + sudo PRODUCT=$PRODUCT DIST=$TARGET /usr/sbin/pbuilder execute --configfile ./dist/debian/pbuilderrc build/jessie-pkginst.sh elif [ "$TARGET" = "bionic" ]; then echo "apt-get install -y ca-certificates-java openjdk-8-jdk-headless" > build/bionic-workaround.sh echo "update-ca-certificates -f" >> build/bionic-workaround.sh chmod a+rx build/bionic-workaround.sh - sudo -E DIST=$TARGET /usr/sbin/pbuilder execute --save-after-exec build/bionic-workaround.sh + sudo PRODUCT=$PRODUCT DIST=$TARGET /usr/sbin/pbuilder execute --configfile ./dist/debian/pbuilderrc --save-after-exec build/bionic-workaround.sh fi -sudo -E DIST=$TARGET pdebuild --buildresult build/debs +sudo PRODUCT=$PRODUCT DIST=$TARGET pdebuild --configfile ./dist/debian/pbuilderrc --buildresult build/debs diff --git a/dist/debian/changelog.mustache b/dist/debian/changelog.mustache index 6ea0464..62e9596 100644 --- a/dist/debian/changelog.mustache +++ b/dist/debian/changelog.mustache @@ -1,4 +1,4 @@ -scylla-jmx ({{version}}-{{release}}-{{revision}}) {{codename}}; urgency=medium +{{product}}-jmx ({{version}}-{{release}}-{{revision}}) {{codename}}; urgency=medium * Initial release. diff --git a/dist/debian/debian/control b/dist/debian/control.mustache similarity index 77% rename from dist/debian/debian/control rename to dist/debian/control.mustache index 66ae08e..e9d6fa6 100644 --- a/dist/debian/debian/control +++ b/dist/debian/control.mustache @@ -1,4 +1,4 @@ -Source: scylla-jmx +Source: {{product}}-jmx Maintainer: Takuya ASADA Homepage: http://scylladb.com Section: database @@ -6,9 +6,9 @@ Priority: optional Standards-Version: 3.9.5 Build-Depends: debhelper (>= 9), maven, openjdk-8-jdk-headless -Package: scylla-jmx +Package: {{product}}-jmx Architecture: all -Depends: ${shlibs:Depends}, ${misc:Depends}, openjdk-8-jre-headless | openjdk-8-jre | oracle-java8-set-default, scylla-server +Depends: ${shlibs:Depends}, ${misc:Depends}, openjdk-8-jre-headless | openjdk-8-jre | oracle-java8-set-default, {{product}}-server Description: Scylla JMX server binaries Scylla is a highly scalable, eventually consistent, distributed, partitioned row DB. diff --git a/dist/debian/pbuilderrc b/dist/debian/pbuilderrc index 77427e4..52a3b00 100644 --- a/dist/debian/pbuilderrc +++ b/dist/debian/pbuilderrc @@ -1,9 +1,9 @@ USENETWORK=yes BUILD_HOME=/tmp -BASETGZ="/var/cache/pbuilder/scylla-jmx-$DIST.tgz" +BASETGZ="/var/cache/pbuilder/$PRODUCT-jmx-$DIST.tgz" DISTRIBUTION="$DIST" -BUILDRESULT="/var/cache/pbuilder/scylla-jmx-$DIST/result/" -APTCACHE="/var/cache/pbuilder/scylla-jmx-$DIST/aptcache/" +BUILDRESULT="/var/cache/pbuilder/$PRODUCT-jmx-$DIST/result/" +APTCACHE="/var/cache/pbuilder/$PRODUCT-jmx-$DIST/aptcache/" ALLOWUNTRUSTED=yes if [ "$DIST" = "trusty" ] || [ "$DIST" = "xenial" ] || [ "$DIST" = "yakkety" ] || [ "$DIST" = "zesty" ] || [ "$DIST" = "artful" ] || [ "$DIST" = "bionic" ]; then diff --git a/dist/debian/rules.mustache b/dist/debian/rules.mustache index 70ce686..23d1139 100755 --- a/dist/debian/rules.mustache +++ b/dist/debian/rules.mustache @@ -1,7 +1,7 @@ #!/usr/bin/make -f -DOC = $(CURDIR)/debian/scylla-jmx/usr/share/doc/scylla-jmx -DEST = $(CURDIR)/debian/scylla-jmx/usr/lib/scylla/jmx +DOC = $(CURDIR)/debian/{{product}}-jmx/usr/share/doc/{{product}}-jmx +DEST = $(CURDIR)/debian/{{product}}-jmx/usr/lib/scylla/jmx M2_REPO= $(CURDIR)/m2 override_dh_auto_build: @@ -11,9 +11,9 @@ override_dh_auto_clean: rm -rf target m2 override_dh_auto_install: - mkdir -p $(CURDIR)/debian/scylla-jmx/etc/default/ && \ + mkdir -p $(CURDIR)/debian/{{product}}-jmx/etc/default/ && \ cp $(CURDIR)/dist/common/sysconfig/scylla-jmx \ - $(CURDIR)/debian/scylla-jmx/etc/default/ + $(CURDIR)/debian/{{product}}-jmx/etc/default/ mkdir -p $(DOC) && \ cp $(CURDIR)/*.md $(DOC) @@ -27,10 +27,20 @@ override_dh_auto_install: override_dh_installinit: {{#trusty}} +{{#scylla}} dh_installinit --no-start --upstart-only +{{/scylla}} +{{^scylla}} + dh_installinit --no-start --name scylla-jmx --upstart-only +{{/scylla}} {{/trusty}} {{^trusty}} +{{#scylla}} dh_installinit --no-start +{{/scylla}} +{{^scylla}} + dh_installinit --no-start --name scylla-jmx +{{/scylla}} {{/trusty}} %: