[elbe-devel] [PATCH 21/25] py3: debian - produce python3 in python2 packages

Manuel Traut manut at linutronix.de
Mon Dec 11 10:11:15 CET 2017


move from compat 7 to 9 and use pybuild instead of python_distutils

preseed relevant package names with python- or python3-

Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 .gitignore                                         |  12 +-
 debian/compat                                      |   2 +-
 debian/control                                     | 126 ++++++++++++++++++---
 debian/elbe-common.lintian-overrides               |   2 -
 debian/elbe-schema.install                         |   1 +
 ...-common.xmlcatalogs => elbe-schema.xmlcatalogs} |   0
 debian/python-elbe-bin.install                     |   2 +
 debian/python-elbe-bin.lintian-overrides           |   2 +
 ...ildenv.install => python-elbe-buildenv.install} |   0
 ...denv.postinst => python-elbe-buildenv.postinst} |   0
 ...e-common.install => python-elbe-common.install} |   3 -
 ...control.install => python-elbe-control.install} |   0
 debian/python3-elbe-buildenv.install               |  29 +++++
 debian/python3-elbe-buildenv.postinst              |   4 +
 debian/python3-elbe-common.install                 |  32 ++++++
 debian/python3-elbe-control.install                |   5 +
 debian/rules                                       |   2 +-
 elbepack/commands/adjustpkgs.py                    |   6 +-
 elbepack/init/preseed.cfg.mako                     |   2 +-
 19 files changed, 197 insertions(+), 33 deletions(-)
 delete mode 100644 debian/elbe-common.lintian-overrides
 create mode 100644 debian/elbe-schema.install
 rename debian/{elbe-common.xmlcatalogs => elbe-schema.xmlcatalogs} (100%)
 create mode 100644 debian/python-elbe-bin.install
 create mode 100644 debian/python-elbe-bin.lintian-overrides
 rename debian/{elbe-buildenv.install => python-elbe-buildenv.install} (100%)
 rename debian/{elbe-buildenv.postinst => python-elbe-buildenv.postinst} (100%)
 rename debian/{elbe-common.install => python-elbe-common.install} (95%)
 rename debian/{elbe-control.install => python-elbe-control.install} (100%)
 create mode 100644 debian/python3-elbe-buildenv.install
 create mode 100644 debian/python3-elbe-buildenv.postinst
 create mode 100644 debian/python3-elbe-common.install
 create mode 100644 debian/python3-elbe-control.install

diff --git a/.gitignore b/.gitignore
index 461dc605..135c7d14 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,12 +1,18 @@
 tags
+.pybuild
 elbe.egg-info
 debian/elbe-bootup-check/
-debian/elbe-buildenv/
-debian/elbe-common/
-debian/elbe-control/
+debian/python-elbe-buildenv/
+debian/python3-elbe-buildenv/
+debian/python-elbe-bin/
+debian/python-elbe-common/
+debian/python3-elbe-common/
+debian/python-elbe-control/
+debian/python3-elbe-control/
 debian/elbe-daemon/
 debian/elbe-debianize/
 debian/elbe-doc/
+debian/elbe-schema/
 debian/elbe-soap/
 debian/elbe-updated/
 *.debhelper
diff --git a/debian/compat b/debian/compat
index 7f8f011e..ec635144 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-7
+9
diff --git a/debian/control b/debian/control
index fa12f1d6..c9454ae5 100644
--- a/debian/control
+++ b/debian/control
@@ -2,12 +2,16 @@ Source: elbe
 Section: misc
 Priority: optional
 Maintainer: Manuel Traut <manut at linutronix.de>
-Build-Depends: dh-python,
-  debhelper (>= 7),
-  dh-systemd (>= 1.5),
+Build-Depends: debhelper (>= 9),
+  dh-python,
+  dh-systemd,
+  python-setuptools,
   python (>= 2.7~),
-  python-mako,
   python-lxml,
+  python-mako,
+  python3,
+  python3-lxml,
+  python3-mako,
   dia,
   asciidoc,
   xmlto,
@@ -27,9 +31,28 @@ Description: man-pages, examples and documentation
  man-pages for elbe and all elbe subcommands. Some documentation and howtos.
  And examples for several targets.
 
-Package: elbe-common
+Package: elbe-schema
+Architecture: all
+Conflicts: elbe-common
+Depends: ${misc:Depends}
+Description: xml schema files
+ Common files for ELBE (embedded linux build environment). These
+ schemas are used by ELBE.
+
+Package: python-elbe-bin
+Conflicts: elbe-common
+Architecture: all
+Depends: python-elbe-common (= ${binary:Version})
+Description: elbe executable
+ Common files for ELBE (embedded linux build environment). These
+ python-modules are shared by several elbe subcommands.
+
+Package: python-elbe-common
 Architecture: all
+Conflicts: elbe-common
 Depends: ${misc:Depends},
+  elbe-schema (= ${binary:Version}),
+  python-elbe-bin (= ${binary:Version}),
   python (>= 2.7~),
   python-lxml,
   python-apt,
@@ -42,6 +65,22 @@ Description: common files
  Common files for ELBE (embedded linux build environment). These
  python-modules are shared by several elbe subcommands.
 
+Package: python3-elbe-common
+Architecture: all
+Depends: ${misc:Depends},
+  elbe-schema (= ${binary:Version}),
+  python3,
+  python3-lxml,
+  python3-apt,
+  python3-gpgme,
+  python3-gpg,
+  python3-libvirt,
+  wget,
+  cpio
+Description: common files
+ Common files for ELBE (embedded linux build environment). These
+ python-modules are shared by several elbe subcommands.
+
 Package: elbe-debianize
 Architecture: all
 Depends: ${misc:Depends},
@@ -49,7 +88,7 @@ Depends: ${misc:Depends},
   devscripts,
   libdistro-info-perl,
   libparse-debcontrol-perl,
-  elbe-common (= ${binary:Version}),
+  python-elbe-common (= ${binary:Version}),
   python-mako,
   python-npyscreen
 Description: Wizard for debian foler generation
@@ -59,8 +98,8 @@ Package: elbe
 Architecture: all
 Depends: ${misc:Depends},
   python (>= 2.7~),
-  elbe-common (= ${binary:Version}),
-  elbe-control (= ${binary:Version}),
+  python-elbe-bin (= ${binary:Version}),
+  python-elbe-control (= ${binary:Version}),
   qemu-utils,
   qemu-kvm (>= 1:2.1),
   python-mako,
@@ -76,14 +115,51 @@ Package: elbe-daemon
 Architecture: all
 Depends: ${misc:Depends},
   python (>= 2.7~),
-  elbe-common (= ${binary:Version}),
-  elbe-buildenv (= ${binary:Version}),
+  python-elbe-common (= ${binary:Version}),
+  python-elbe-buildenv (= ${binary:Version}),
   python-cherrypy3, python-beaker, openssh-server, lsb-base (>= 3.0-6)
 Description: wsgi daemon interface
  subcommand to start wsgi services.
 
-Package: elbe-buildenv
+Package: python3-elbe-buildenv
 Architecture: all
+Depends: ${misc:Depends},
+  python3,
+  apt-rdepends,
+  binfmt-support,
+  debootstrap,
+  dosfstools,
+  dpkg-dev,
+  python3-elbe-common (= ${binary:Version}),
+  genisoimage,
+  mtd-utils,
+  python3-apt,
+  python3-mako,
+  python3-parted,
+  python3-passlib,
+  python3-sqlalchemy,
+  python3-debian,
+  qemu-user-static,
+  reprepro,
+  rsync,
+  kpartx,
+  squashfs-tools,
+  sudo,
+  pbuilder,
+  git,
+  ca-certificates,
+  subversion,
+  haveged
+Description: Embedded Linux Build Environment Server Component
+ This package is typically installed in a virtual machine (that can be created
+ with the 'elbe initvm create' command from the 'elbe' package). Several
+ subcommands need to be executed with root privileges. It is not recommended to
+ install this package on a native system.
+
+
+Package: python-elbe-buildenv
+Architecture: all
+Conflicts: elbe-buildenv
 Depends: ${misc:Depends},
   python (>= 2.7~),
   apt-rdepends,
@@ -91,7 +167,7 @@ Depends: ${misc:Depends},
   debootstrap,
   dosfstools,
   dpkg-dev,
-  elbe-common (= ${binary:Version}),
+  python-elbe-common (= ${binary:Version}),
   genisoimage,
   mtd-utils,
   python-apt,
@@ -123,7 +199,7 @@ Package: elbe-bootup-check
 Architecture: all
 Depends: ${misc:Depends},
   python (>= 2.7~),
-  elbe-common (= ${binary:Version}),
+  python-elbe-common (= ${binary:Version}),
   python-apt, lsb-base (>= 3.0-6)
 Description: bootup checker
  This package is typically installed on a embedded system. The bootup checker
@@ -134,28 +210,42 @@ Architecture: all
 Depends: ${misc:Depends},
   python (>= 2.7~),
   python-spyne,
