dh-python wheezy backport
Hello,
I copied the changes from 1.20131021-1~bpo70+1 and applied them to 1.20140511-1 and appear to have got a working package.
This seems to be required to get a fully functioning backport of python-django.
Ideally this should be uploaded to backports, however I don't entirely understand this code, so not absolutely sure I got this correct.
Attached is the patch for version in sid.
diff -ruN dh-python-1.20140511.old/debian/changelog dh-python-1.20140511/debian/changelog
--- dh-python-1.20140511.old/debian/changelog 2014-05-12 04:59:48.000000000 +1000
+++ dh-python-1.20140511/debian/changelog 2014-07-01 10:39:20.831415999 +1000
@@ -1,3 +1,19 @@
+dh-python (1.20140511-1~bpo70+1) wheezy-backports; urgency=low
+
+ * Apply changes from 1.20131021-1~bpo70+1:
+ * Rebuild for wheezy-backports.
+ * Replace libpython3-stdlib build dependency with python3.2
+ * Update default/supported Python versions (in a fallback code,
+ if python_defaults missing)
+ * Use dpkg-divert to replace python3's dh_python3 and python's
+ dh_python2 and drop Breaks/Replaces
+ * dh_python2: do not rename extension files, Wheezy's python2.7 doesn't
+ support multiarch tuples
+ * Disable multiarch dependencies (":any" not supported that well in
+ Wheezy)
+
+ -- Brian May <bam@debian.org> Tue, 01 Jul 2014 10:38:48 +1000
+
dh-python (1.20140511-1) unstable; urgency=medium
[ Piotr Ożarowski ]
diff -ruN dh-python-1.20140511.old/debian/control dh-python-1.20140511/debian/control
--- dh-python-1.20140511.old/debian/control 2014-01-29 04:01:31.000000000 +1100
+++ dh-python-1.20140511/debian/control 2014-07-01 10:37:29.961931088 +1000
@@ -3,7 +3,8 @@
Priority: optional
Maintainer: Piotr Ożarowski <piotr@debian.org>
Uploaders: Stefano Rivera <stefanor@debian.org>, Barry Warsaw <barry@debian.org>
-Build-Depends: debhelper (>= 9), python3-minimal, libpython3-stdlib,
+Build-Depends: debhelper (>= 9), python3-minimal,
+ python3.2,
# provides rst2man command (python3-docutils not used to avoid circular deps):
python-docutils
Standards-Version: 3.9.5
@@ -15,10 +16,6 @@
Package: dh-python
Architecture: all
Depends: ${misc:Depends}, ${python3:Depends}
-Breaks:
-# due to /usr/bin/dh_python3 and debhelper files
- python3 (<< 3.3.2-4~)
-Replaces: python3 (<< 3.3.2-4~)
Description: Debian helper tools for packaging Python libraries and applications
This package contains:
* pybuild - invokes various build systems for requested Python versions in
diff -ruN dh-python-1.20140511.old/debian/control.orig dh-python-1.20140511/debian/control.orig
--- dh-python-1.20140511.old/debian/control.orig 1970-01-01 10:00:00.000000000 +1000
+++ dh-python-1.20140511/debian/control.orig 2014-01-29 04:01:31.000000000 +1100
@@ -0,0 +1,31 @@
+Source: dh-python
+Section: python
+Priority: optional
+Maintainer: Piotr Ożarowski <piotr@debian.org>
+Uploaders: Stefano Rivera <stefanor@debian.org>, Barry Warsaw <barry@debian.org>
+Build-Depends: debhelper (>= 9), python3-minimal, libpython3-stdlib,
+# provides rst2man command (python3-docutils not used to avoid circular deps):
+ python-docutils
+Standards-Version: 3.9.5
+Vcs-Git: git://anonscm.debian.org/dh-python/dh-python.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=dh-python/dh-python.git
+X-Python3-Version: >= 3.2
+XS-Testsuite: autopkgtest
+
+Package: dh-python
+Architecture: all
+Depends: ${misc:Depends}, ${python3:Depends}
+Breaks:
+# due to /usr/bin/dh_python3 and debhelper files
+ python3 (<< 3.3.2-4~)
+Replaces: python3 (<< 3.3.2-4~)
+Description: Debian helper tools for packaging Python libraries and applications
+ This package contains:
+ * pybuild - invokes various build systems for requested Python versions in
+ order to build modules and extensions
+ * dh_python2 - calculates Python 2.X dependencies for Debian packages,
+ adds maintainer scripts to byte compile files, etc.
+ * dh_python3 - calculates Python 3.X dependencies for Debian packages,
+ adds maintainer scripts to byte compile files, etc.
+ * dh_pypy - calculates PyPy dependencies for Debian packages,
+ adds maintainer scripts to byte compile files, etc.
diff -ruN dh-python-1.20140511.old/debian/links dh-python-1.20140511/debian/links
--- dh-python-1.20140511.old/debian/links 2013-11-05 09:43:33.000000000 +1100
+++ dh-python-1.20140511/debian/links 2014-07-01 10:37:29.961931088 +1000
@@ -1,4 +1,4 @@
/usr/share/dh-python/pybuild /usr/bin/pybuild
/usr/share/dh-python/dh_pypy /usr/bin/dh_pypy
-#/usr/share/dh-python/dh_python2 /usr/bin/dh_python2
+/usr/share/dh-python/dh_python2 /usr/bin/dh_python2
/usr/share/dh-python/dh_python3 /usr/bin/dh_python3
diff -ruN dh-python-1.20140511.old/debian/manpages dh-python-1.20140511/debian/manpages
--- dh-python-1.20140511.old/debian/manpages 2013-11-05 09:43:33.000000000 +1100
+++ dh-python-1.20140511/debian/manpages 2014-07-01 10:37:29.981930635 +1000
@@ -1,4 +1,4 @@
pybuild.1
dh_pypy.1
-#dh_python2.1
+dh_python2.1
dh_python3.1
diff -ruN dh-python-1.20140511.old/debian/patches/disable_ext_renaming_in_dh_python2.patch dh-python-1.20140511/debian/patches/disable_ext_renaming_in_dh_python2.patch
--- dh-python-1.20140511.old/debian/patches/disable_ext_renaming_in_dh_python2.patch 1970-01-01 10:00:00.000000000 +1000
+++ dh-python-1.20140511/debian/patches/disable_ext_renaming_in_dh_python2.patch 2014-07-01 10:41:11.872897266 +1000
@@ -0,0 +1,13 @@
+Index: dh-python-1.20140511/dh_python2
+===================================================================
+--- dh-python-1.20140511.orig/dh_python2 2014-05-12 05:00:07.000000000 +1000
++++ dh-python-1.20140511/dh_python2 2014-07-01 10:41:07.185003595 +1000
+@@ -323,7 +323,7 @@
+ dest='clean_dbg_pkg', default=True,
+ help='do not remove files from debug packages')
+ parser.add_option('--no-ext-rename', action='store_true',
+- default=False, help='do not add magic tags nor multiarch'
++ default=True, help='do not add magic tags nor multiarch'
+ ' tuples to extension file names)')
+ parser.add_option('--no-shebang-rewrite', action='store_true',
+ default=False, help='do not rewrite shebangs')
diff -ruN dh-python-1.20140511.old/debian/patches/disable_multiarch_dependencies.patch dh-python-1.20140511/debian/patches/disable_multiarch_dependencies.patch
--- dh-python-1.20140511.old/debian/patches/disable_multiarch_dependencies.patch 1970-01-01 10:00:00.000000000 +1000
+++ dh-python-1.20140511/debian/patches/disable_multiarch_dependencies.patch 2014-07-01 10:41:14.756831853 +1000
@@ -0,0 +1,39 @@
+Index: dh-python-1.20140511/dhpython/__init__.py
+===================================================================
+--- dh-python-1.20140511.orig/dhpython/__init__.py 2014-05-12 05:00:07.000000000 +1000
++++ dh-python-1.20140511/dhpython/__init__.py 2014-07-01 10:41:13.008871501 +1000
+@@ -25,8 +25,8 @@
+ 'pypy': 'pypy'}
+
+ # minimum version required for compile/clean scripts:
+-MINPYCDEP = {'cpython2': 'python:any (>= 2.7.5-5~)',
+- 'cpython3': 'python3:any (>= 3.3.2-2~)',
++MINPYCDEP = {'cpython2': 'python (>= 2.6.6-3)',
++ 'cpython3': 'python3 (>= 3.2.3-3~)',
+ 'pypy': 'pypy'}
+
+ PUBLIC_DIR_RE = {
+Index: dh-python-1.20140511/dhpython/depends.py
+===================================================================
+--- dh-python-1.20140511.orig/dhpython/depends.py 2014-05-12 05:00:07.000000000 +1000
++++ dh-python-1.20140511/dhpython/depends.py 2014-07-01 10:41:13.008871501 +1000
+@@ -48,8 +48,8 @@
+ self.ipkg_tpl_ma = self.ipkg_tpl
+ self.ipkg_vtpl_ma = self.ipkg_vtpl
+ else:
+- self.ipkg_tpl_ma = self.ipkg_tpl + ':any'
+- self.ipkg_vtpl_ma = self.ipkg_vtpl + ':any'
++ self.ipkg_tpl_ma = self.ipkg_tpl
++ self.ipkg_vtpl_ma = self.ipkg_vtpl
+
+ self.depends = set()
+ self.recommends = []
+@@ -155,7 +155,7 @@
+ self.depend(MINPYCDEP[self.impl])
+
+ for ipreter in stats['shebangs']:
+- self.depend("%s%s" % (ipreter, ':any' if self.impl == 'pypy' else ''))
++ self.depend(str(ipreter))
+
+ supported_versions = supported(self.impl)
+ default_version = default(self.impl)
diff -ruN dh-python-1.20140511.old/debian/patches/series dh-python-1.20140511/debian/patches/series
--- dh-python-1.20140511.old/debian/patches/series 1970-01-01 10:00:00.000000000 +1000
+++ dh-python-1.20140511/debian/patches/series 2014-07-01 10:37:30.001930180 +1000
@@ -0,0 +1,4 @@
+update_default_and_supported_python_versions.patch
+disable_ext_renaming_in_dh_python2.patch
+disable_multiarch_dependencies.patch
+#backports.patch
diff -ruN dh-python-1.20140511.old/debian/patches/update_default_and_supported_python_versions.patch dh-python-1.20140511/debian/patches/update_default_and_supported_python_versions.patch
--- dh-python-1.20140511.old/debian/patches/update_default_and_supported_python_versions.patch 1970-01-01 10:00:00.000000000 +1000
+++ dh-python-1.20140511/debian/patches/update_default_and_supported_python_versions.patch 2014-07-01 10:41:02.621107113 +1000
@@ -0,0 +1,23 @@
+Description: update default/supported Python versions in fallback code
+Author: Piotr Ozarowski <piotr@debian.org>
+
+Index: dh-python-1.20140511/dhpython/_defaults.py
+===================================================================
+--- dh-python-1.20140511.orig/dhpython/_defaults.py 2014-05-12 05:00:07.000000000 +1000
++++ dh-python-1.20140511/dhpython/_defaults.py 2014-07-01 10:40:42.381566188 +1000
+@@ -26,12 +26,12 @@
+ from subprocess import Popen, PIPE
+
+ SUPPORTED = {
+- 'cpython2': [(2, 7)],
+- 'cpython3': [(3, 4)],
++ 'cpython2': [(2, 7), (2, 6)],
++ 'cpython3': [(3, 2)],
+ 'pypy': [(2, 0)]}
+ DEFAULT = {
+ 'cpython2': (2, 7),
+- 'cpython3': (3, 4),
++ 'cpython3': (3, 2),
+ 'pypy': (2, 0)}
+
+ log = logging.getLogger('dhpython')
diff -ruN dh-python-1.20140511.old/debian/postrm dh-python-1.20140511/debian/postrm
--- dh-python-1.20140511.old/debian/postrm 1970-01-01 10:00:00.000000000 +1000
+++ dh-python-1.20140511/debian/postrm 2014-07-01 10:37:30.001930180 +1000
@@ -0,0 +1,23 @@
+#!/bin/sh
+set -e
+
+remove_divert() {
+ dpkg-divert --package dh-python --remove --rename \
+ --divert /usr/bin/dh_python3.real /usr/bin/dh_python3
+ dpkg-divert --package dh-python --remove --rename \
+ --divert /usr/share/man/man1/dh_python3.real.1.gz /usr/share/man/man1/dh_python3.1.gz
+ dpkg-divert --package dh-python --remove --rename \
+ --divert /usr/bin/dh_python2.real /usr/bin/dh_python2
+ dpkg-divert --package dh-python --remove --rename \
+ --divert /usr/share/man/man1/dh_python2.real.1.gz /usr/share/man/man1/dh_python2.1.gz
+}
+
+if [ abort-upgrade = "$1" ] && dpkg --compare-versions "$2" lt '1.20130819-1~bpo70+1'; then
+ remove_divert
+elif [ remove = "$1" -o abort-install = "$1" ]; then
+ remove_divert
+elif [ upgrade = "$1" ] && echo "$2" | grep -vq '~bpo'; then
+ remove_divert
+fi
+
+#DEBHELPER#
diff -ruN dh-python-1.20140511.old/debian/preinst dh-python-1.20140511/debian/preinst
--- dh-python-1.20140511.old/debian/preinst 1970-01-01 10:00:00.000000000 +1000
+++ dh-python-1.20140511/debian/preinst 2014-07-01 10:37:30.001930180 +1000
@@ -0,0 +1,21 @@
+#!/bin/sh
+set -e
+
+divert() {
+ dpkg-divert --package dh-python --add --rename \
+ --divert /usr/bin/dh_python3.real /usr/bin/dh_python3
+ dpkg-divert --package dh-python --add --rename \
+ --divert /usr/share/man/man1/dh_python3.real.1.gz /usr/share/man/man1/dh_python3.1.gz
+ dpkg-divert --package dh-python --add --rename \
+ --divert /usr/bin/dh_python2.real /usr/bin/dh_python2
+ dpkg-divert --package dh-python --add --rename \
+ --divert /usr/share/man/man1/dh_python2.real.1.gz /usr/share/man/man1/dh_python2.1.gz
+}
+
+if [ install = "$1" ]; then
+ divert
+elif [ upgrade = "$1" ] && dpkg --compare-versions "$2" lt '1.20130819-1~bpo70+1'; then
+ divert
+fi
+
+#DEBHELPER#
diff -ruN dh-python-1.20140511.old/debian/rules dh-python-1.20140511/debian/rules
--- dh-python-1.20140511.old/debian/rules 2013-11-05 09:43:33.000000000 +1100
+++ dh-python-1.20140511/debian/rules 2014-07-01 10:37:30.001930180 +1000
@@ -16,5 +16,9 @@
rm debian/dh-python/usr/share/debhelper/autoscripts/postinst-pycompile
rm debian/dh-python/usr/share/debhelper/autoscripts/prerm-pyclean
rm debian/dh-python/usr/share/perl5/Debian/Debhelper/Sequence/python2.pm
+ # drop files shipped in python3 (and compatible with dh-python)
+ rm debian/dh-python/usr/share/debhelper/autoscripts/postinst-py3compile
+ rm debian/dh-python/usr/share/debhelper/autoscripts/prerm-py3clean
+ rm debian/dh-python/usr/share/perl5/Debian/Debhelper/Sequence/python3.pm
# generate maintainer scripts, etc.
./dh_python3
Reply to: