summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri John Ledkov <dimitri.ledkov@canonical.com>2014-07-23 15:47:16 +0100
committerDimitri John Ledkov <dimitri.ledkov@canonical.com>2014-07-23 15:47:16 +0100
commita04baf85a8eea4eb02168429aa6bfaaeb2effb42 (patch)
tree1d9d8eb3396bc8c84322e69878d8f60cc063fd21
parente9f9c1e1cd47786b93491fd0f73467674c88828e (diff)
downloadvyos-cloud-init-a04baf85a8eea4eb02168429aa6bfaaeb2effb42.tar.gz
vyos-cloud-init-a04baf85a8eea4eb02168429aa6bfaaeb2effb42.zip
Modernise packaging, and allow multiple init system installation (based on smoser pastebins).
-rwxr-xr-xpackages/bddeb2
-rw-r--r--packages/debian/compat2
-rw-r--r--packages/debian/control.in13
-rw-r--r--packages/debian/pycompat1
-rwxr-xr-xpackages/debian/rules20
-rwxr-xr-xsetup.py22
6 files changed, 34 insertions, 26 deletions
diff --git a/packages/bddeb b/packages/bddeb
index 5c538739..8ac21e1b 100755
--- a/packages/bddeb
+++ b/packages/bddeb
@@ -76,7 +76,7 @@ def write_debian_folder(root, version, revno, append_requires=[]):
params={'requires': requires})
# Just copy the following directly
- for base_fn in ['dirs', 'copyright', 'compat', 'pycompat', 'rules']:
+ for base_fn in ['dirs', 'copyright', 'compat', 'rules']:
shutil.copy(util.abs_join(find_root(),
'packages', 'debian', base_fn),
util.abs_join(deb_dir, base_fn))
diff --git a/packages/debian/compat b/packages/debian/compat
index 7ed6ff82..ec635144 100644
--- a/packages/debian/compat
+++ b/packages/debian/compat
@@ -1 +1 @@
-5
+9
diff --git a/packages/debian/control.in b/packages/debian/control.in
index 7e42b94b..6e383dcc 100644
--- a/packages/debian/control.in
+++ b/packages/debian/control.in
@@ -1,10 +1,11 @@
## This is a cheetah template
Source: cloud-init
Section: admin
-Priority: extra
+Priority: optional
Maintainer: Scott Moser <smoser@ubuntu.com>
-Build-Depends: cdbs,
- debhelper (>= 5.0.38),
+Build-Depends: debhelper (>= 9),
+ dh-python,
+ dh-systemd,
python (>= 2.6.6-3~),
python-nose,
pyflakes,
@@ -12,7 +13,11 @@ Build-Depends: cdbs,
python-setuptools,
python-cheetah,
python-mocker,
- python-setuptools
+ python-setuptools,
+ python-httpretty,
+#for $r in $requires
+ ${r},
+#end for
XS-Python-Version: all
Standards-Version: 3.9.3
diff --git a/packages/debian/pycompat b/packages/debian/pycompat
deleted file mode 100644
index 0cfbf088..00000000
--- a/packages/debian/pycompat
+++ /dev/null
@@ -1 +0,0 @@
-2
diff --git a/packages/debian/rules b/packages/debian/rules
index 7623ac9d..c1344e60 100755
--- a/packages/debian/rules
+++ b/packages/debian/rules
@@ -1,18 +1,12 @@
#!/usr/bin/make -f
DEB_PYTHON2_MODULE_PACKAGES = cloud-init
-INIT_SYSTEM ?= upstart
+INIT_SYSTEM ?= upstart,systemd
-binary-install/cloud-init::cloud-init-fixups
+%:
+ dh $@ --with python2,systemd --build-system pybuild
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/class/python-distutils.mk
-
-DEB_PYTHON_INSTALL_ARGS_ALL += --init-system=$(INIT_SYSTEM)
-
-DEB_DH_INSTALL_SOURCEDIR := debian/tmp
-
-cloud-init-fixups:
- install -d $(DEB_DESTDIR)/etc/rsyslog.d
- cp tools/21-cloudinit.conf $(DEB_DESTDIR)/etc/rsyslog.d/21-cloudinit.conf
-
+override_dh_install:
+ dh_install
+ install -d debian/cloud-init/etc/rsyslog.d
+ cp tools/21-cloudinit.conf debian/cloud-init/etc/rsyslog.d/21-cloudinit.conf
diff --git a/setup.py b/setup.py
index 9118e5f6..e27997de 100755
--- a/setup.py
+++ b/setup.py
@@ -86,7 +86,7 @@ class InitsysInstallData(install):
user_options = install.user_options + [
# This will magically show up in member variable 'init_sys'
('init-system=', None,
- ('init system to configure (%s) [default: None]') %
+ ('init system(s) to configure (%s) [default: None]') %
(", ".join(INITSYS_TYPES))
),
]
@@ -97,13 +97,23 @@ class InitsysInstallData(install):
def finalize_options(self):
install.finalize_options(self)
- if self.init_system and self.init_system not in INITSYS_TYPES:
+
+ if self.init_systems and isinstance(self.init_systems, str):
+ self.init_systems = self.init_systems.split(",")
+
+ if len(self.init_system) == 0:
raise DistutilsArgError(("You must specify one of (%s) when"
- " specifying a init system!") % (", ".join(INITSYS_TYPES)))
+ " specifying init system(s)!") % (", ".join(INITSYS_TYPES)))
+
+ bad = [f for f in self.init_system if f not in INITSYS_TYPES]
+ if len(bad) != 0:
+ raise DistutilsArgError(
+ "Invalid --init-system: %s" % (','.join(bad)))
elif self.init_system:
- self.distribution.data_files.append(
- (INITSYS_ROOTS[self.init_system],
- INITSYS_FILES[self.init_system]))
+ for sys in self.init_systems:
+ print("adding %s: %s" % (sys, str(INITSYS_ROOTS[sys])))
+ self.distribution.data_files.append(
+ (INITSYS_ROOTS[sys], INITSYS_FILES[sys]))
# Force that command to reinitalize (with new file list)
self.distribution.reinitialize_command('install_data', True)