-  elbe-buildenv (= ${binary:Version}),
+  python-elbe-buildenv (= ${binary:Version}),
   elbe-daemon (= ${binary:Version})
 Description: SOAP Interface for elbe buildenv
  Enables remote control of the elbe buildenv via SOAP.
 
-Package: elbe-control
+Package: python-elbe-control
 Architecture: all
+Conflicts: elbe-control
 Depends: ${misc:Depends},
   python (>= 2.7~),
   python-suds,
   python-debian,
-  elbe-common (= ${binary:Version}),
+  python-elbe-common (= ${binary:Version}),
   libvirt-clients,
   libvirt-daemon-system
 Description: Commandline Tool to control an elbe buildenv
  The SOAP Interface is used to control an elbe buildenv.
 
+Package: python3-elbe-control
+Architecture: all
+Depends: ${misc:Depends},
+  python3,
+  python3-suds,
+  python3-debian,
+  python3-elbe-common (= ${binary:Version}),
+  libvirt-clients,
+  libvirt-daemon-system
+Description: Commandline Tool to control an elbe buildenv
+ The SOAP Interface is used to control an elbe buildenv.
+
+
 Package: elbe-updated
 Architecture: all
 Depends: ${misc:Depends},
   python (>= 2.7~),
-  elbe-common (= ${binary:Version}),
+  python-elbe-common (= ${binary:Version}),
   python-lxml (>= 2.3.2-1),
   python-tz (>= 2012c-1),
   python-pyinotify,
@@ -168,6 +258,6 @@ Suggests: python-pyudev,
 Description: update daemon for embedded systems
  This package is typically installed on a embedded system. The update daemon
  monitors a directory or USB mounts. If an ELBE update file (generated by
- 'elbe gen_update' command from the 'elbe-buildenv' package) is placed in this
+ 'elbe gen_update' command from the 'python-elbe-buildenv' package) is placed in this
  directory the update will be applied.
  Downgrades are possible by the integrated SOAP interface.
diff --git a/debian/elbe-common.lintian-overrides b/debian/elbe-common.lintian-overrides
deleted file mode 100644
index 8f16ce0f..00000000
--- a/debian/elbe-common.lintian-overrides
+++ /dev/null
@@ -1,2 +0,0 @@
-# documentation is provided in elbe-doc
-elbe-common: binary-without-manpage usr/bin/elbe
diff --git a/debian/elbe-schema.install b/debian/elbe-schema.install
new file mode 100644
index 00000000..7cb5f41f
--- /dev/null
+++ b/debian/elbe-schema.install
@@ -0,0 +1 @@
+schema/*xsd usr/share/xml/elbe-common/
diff --git a/debian/elbe-common.xmlcatalogs b/debian/elbe-schema.xmlcatalogs
similarity index 100%
rename from debian/elbe-common.xmlcatalogs
rename to debian/elbe-schema.xmlcatalogs
diff --git a/debian/python-elbe-bin.install b/debian/python-elbe-bin.install
new file mode 100644
index 00000000..0afb26cf
--- /dev/null
+++ b/debian/python-elbe-bin.install
@@ -0,0 +1,2 @@
+./usr/bin/*
+./usr/share/man/man1/elbe.1
diff --git a/debian/python-elbe-bin.lintian-overrides b/debian/python-elbe-bin.lintian-overrides
new file mode 100644
index 00000000..b4d50058
--- /dev/null
+++ b/debian/python-elbe-bin.lintian-overrides
@@ -0,0 +1,2 @@
+# documentation is provided in elbe-doc
+python-elbe-bin: binary-without-manpage usr/bin/elbe
diff --git a/debian/elbe-buildenv.install b/debian/python-elbe-buildenv.install
similarity index 100%
rename from debian/elbe-buildenv.install
rename to debian/python-elbe-buildenv.install
diff --git a/debian/elbe-buildenv.postinst b/debian/python-elbe-buildenv.postinst
similarity index 100%
rename from debian/elbe-buildenv.postinst
rename to debian/python-elbe-buildenv.postinst
diff --git a/debian/elbe-common.install b/debian/python-elbe-common.install
similarity index 95%
rename from debian/elbe-common.install
rename to debian/python-elbe-common.install
index 6c137e06..00757619 100644
--- a/debian/elbe-common.install
+++ b/debian/python-elbe-common.install
@@ -1,4 +1,3 @@
-./usr/bin/*
 ./usr/lib/python2.*/*-packages/elbepack/elbe-repo.pub
 ./usr/lib/python2.*/*-packages/elbepack/init/default-init.xml
 ./usr/lib/python2.*/*-packages/elbepack/init/Makefile.mako
