← Back to team overview

cloud-init-dev team mailing list archive

[Merge] lp:~xnox/cloud-init/fix-packaging into lp:cloud-init

 

Dimitri John Ledkov has proposed merging lp:~xnox/cloud-init/fix-packaging into lp:cloud-init.

Requested reviews:
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~xnox/cloud-init/fix-packaging/+merge/227931
-- 
https://code.launchpad.net/~xnox/cloud-init/fix-packaging/+merge/227931
Your team cloud init development team is requested to review the proposed merge of lp:~xnox/cloud-init/fix-packaging into lp:cloud-init.
=== modified file 'packages/bddeb'
--- packages/bddeb	2014-07-21 18:47:08 +0000
+++ packages/bddeb	2014-07-23 14:48:43 +0000
@@ -76,7 +76,7 @@
                              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))

=== modified file 'packages/debian/compat'
--- packages/debian/compat	2011-02-04 21:58:24 +0000
+++ packages/debian/compat	2014-07-23 14:48:43 +0000
@@ -1,1 +1,1 @@
-5
+9

=== modified file 'packages/debian/control.in'
--- packages/debian/control.in	2014-01-17 21:40:13 +0000
+++ packages/debian/control.in	2014-07-23 14:48:43 +0000
@@ -1,10 +1,11 @@
 ## This is a cheetah template
 Source: cloud-init
 Section: admin
-Priority: extra
+Priority: optional
 Maintainer: Scott Moser <smoser@xxxxxxxxxx>
-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 @@
                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
 

=== removed file 'packages/debian/pycompat'
--- packages/debian/pycompat	2011-02-04 21:58:24 +0000
+++ packages/debian/pycompat	1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
-2

=== modified file 'packages/debian/rules'
--- packages/debian/rules	2012-07-09 20:08:22 +0000
+++ packages/debian/rules	2014-07-23 14:48:43 +0000
@@ -1,18 +1,12 @@
 #!/usr/bin/make -f
 
 DEB_PYTHON2_MODULE_PACKAGES = cloud-init
-INIT_SYSTEM ?= upstart
-
-binary-install/cloud-init::cloud-init-fixups
-
-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
-	
+INIT_SYSTEM ?= upstart,systemd
+
+%:
+	dh $@ --with python2,systemd --build-system pybuild
+
+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

=== modified file 'setup.py'
--- setup.py	2014-02-03 22:53:31 +0000
+++ setup.py	2014-07-23 14:48:43 +0000
@@ -86,7 +86,7 @@
     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 @@
 
     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)
 


Follow ups