dist/debian: support package renaming on build script
To automatically rename packages on enterprise release, added package name prefix as a variable on build_deb.sh. Signed-off-by: Takuya ASADA <syuu@scylladb.com> Message-Id: <20180828010445.11920-2-syuu@scylladb.com>
This commit is contained in:
parent
a27d9601f5
commit
cd1c79f90f
29
dist/debian/build_deb.sh
vendored
29
dist/debian/build_deb.sh
vendored
|
@ -1,5 +1,7 @@
|
||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
PRODUCT=scylla
|
||||||
|
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
print_usage() {
|
print_usage() {
|
||||||
echo "build_deb.sh -target <codename>"
|
echo "build_deb.sh -target <codename>"
|
||||||
|
@ -111,9 +113,14 @@ VERSION=$(./SCYLLA-VERSION-GEN)
|
||||||
SCYLLA_VERSION=$(cat build/SCYLLA-VERSION-FILE | sed 's/\.rc/~rc/')
|
SCYLLA_VERSION=$(cat build/SCYLLA-VERSION-FILE | sed 's/\.rc/~rc/')
|
||||||
SCYLLA_RELEASE=$(cat build/SCYLLA-RELEASE-FILE)
|
SCYLLA_RELEASE=$(cat build/SCYLLA-RELEASE-FILE)
|
||||||
echo $VERSION > version
|
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
|
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
|
if is_debian $TARGET; then
|
||||||
REVISION="1~$TARGET"
|
REVISION="1~$TARGET"
|
||||||
elif is_ubuntu $TARGET; then
|
elif is_ubuntu $TARGET; then
|
||||||
|
@ -122,28 +129,28 @@ else
|
||||||
echo "Unknown distribution: $TARGET"
|
echo "Unknown distribution: $TARGET"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
MUSTACHE_DIST="\"debian\": true, \"$TARGET\": true"
|
MUSTACHE_DIST="\"debian\": true, \"$TARGET\": true, \"product\": \"$PRODUCT\", \"$PRODUCT\": true"
|
||||||
pystache dist/debian/changelog.mustache "{ \"version\": \"$SCYLLA_VERSION\", \"release\": \"$SCYLLA_RELEASE\", \"revision\": \"$REVISION\", \"codename\": \"$TARGET\" }" > debian/changelog
|
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
|
pystache dist/debian/rules.mustache "{ $MUSTACHE_DIST }" > debian/rules
|
||||||
chmod a+rx debian/rules
|
chmod a+rx debian/rules
|
||||||
|
pystache dist/debian/control.mustache "{ $MUSTACHE_DIST }" > debian/control
|
||||||
|
|
||||||
if [ "$TARGET" != "trusty" ]; then
|
if [ "$TARGET" != "trusty" ]; then
|
||||||
pystache dist/common/systemd/scylla-jmx.service.mustache "{ $MUSTACHE_DIST }" > debian/scylla-jmx.service
|
pystache dist/common/systemd/scylla-jmx.service.mustache "{ $MUSTACHE_DIST }" > debian/scylla-jmx.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp ./dist/debian/pbuilderrc ~/.pbuilderrc
|
sudo rm -fv /var/cache/pbuilder/$PRODUCT-jmx-$TARGET.tgz
|
||||||
sudo rm -fv /var/cache/pbuilder/scylla-jmx-$TARGET.tgz
|
sudo PRODUCT=$PRODUCT DIST=$TARGET /usr/sbin/pbuilder clean --configfile ./dist/debian/pbuilderrc
|
||||||
sudo -E DIST=$TARGET /usr/sbin/pbuilder clean
|
sudo PRODUCT=$PRODUCT DIST=$TARGET /usr/sbin/pbuilder create --configfile ./dist/debian/pbuilderrc
|
||||||
sudo -E DIST=$TARGET /usr/sbin/pbuilder create
|
sudo PRODUCT=$PRODUCT DIST=$TARGET /usr/sbin/pbuilder update --configfile ./dist/debian/pbuilderrc
|
||||||
sudo -E DIST=$TARGET /usr/sbin/pbuilder update
|
|
||||||
if [ "$TARGET" = "jessie" ]; then
|
if [ "$TARGET" = "jessie" ]; then
|
||||||
echo "apt-get install -y -t jessie-backports ca-certificates-java" > build/jessie-pkginst.sh
|
echo "apt-get install -y -t jessie-backports ca-certificates-java" > build/jessie-pkginst.sh
|
||||||
chmod a+rx 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
|
elif [ "$TARGET" = "bionic" ]; then
|
||||||
echo "apt-get install -y ca-certificates-java openjdk-8-jdk-headless" > build/bionic-workaround.sh
|
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
|
echo "update-ca-certificates -f" >> build/bionic-workaround.sh
|
||||||
chmod a+rx 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
|
fi
|
||||||
sudo -E DIST=$TARGET pdebuild --buildresult build/debs
|
sudo PRODUCT=$PRODUCT DIST=$TARGET pdebuild --configfile ./dist/debian/pbuilderrc --buildresult build/debs
|
||||||
|
|
2
dist/debian/changelog.mustache
vendored
2
dist/debian/changelog.mustache
vendored
|
@ -1,4 +1,4 @@
|
||||||
scylla-jmx ({{version}}-{{release}}-{{revision}}) {{codename}}; urgency=medium
|
{{product}}-jmx ({{version}}-{{release}}-{{revision}}) {{codename}}; urgency=medium
|
||||||
|
|
||||||
* Initial release.
|
* Initial release.
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Source: scylla-jmx
|
Source: {{product}}-jmx
|
||||||
Maintainer: Takuya ASADA <syuu@scylladb.com>
|
Maintainer: Takuya ASADA <syuu@scylladb.com>
|
||||||
Homepage: http://scylladb.com
|
Homepage: http://scylladb.com
|
||||||
Section: database
|
Section: database
|
||||||
|
@ -6,9 +6,9 @@ Priority: optional
|
||||||
Standards-Version: 3.9.5
|
Standards-Version: 3.9.5
|
||||||
Build-Depends: debhelper (>= 9), maven, openjdk-8-jdk-headless
|
Build-Depends: debhelper (>= 9), maven, openjdk-8-jdk-headless
|
||||||
|
|
||||||
Package: scylla-jmx
|
Package: {{product}}-jmx
|
||||||
Architecture: all
|
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
|
Description: Scylla JMX server binaries
|
||||||
Scylla is a highly scalable, eventually consistent, distributed,
|
Scylla is a highly scalable, eventually consistent, distributed,
|
||||||
partitioned row DB.
|
partitioned row DB.
|
6
dist/debian/pbuilderrc
vendored
6
dist/debian/pbuilderrc
vendored
|
@ -1,9 +1,9 @@
|
||||||
USENETWORK=yes
|
USENETWORK=yes
|
||||||
BUILD_HOME=/tmp
|
BUILD_HOME=/tmp
|
||||||
BASETGZ="/var/cache/pbuilder/scylla-jmx-$DIST.tgz"
|
BASETGZ="/var/cache/pbuilder/$PRODUCT-jmx-$DIST.tgz"
|
||||||
DISTRIBUTION="$DIST"
|
DISTRIBUTION="$DIST"
|
||||||
BUILDRESULT="/var/cache/pbuilder/scylla-jmx-$DIST/result/"
|
BUILDRESULT="/var/cache/pbuilder/$PRODUCT-jmx-$DIST/result/"
|
||||||
APTCACHE="/var/cache/pbuilder/scylla-jmx-$DIST/aptcache/"
|
APTCACHE="/var/cache/pbuilder/$PRODUCT-jmx-$DIST/aptcache/"
|
||||||
ALLOWUNTRUSTED=yes
|
ALLOWUNTRUSTED=yes
|
||||||
|
|
||||||
if [ "$DIST" = "trusty" ] || [ "$DIST" = "xenial" ] || [ "$DIST" = "yakkety" ] || [ "$DIST" = "zesty" ] || [ "$DIST" = "artful" ] || [ "$DIST" = "bionic" ]; then
|
if [ "$DIST" = "trusty" ] || [ "$DIST" = "xenial" ] || [ "$DIST" = "yakkety" ] || [ "$DIST" = "zesty" ] || [ "$DIST" = "artful" ] || [ "$DIST" = "bionic" ]; then
|
||||||
|
|
18
dist/debian/rules.mustache
vendored
18
dist/debian/rules.mustache
vendored
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/make -f
|
#!/usr/bin/make -f
|
||||||
|
|
||||||
DOC = $(CURDIR)/debian/scylla-jmx/usr/share/doc/scylla-jmx
|
DOC = $(CURDIR)/debian/{{product}}-jmx/usr/share/doc/{{product}}-jmx
|
||||||
DEST = $(CURDIR)/debian/scylla-jmx/usr/lib/scylla/jmx
|
DEST = $(CURDIR)/debian/{{product}}-jmx/usr/lib/scylla/jmx
|
||||||
M2_REPO= $(CURDIR)/m2
|
M2_REPO= $(CURDIR)/m2
|
||||||
|
|
||||||
override_dh_auto_build:
|
override_dh_auto_build:
|
||||||
|
@ -11,9 +11,9 @@ override_dh_auto_clean:
|
||||||
rm -rf target m2
|
rm -rf target m2
|
||||||
|
|
||||||
override_dh_auto_install:
|
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 \
|
cp $(CURDIR)/dist/common/sysconfig/scylla-jmx \
|
||||||
$(CURDIR)/debian/scylla-jmx/etc/default/
|
$(CURDIR)/debian/{{product}}-jmx/etc/default/
|
||||||
|
|
||||||
mkdir -p $(DOC) && \
|
mkdir -p $(DOC) && \
|
||||||
cp $(CURDIR)/*.md $(DOC)
|
cp $(CURDIR)/*.md $(DOC)
|
||||||
|
@ -27,10 +27,20 @@ override_dh_auto_install:
|
||||||
|
|
||||||
override_dh_installinit:
|
override_dh_installinit:
|
||||||
{{#trusty}}
|
{{#trusty}}
|
||||||
|
{{#scylla}}
|
||||||
dh_installinit --no-start --upstart-only
|
dh_installinit --no-start --upstart-only
|
||||||
|
{{/scylla}}
|
||||||
|
{{^scylla}}
|
||||||
|
dh_installinit --no-start --name scylla-jmx --upstart-only
|
||||||
|
{{/scylla}}
|
||||||
{{/trusty}}
|
{{/trusty}}
|
||||||
{{^trusty}}
|
{{^trusty}}
|
||||||
|
{{#scylla}}
|
||||||
dh_installinit --no-start
|
dh_installinit --no-start
|
||||||
|
{{/scylla}}
|
||||||
|
{{^scylla}}
|
||||||
|
dh_installinit --no-start --name scylla-jmx
|
||||||
|
{{/scylla}}
|
||||||
{{/trusty}}
|
{{/trusty}}
|
||||||
|
|
||||||
%:
|
%:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user