@@ -31,5 +30,3 @@
 ./usr/lib/python2.*/*-packages/elbepack/version.py
 ./usr/lib/python2.*/*-packages/elbepack/virtapt.py
 ./usr/lib/python2.*/*-packages/elbepack/xmldefaults.py
-./usr/share/man/man1/elbe.1
-schema/*xsd	usr/share/xml/elbe-common/
diff --git a/debian/elbe-control.install b/debian/python-elbe-control.install
similarity index 100%
rename from debian/elbe-control.install
rename to debian/python-elbe-control.install
diff --git a/debian/python3-elbe-buildenv.install b/debian/python3-elbe-buildenv.install
new file mode 100644
index 00000000..54f39ee5
--- /dev/null
+++ b/debian/python3-elbe-buildenv.install
@@ -0,0 +1,29 @@
+./usr/lib/python3.*/*-packages/elbepack/commands/adjustpkgs.py
+./usr/lib/python3.*/*-packages/elbepack/commands/buildchroot.py
+./usr/lib/python3.*/*-packages/elbepack/commands/buildsysroot.py
+./usr/lib/python3.*/*-packages/elbepack/commands/chroot.py
+./usr/lib/python3.*/*-packages/elbepack/commands/db.py
+./usr/lib/python3.*/*-packages/elbepack/commands/genlicence.py
+./usr/lib/python3.*/*-packages/elbepack/commands/gen_update.py
+./usr/lib/python3.*/*-packages/elbepack/commands/hdimg.py
+./usr/lib/python3.*/*-packages/elbepack/commands/mkcdrom.py
+./usr/lib/python3.*/*-packages/elbepack/commands/toolchainextract.py
+./usr/lib/python3.*/*-packages/elbepack/makofiles/preferences.mako
+./usr/lib/python3.*/*-packages/elbepack/hdimg.py
+./usr/lib/python3.*/*-packages/elbepack/db.py
+./usr/lib/python3.*/*-packages/elbepack/dbaction.py
+./usr/lib/python3.*/*-packages/elbepack/dump.py
+./usr/lib/python3.*/*-packages/elbepack/ziparchives.py
+./usr/lib/python3.*/*-packages/elbepack/repomanager.py
+./usr/lib/python3.*/*-packages/elbepack/finetuning.py
+./usr/lib/python3.*/*-packages/elbepack/rfs.py
+./usr/lib/python3.*/*-packages/elbepack/aptpkgutils.py
+./usr/lib/python3.*/*-packages/elbepack/asciidoclog.py
+./usr/lib/python3.*/*-packages/elbepack/cdroms.py
+./usr/lib/python3.*/*-packages/elbepack/debianreleases.py
+./usr/lib/python3.*/*-packages/elbepack/debpkg.py
+./usr/lib/python3.*/*-packages/elbepack/efilesystem.py
+./usr/lib/python3.*/*-packages/elbepack/fstab.py
+./usr/lib/python3.*/*-packages/elbepack/rpcaptcache.py
+./usr/lib/python3.*/*-packages/elbepack/updatepkg.py
+./usr/lib/python3.*/*-packages/elbepack/pbuilder.py
diff --git a/debian/python3-elbe-buildenv.postinst b/debian/python3-elbe-buildenv.postinst
new file mode 100644
index 00000000..2a90a4a1
--- /dev/null
+++ b/debian/python3-elbe-buildenv.postinst
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -e
+elbe db init --name=root --password=foo
+#DEBHELPER#
diff --git a/debian/python3-elbe-common.install b/debian/python3-elbe-common.install
new file mode 100644
index 00000000..1c94cd3b
--- /dev/null
+++ b/debian/python3-elbe-common.install
@@ -0,0 +1,32 @@
+./usr/lib/python3.*/*-packages/elbepack/elbe-repo.pub
+./usr/lib/python3.*/*-packages/elbepack/init/default-init.xml
+./usr/lib/python3.*/*-packages/elbepack/init/Makefile.mako
+./usr/lib/python3.*/*-packages/elbepack/init/libvirt.xml.mako
+./usr/lib/python3.*/*-packages/elbepack/init/apt.conf.mako
+./usr/lib/python3.*/*-packages/elbepack/init/preseed.cfg.mako
+./usr/lib/python3.*/*-packages/elbepack/init/init-elbe.sh.mako
+./usr/lib/python3.*/*-packages/elbepack/__init__.py
+./usr/lib/python3.*/*-packages/elbepack/commands/__init__.py
+./usr/lib/python3.*/*-packages/elbepack/aptprogress.py
+./usr/lib/python3.*/*-packages/elbepack/config.py
+./usr/lib/python3.*/*-packages/elbepack/default-preseed.xml
+./usr/lib/python3.*/*-packages/elbepack/directories.py
+./usr/lib/python3.*/*-packages/elbepack/dosunix.py
+./usr/lib/python3.*/*-packages/elbepack/elbexml.py
+./usr/lib/python3.*/*-packages/elbepack/elbeproject.py
+./usr/lib/python3.*/*-packages/elbepack/filesystem.py
+./usr/lib/python3.*/*-packages/elbepack/gpg.py
+./usr/lib/python3.*/*-packages/elbepack/initvmaction.py
+./usr/lib/python3.*/*-packages/elbepack/kvm.py
+./usr/lib/python3.*/*-packages/elbepack/licencexml.py
+./usr/lib/python3.*/*-packages/elbepack/pbuilderaction.py
+./usr/lib/python3.*/*-packages/elbepack/pkgutils.py
+./usr/lib/python3.*/*-packages/elbepack/xmlpreprocess.py
+./usr/lib/python3.*/*-packages/elbepack/shellhelper.py
+./usr/lib/python3.*/*-packages/elbepack/templates.py
+./usr/lib/python3.*/*-packages/elbepack/toolchain.py
+./usr/lib/python3.*/*-packages/elbepack/treeutils.py
+./usr/lib/python3.*/*-packages/elbepack/validate.py
+./usr/lib/python3.*/*-packages/elbepack/version.py
+./usr/lib/python3.*/*-packages/elbepack/virtapt.py
+./usr/lib/python3.*/*-packages/elbepack/xmldefaults.py
diff --git a/debian/python3-elbe-control.install b/debian/python3-elbe-control.install
new file mode 100644
index 00000000..965f2d4f
--- /dev/null
+++ b/debian/python3-elbe-control.install
@@ -0,0 +1,5 @@
+./usr/lib/python3.*/*-packages/elbepack/commands/control.py
+./usr/lib/python3.*/*-packages/elbepack/commands/initvm.py
+./usr/lib/python3.*/*-packages/elbepack/commands/pbuilder.py
+./usr/lib/python3.*/*-packages/elbepack/commands/prjrepo.py
+./usr/lib/python3.*/*-packages/elbepack/soapclient.py
diff --git a/debian/rules b/debian/rules
index 39160f30..cf2bcb12 100755
--- a/debian/rules
+++ b/debian/rules
@@ -26,4 +26,4 @@ override_dh_install:
 	dh_installxmlcatalogs
 
 %:
-	dh --with systemd --buildsystem=python_distutils --with python2 $@
+	dh $@ --with systemd --buildsystem=pybuild --with python2,python3
diff --git a/elbepack/commands/adjustpkgs.py b/elbepack/commands/adjustpkgs.py
index d21da1bd..f64715b1 100644
--- a/elbepack/commands/adjustpkgs.py
+++ b/elbepack/commands/adjustpkgs.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-#
 # ELBE - Debian Based Embedded Rootfilesystem Builder
 # Copyright (C) 2013  Linutronix GmbH
 #
@@ -111,9 +109,9 @@ def run_command( argv ):
     xml_pkglist = xml.node("/target/pkg-list")
     xml_pkgs = [p.et.text for p in xml_pkglist]
 
-    mandatory_pkgs = ["elbe-buildenv"]
+    mandatory_pkgs = ["python-elbe-buildenv"]
     if xml.has("target/images/msdoshd/grub-install"):
-        mandatory_pkgs = ["elbe-buildenv", "grub-pc"]
+        mandatory_pkgs = ["python-elbe-buildenv", "grub-pc"]
 
     # TODO: install buildimage packages after target image generation
     #         and remove theme before target image generation
diff --git a/elbepack/init/preseed.cfg.mako b/elbepack/init/preseed.cfg.mako
index 086ad849..196f1d42 100644
--- a/elbepack/init/preseed.cfg.mako
+++ b/elbepack/init/preseed.cfg.mako
@@ -105,7 +105,7 @@ apt-mirror-setup apt-setup/use_mirror boolean false
 d-i finish-install/reboot_in_progress note
 d-i pkgsel/include string rng-tools btrfs-tools openssh-client \
 debathena-transform-lighttpd \
-elbe-soap elbe-buildenv qemu-elbe-user-static \
+elbe-soap python-elbe-buildenv qemu-elbe-user-static \
 % for n in pkgs:
 % if n.tag == "pkg":
 %   if prj.has("mirror/primary_host") or not prj.node("mirror/cdrom") or n.et.text.find('/') == -1:
-- 
2.15.1




More information about the elbe-devel mailing list