From ef15d9541612249f0234184a7730311861db1dec Mon Sep 17 00:00:00 2001 From: Takuya ASADA Date: Sat, 30 Apr 2016 07:40:40 +0000 Subject: [PATCH 1/4] dist: #!/bin/bash for all scripts Like we did on scylla-server, switch to bash. --- dist/redhat/build_rpm.sh | 2 +- dist/ubuntu/build_deb.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/redhat/build_rpm.sh b/dist/redhat/build_rpm.sh index 21c1d21..4211191 100755 --- a/dist/redhat/build_rpm.sh +++ b/dist/redhat/build_rpm.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/bash -e RPMBUILD=`pwd`/build/rpmbuild diff --git a/dist/ubuntu/build_deb.sh b/dist/ubuntu/build_deb.sh index 7995e8f..348b9c8 100644 --- a/dist/ubuntu/build_deb.sh +++ b/dist/ubuntu/build_deb.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/bash -e if [ ! -e dist/ubuntu/build_deb.sh ]; then echo "run build_deb.sh in top of scylla dir" From d8d3023334348f875533032d91cae74d2877fe0d Mon Sep 17 00:00:00 2001 From: Takuya ASADA Date: Sat, 30 Apr 2016 07:42:33 +0000 Subject: [PATCH 2/4] dist/ubuntu: generate correct distribution codename on debian/changelog Since we supported more than one version of Ubuntu, need to generate each codename on changelog. --- dist/ubuntu/build_deb.sh | 5 +++++ dist/ubuntu/changelog.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dist/ubuntu/build_deb.sh b/dist/ubuntu/build_deb.sh index 348b9c8..97ac500 100644 --- a/dist/ubuntu/build_deb.sh +++ b/dist/ubuntu/build_deb.sh @@ -9,6 +9,10 @@ if [ -e debian ] || [ -e build ] || [ -e target ] || [ -e m2 ] || [ -e dependenc rm -rf debian build target m2 dependency-reduced-pom.xml fi +DISTRIBUTION=`lsb_release -i|awk '{print $3}'` +RELEASE=`lsb_release -r|awk '{print $2}'` +CODENAME=`lsb_release -c|awk '{print $2}'` + VERSION=$(./SCYLLA-VERSION-GEN) SCYLLA_VERSION=$(cat build/SCYLLA-VERSION-FILE | sed 's/\.rc/~rc/') SCYLLA_RELEASE=$(cat build/SCYLLA-RELEASE-FILE) @@ -22,6 +26,7 @@ cp -a dist/ubuntu/debian debian cp dist/ubuntu/changelog.in debian/changelog sed -i -e "s/@@VERSION@@/$SCYLLA_VERSION/g" debian/changelog sed -i -e "s/@@RELEASE@@/$SCYLLA_RELEASE/g" debian/changelog +sed -i -e "s/@@CODENAME@@/$CODENAME/g" debian/changelog sudo apt-get -y install debhelper maven openjdk-7-jdk devscripts debuild -r fakeroot -us -uc diff --git a/dist/ubuntu/changelog.in b/dist/ubuntu/changelog.in index e6f6b89..966f785 100644 --- a/dist/ubuntu/changelog.in +++ b/dist/ubuntu/changelog.in @@ -1,4 +1,4 @@ -scylla-jmx (@@VERSION@@-@@RELEASE@@-ubuntu1) trusty; urgency=medium +scylla-jmx (@@VERSION@@-@@RELEASE@@-ubuntu1) @@CODENAME@@; urgency=medium * Initial release. From 72aae6bf3b1e59f4a7e2fe0b4973da34727f8461 Mon Sep 17 00:00:00 2001 From: Takuya ASADA Date: Sat, 30 Apr 2016 07:44:01 +0000 Subject: [PATCH 3/4] dist/ubuntu: resolve build time dependency by mk-build-deps command Resolve dependency packages from debian/control, intead of doing apt-get manually. --- dist/ubuntu/build_deb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/ubuntu/build_deb.sh b/dist/ubuntu/build_deb.sh index 97ac500..cb3fdea 100644 --- a/dist/ubuntu/build_deb.sh +++ b/dist/ubuntu/build_deb.sh @@ -28,5 +28,5 @@ sed -i -e "s/@@VERSION@@/$SCYLLA_VERSION/g" debian/changelog sed -i -e "s/@@RELEASE@@/$SCYLLA_RELEASE/g" debian/changelog sed -i -e "s/@@CODENAME@@/$CODENAME/g" debian/changelog -sudo apt-get -y install debhelper maven openjdk-7-jdk devscripts +echo Y | sudo mk-build-deps -i -r debuild -r fakeroot -us -uc From 19a0e72752a3a02c3a7449cba618b6e8b382989a Mon Sep 17 00:00:00 2001 From: Takuya ASADA Date: Sat, 30 Apr 2016 07:47:09 +0000 Subject: [PATCH 4/4] dist/ubuntu: fix build error on Ubuntu 16.04 --- dist/ubuntu/build_deb.sh | 6 ++++++ dist/ubuntu/debian/control | 4 ++-- dist/ubuntu/{debian/rules => rules.in} | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) rename dist/ubuntu/{debian/rules => rules.in} (93%) diff --git a/dist/ubuntu/build_deb.sh b/dist/ubuntu/build_deb.sh index cb3fdea..7e0a5bb 100644 --- a/dist/ubuntu/build_deb.sh +++ b/dist/ubuntu/build_deb.sh @@ -24,9 +24,15 @@ echo $VERSION > version cp -a dist/ubuntu/debian debian cp dist/ubuntu/changelog.in debian/changelog +cp dist/ubuntu/rules.in debian/rules sed -i -e "s/@@VERSION@@/$SCYLLA_VERSION/g" debian/changelog sed -i -e "s/@@RELEASE@@/$SCYLLA_RELEASE/g" debian/changelog sed -i -e "s/@@CODENAME@@/$CODENAME/g" debian/changelog +if [ "$RELEASE" = "14.04" ]; then + sed -i -e "s/@@DH_INSTALLINIT@@/--upstart-only/g" debian/rules +else + sed -i -e "s/@@DH_INSTALLINIT@@//g" debian/rules +fi echo Y | sudo mk-build-deps -i -r debuild -r fakeroot -us -uc diff --git a/dist/ubuntu/debian/control b/dist/ubuntu/debian/control index 1def5fb..223a171 100644 --- a/dist/ubuntu/debian/control +++ b/dist/ubuntu/debian/control @@ -4,11 +4,11 @@ Homepage: http://scylladb.com Section: database Priority: optional Standards-Version: 3.9.5 -Build-Depends: debhelper (>= 9), maven, openjdk-7-jdk | java7-jdk | openjdk-8-jdk | java8-jdk +Build-Depends: debhelper (>= 9), maven, default-jdk | java7-jdk | java8-jdk Package: scylla-jmx Architecture: all -Depends: ${shlibs:Depends}, ${misc:Depends}, openjdk-7-jre-headless | openjdk-8-jre-headless | java-runtime-headless, scylla-server +Depends: ${shlibs:Depends}, ${misc:Depends}, default-jre-headless | java-runtime-headless, scylla-server Description: Scylla JMX server binaries Scylla is a highly scalable, eventually consistent, distributed, partitioned row DB. diff --git a/dist/ubuntu/debian/rules b/dist/ubuntu/rules.in similarity index 93% rename from dist/ubuntu/debian/rules rename to dist/ubuntu/rules.in index 2268912..d63103b 100755 --- a/dist/ubuntu/debian/rules +++ b/dist/ubuntu/rules.in @@ -24,7 +24,7 @@ override_dh_auto_install: cp $(CURDIR)/target/scylla-jmx-1.0.jar $(DEST) override_dh_installinit: - dh_installinit --no-start --upstart-only + dh_installinit --no-start @@DH_INSTALLINIT@@ %: dh $@