updated patch, the .install files need the x bit set.
  * Build python3 packages.
  * Bump debhelper and standards version.
  * Do not generate symbols for the extension module
  * Do not encode the SOABI and the multiarch string into the pytalloc-util
    library, just append a '-py3'.
  * Make the build log a bit more verbose.

diff -Nru talloc-2.1.5/debian/compat talloc-2.1.5/debian/compat
--- talloc-2.1.5/debian/compat	2015-11-07 15:36:10.000000000 +0000
+++ talloc-2.1.5/debian/compat	2016-02-16 14:10:26.000000000 +0000
@@ -1 +1 @@
-8
+9
diff -Nru talloc-2.1.5/debian/control talloc-2.1.5/debian/control
--- talloc-2.1.5/debian/control	2015-11-08 21:08:04.000000000 +0000
+++ talloc-2.1.5/debian/control	2016-02-18 14:59:18.000000000 +0000
@@ -4,7 +4,13 @@
 Maintainer: Debian Samba Maintainers <[email protected]>
 Uploaders: Jelmer Vernooij <[email protected]>, Christian Perrier <[email protected]>
 Homepage: http://talloc.samba.org/
-Build-Depends: debhelper (>= 8.1.3), docbook-xml, docbook-xsl, xsltproc, libpopt-dev, python-all (>= 2.6.6-3), python-all-dev (>= 2.6.6-3)
+Build-Depends: debhelper (>= 9),
+  docbook-xml, docbook-xsl, xsltproc,
+  dh-exec,
+  dh-python,
+  libpopt-dev,
+  python-dev (>= 2.6.6-3),
+  python3-dev,
 Standards-Version: 3.9.6
 Vcs-Git: git://anonscm.debian.org/pkg-samba/talloc.git -b unstable
 XS-Testsuite: autopkgtest
@@ -77,3 +83,38 @@
  reference counting to determine when memory should be freed.
  .
  This package contains the development files for the Python bindings.
+
+Package: python3-talloc
+Pre-Depends: ${misc:Pre-Depends}
+Architecture: any
+Section: python
+Provides: ${python3:Provides}
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}
+Description: hierarchical pool based memory allocator - Python3 bindings
+ A hierarchical pool based memory allocator with destructors. It uses
+ reference counting to determine when memory should be freed.
+ .
+ This package contains the Python3 bindings.
+
+Package: python3-talloc-dbg
+Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
+Section: debug
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}, python3-talloc (= ${binary:Version})
+Recommends: python3-dbg, libtalloc2-dbg
+Priority: extra
+Description: hierarchical pool based memory allocator - Python3 debug extension
+ A hierarchical pool based memory allocator with destructors. It uses
+ reference counting to determine when memory should be freed.
+ .
+ This package contains the Python3 debug extension.
+
+Package: python3-talloc-dev
+Architecture: any
+Section: libdevel
+Depends: python3-talloc (= ${binary:Version}), ${misc:Depends}, pkg-config
+Description: talloc Python3 bindings - development files
+ A hierarchical pool based memory allocator with destructors. It uses
+ reference counting to determine when memory should be freed.
+ .
+ This package contains the development files for the Python3 bindings.
diff -Nru talloc-2.1.5/debian/patches/pass-waf-flags.diff talloc-2.1.5/debian/patches/pass-waf-flags.diff
--- talloc-2.1.5/debian/patches/pass-waf-flags.diff	1970-01-01 00:00:00.000000000 +0000
+++ talloc-2.1.5/debian/patches/pass-waf-flags.diff	2016-02-16 16:17:56.000000000 +0000
@@ -0,0 +1,17 @@
+# Allow to pass flags to waf
+
+--- talloc-2.1.5.orig/Makefile
++++ talloc-2.1.5/Makefile
+@@ -3,10 +3,10 @@
+ WAF=WAF_MAKE=1 PATH=buildtools/bin:../../buildtools/bin:$$PATH waf
+ 
+ all:
+-	$(WAF) build
++	$(WAF) build $(WAFFLAGS)
+ 
+ install:
+-	$(WAF) install
++	$(WAF) install $(WAFFLAGS)
+ 
+ uninstall:
+ 	$(WAF) uninstall
diff -Nru talloc-2.1.5/debian/patches/pytalloc-util-name.diff talloc-2.1.5/debian/patches/pytalloc-util-name.diff
--- talloc-2.1.5/debian/patches/pytalloc-util-name.diff	1970-01-01 00:00:00.000000000 +0000
+++ talloc-2.1.5/debian/patches/pytalloc-util-name.diff	2016-02-18 14:55:52.000000000 +0000
@@ -0,0 +1,21 @@
+# Don't encode the multiarch name into the pytalloc-util library name
+
+Index: b/buildtools/wafsamba/samba_python.py
+===================================================================
+--- a/buildtools/wafsamba/samba_python.py
++++ b/buildtools/wafsamba/samba_python.py
+@@ -122,7 +122,13 @@ Build.BuildContext.SAMBA_PYTHON = SAMBA_
+ 
+ 
+ def pyembed_libname(bld, name, extrapython=False):
+-    return name + bld.env['PYTHON_SO_ABI_FLAG']
++    abi_flag = bld.env['PYTHON_SO_ABI_FLAG']
++    # do we really want the version encoded in the library name?
++    #if bld.env['IS_EXTRA_PYTHON'] and 'DEB_HOST_MULTIARCH' in os.environ:
++    #    abi_flag = abi_flag.replace('-%s' % os.environ['DEB_HOST_MULTIARCH'], '')
++    if bld.env['IS_EXTRA_PYTHON']:
++        abi_flag = '-py3'
++    return name + abi_flag
+ 
+ Build.BuildContext.pyembed_libname = pyembed_libname
+ 
diff -Nru talloc-2.1.5/debian/patches/series talloc-2.1.5/debian/patches/series
--- talloc-2.1.5/debian/patches/series	2015-11-07 15:36:10.000000000 +0000
+++ talloc-2.1.5/debian/patches/series	2016-02-16 16:19:36.000000000 +0000
@@ -0,0 +1,2 @@
+pass-waf-flags.diff
+pytalloc-util-name.diff
diff -Nru talloc-2.1.5/debian/python-talloc-dev.install talloc-2.1.5/debian/python-talloc-dev.install
--- talloc-2.1.5/debian/python-talloc-dev.install	2015-11-07 15:36:10.000000000 +0000
+++ talloc-2.1.5/debian/python-talloc-dev.install	2016-02-18 15:03:52.000000000 +0000
@@ -1,3 +1,4 @@
-usr/include/pytalloc.h
+#! /usr/bin/dh-exec
+usr/include/pytalloc.h ${DEB_PY2_INCDIR}
 usr/lib/*/pkgconfig/pytalloc-util.pc
 usr/lib/*/libpytalloc-util.so
