diff options
Diffstat (limited to 'packages')
-rwxr-xr-x | packages/bddeb | 11 | ||||
-rw-r--r-- | packages/debian/cloud-init.postinst | 16 | ||||
-rw-r--r-- | packages/debian/cloud-init.preinst | 20 | ||||
-rw-r--r-- | packages/debian/control.in | 3 | ||||
-rwxr-xr-x | packages/debian/rules.in | 14 |
5 files changed, 53 insertions, 11 deletions
diff --git a/packages/bddeb b/packages/bddeb index c4efe264..c141b1ab 100755 --- a/packages/bddeb +++ b/packages/bddeb @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +import glob import os import shutil import sys @@ -105,11 +106,11 @@ def write_debian_folder(root, version, revno, pkgmap, util.abs_join(deb_dir, 'rules'), params={'python': python, 'pyver': pyver}) - # Just copy the following directly - for base_fn in ['dirs', 'copyright', 'compat']: - shutil.copy(util.abs_join(find_root(), - 'packages', 'debian', base_fn), - util.abs_join(deb_dir, base_fn)) + # Just copy any other files directly (including .in) + pdeb_d = util.abs_join(find_root(), 'packages', 'debian') + for f in [os.path.join(pdeb_d, f) for f in os.listdir(pdeb_d)]: + if os.path.isfile(f): + shutil.copy(f, util.abs_join(deb_dir, os.path.basename(f))) def main(): diff --git a/packages/debian/cloud-init.postinst b/packages/debian/cloud-init.postinst new file mode 100644 index 00000000..cdd0466d --- /dev/null +++ b/packages/debian/cloud-init.postinst @@ -0,0 +1,16 @@ +#!/bin/sh +cleanup_lp1552999() { + local oldver="$1" last_bad_ver="0.7.7~bzr1178" + dpkg --compare-versions "$oldver" le "$last_bad_ver" || return 0 + local edir="/etc/systemd/system/multi-user.target.wants" + rm -f "$edir/cloud-config.service" "$edir/cloud-final.service" \ + "$edir/cloud-init-local.service" "$edir/cloud-init.service" +} + + +#DEBHELPER# + +if [ "$1" = "configure" ]; then + oldver="$2" + cleanup_lp1552999 "$oldver" +fi diff --git a/packages/debian/cloud-init.preinst b/packages/debian/cloud-init.preinst new file mode 100644 index 00000000..3c2af06d --- /dev/null +++ b/packages/debian/cloud-init.preinst @@ -0,0 +1,20 @@ +#!/bin/sh +# vi: ts=4 expandtab + +cleanup_lp1552999() { + local oldver="$1" last_bad_ver="0.7.7~bzr1178" + dpkg --compare-versions "$oldver" le "$last_bad_ver" || return 0 + local hdir="/var/lib/systemd/deb-systemd-helper-enabled" + hdir="$hdir/multi-user.target.wants" + local edir="/etc/systemd/system/multi-user.target.wants" + rm -f "$hdir/cloud-config.service" "$hdir/cloud-final.service" \ + "$hdir/cloud-init-local.service" "$hdir/cloud-init.service" +} + + +if [ "$1" = "upgrade" ]; then + oldver="$2" + cleanup_lp1552999 "$oldver" +fi + +#DEBHELPER# diff --git a/packages/debian/control.in b/packages/debian/control.in index 5fe16e43..16713577 100644 --- a/packages/debian/control.in +++ b/packages/debian/control.in @@ -7,6 +7,7 @@ Build-Depends: debhelper (>= 9), dh-python, dh-systemd, iproute2, + pep8, pyflakes, ${python}, ${test_requires}, @@ -18,8 +19,8 @@ Package: cloud-init Architecture: all Depends: procps, ${python}, - ${requires}, ${misc:Depends}, + ${${python}:Depends} Recommends: eatmydata, sudo, software-properties-common, gdisk XB-Python-Version: ${python:Versions} Description: Init scripts for cloud instances diff --git a/packages/debian/rules.in b/packages/debian/rules.in index bb2e1d5c..cf2dd405 100755 --- a/packages/debian/rules.in +++ b/packages/debian/rules.in @@ -1,9 +1,8 @@ ## template:basic #!/usr/bin/make -f - INIT_SYSTEM ?= upstart,systemd -PYVER ?= python${pyver} export PYBUILD_INSTALL_ARGS=--init-system=$(INIT_SYSTEM) +PYVER ?= python${pyver} %: dh $@ --with $(PYVER),systemd --buildsystem pybuild @@ -14,6 +13,11 @@ override_dh_install: cp tools/21-cloudinit.conf debian/cloud-init/etc/rsyslog.d/21-cloudinit.conf override_dh_auto_test: - # Because setup tools didn't copy data... - [ ! -d .pybuild/pythonX.Y_?.?/build/tests ] || cp -r tests/data .pybuild/pythonX.Y_?.?/build/tests - http_proxy= dh_auto_test -- --test-nose +ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) + http_proxy= make PYVER=${pyver} check +else + @echo check disabled by DEB_BUILD_OPTIONS=$(DEB_BUILD_OPTIONS) +endif + +override_dh_systemd_start: + dh_systemd_start --no-restart-on-upgrade --no-start |