diff -Nru talloc-2.1.5/debian/python-talloc.install talloc-2.1.5/debian/python-talloc.install
--- talloc-2.1.5/debian/python-talloc.install	2015-11-08 21:08:04.000000000 +0000
+++ talloc-2.1.5/debian/python-talloc.install	2016-02-16 13:40:49.000000000 +0000
@@ -1,2 +1,2 @@
-usr/lib/python*/*-packages/talloc.so
+usr/lib/python2*/*-packages/talloc.so
 usr/lib/*/libpytalloc-util.so.*
diff -Nru talloc-2.1.5/debian/python-talloc.symbols talloc-2.1.5/debian/python-talloc.symbols
--- talloc-2.1.5/debian/python-talloc.symbols	2015-11-08 21:18:54.000000000 +0000
+++ talloc-2.1.5/debian/python-talloc.symbols	2016-02-16 16:11:46.000000000 +0000
@@ -14,5 +14,3 @@
  pytalloc_reference_ex@PYTALLOC_UTIL_2.0.6 2.0.6
  pytalloc_steal@PYTALLOC_UTIL_2.0.6 2.0.6
  pytalloc_steal_ex@PYTALLOC_UTIL_2.0.6 2.0.6
-talloc.so #PACKAGE# #MINVER#
- inittalloc@Base 2.0.6
diff -Nru talloc-2.1.5/debian/python3-talloc-dev.install talloc-2.1.5/debian/python3-talloc-dev.install
--- talloc-2.1.5/debian/python3-talloc-dev.install	1970-01-01 00:00:00.000000000 +0000
+++ talloc-2.1.5/debian/python3-talloc-dev.install	2016-02-18 15:03:21.000000000 +0000
@@ -0,0 +1,3 @@
+#! /usr/bin/dh-exec
+usr/include/pytalloc.h ${DEB_PY3_INCDIR}
+usr/lib/*/libpytalloc-util-py3.so
diff -Nru talloc-2.1.5/debian/python3-talloc-dev.lintian-overrides talloc-2.1.5/debian/python3-talloc-dev.lintian-overrides
--- talloc-2.1.5/debian/python3-talloc-dev.lintian-overrides	1970-01-01 00:00:00.000000000 +0000
+++ talloc-2.1.5/debian/python3-talloc-dev.lintian-overrides	2016-02-16 11:27:32.000000000 +0000
@@ -0,0 +1 @@
+python-talloc-dev binary: wrong-section-according-to-package-name python-talloc-dev => python
diff -Nru talloc-2.1.5/debian/python3-talloc.install talloc-2.1.5/debian/python3-talloc.install
--- talloc-2.1.5/debian/python3-talloc.install	1970-01-01 00:00:00.000000000 +0000
+++ talloc-2.1.5/debian/python3-talloc.install	2016-02-18 14:58:41.000000000 +0000
@@ -0,0 +1,2 @@
+usr/lib/python3/dist-packages/talloc*.so
+usr/lib/*/libpytalloc-util-py3.so.*
diff -Nru talloc-2.1.5/debian/python3-talloc.lintian-overrides talloc-2.1.5/debian/python3-talloc.lintian-overrides
--- talloc-2.1.5/debian/python3-talloc.lintian-overrides	1970-01-01 00:00:00.000000000 +0000
+++ talloc-2.1.5/debian/python3-talloc.lintian-overrides	2016-02-16 16:20:37.000000000 +0000
@@ -0,0 +1 @@
+python3-talloc binary: package-name-doesnt-match-sonames
diff -Nru talloc-2.1.5/debian/python3-talloc.symbols talloc-2.1.5/debian/python3-talloc.symbols
--- talloc-2.1.5/debian/python3-talloc.symbols	1970-01-01 00:00:00.000000000 +0000
+++ talloc-2.1.5/debian/python3-talloc.symbols	2016-02-18 15:05:58.000000000 +0000
@@ -0,0 +1,7 @@
+libpytalloc-util-py3.so.2 #PACKAGE# #MINVER#
+ PYTALLOC_UTIL_PY3_2.1.5@PYTALLOC_UTIL_PY3_2.1.5 2.1.5
+ pytalloc_Check@PYTALLOC_UTIL_PY3_2.1.5 2.1.5
+ pytalloc_GetObjectType@PYTALLOC_UTIL_PY3_2.1.5 2.1.5
+ pytalloc_reference_ex@PYTALLOC_UTIL_PY3_2.1.5 2.1.5
+ pytalloc_steal@PYTALLOC_UTIL_PY3_2.1.5 2.1.5
+ pytalloc_steal_ex@PYTALLOC_UTIL_PY3_2.1.5 2.1.5
diff -Nru talloc-2.1.5/debian/rules talloc-2.1.5/debian/rules
--- talloc-2.1.5/debian/rules	2015-11-08 21:08:04.000000000 +0000
+++ talloc-2.1.5/debian/rules	2016-02-19 10:01:18.000000000 +0000
@@ -16,27 +16,33 @@
 conf_args = --prefix=/usr --disable-rpath-install --disable-rpath --bundled-libraries=NONE
 conf_args += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
 conf_args += --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)
+conf_args += --extra-python=python3
+conf_args += -v
 
 export PYTHON="$(shell which `pyversions -d`)"
-export PYTHON_CONFIG=$(PYTHON)-config
 
 %:
-	dh $* --with python2 
+	dh $* --parallel --with python2,python3
 
 override_dh_python2:
 	dh_python2 --no-guessing-versions
 
 override_dh_auto_configure:
-	LDFLAGS="$(LDFLAGS)" PYTHON="$(PYTHON)" PYTHON_CONFIG="$(PYTHON_CONFIG)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" ./configure $(conf_args)
+	LDFLAGS="$(LDFLAGS)" PYTHON="$(PYTHON)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" ./configure $(conf_args)
 
 override_dh_auto_build:
-	$(MAKE) all
+	$(MAKE) all WAFFLAGS="-vv"
 
 override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 	LD_LIBRARY_PATH=bin/shared ./bin/talloc_testsuite
 endif
 
+override_dh_install:
+	DEB_PY2_INCDIR=$(shell python-config --includes | sed 's,^-I\([^ ]*\).*,\1,') \
+	DEB_PY3_INCDIR=$(shell python3-config --includes | sed 's,^-I\([^ ]*\).*,\1,') \
+		dh_install --list-missing
+
 get-packaged-orig-source:
 	./debian/build-orig.sh
 
@@ -60,6 +66,8 @@
 override_dh_strip:
 	dh_strip -plibtalloc2 --dbg-package=libtalloc2-dbg
 	dh_strip -ppython-talloc --dbg-package=python-talloc-dbg
+	dh_strip -ppython3-talloc --dbg-package=python3-talloc-dbg
 
 override_dh_makeshlibs:
-	dh_makeshlibs -- -c4
+	dh_makeshlibs -plibtalloc2 -- -c3
+	dh_makeshlibs -ppython-talloc -ppython3-talloc -Xtalloc. -- -c3

Reply via email to