From 3ed090a85fcb287e63cb854094d9ecc3b0e16fd4 Mon Sep 17 00:00:00 2001 From: Florian Best Date: Fri, 29 Nov 2019 13:07:58 +0100 Subject: [PATCH 2/4] Bug #49720: build tdb including python3 package Signed-off-by: Florian Best --- tdb/01_python3.patch | 140 +++++++++++++++++++++++++++++++++++++++++++++++++++ tdb/02_python3.patch | 27 ++++++++++ 2 files changed, 167 insertions(+) create mode 100644 tdb/01_python3.patch create mode 100644 tdb/02_python3.patch diff --git a/tdb/01_python3.patch b/tdb/01_python3.patch new file mode 100644 index 0000000..6c23c5d --- /dev/null +++ b/tdb/01_python3.patch @@ -0,0 +1,140 @@ +commit 30cf732f4c0c46cfa778afdd4fcab97bc7c3401c +Author: Jelmer Vernooij +Date: Sun Feb 28 14:36:50 2016 +0000 + + Build Python3 bindings. Closes: #815141 + +diff --git debian/compat debian/compat +index 45a4fb7..ec63514 100644 +--- debian/compat ++++ debian/compat +@@ -1 +1 @@ +-8 ++9 +diff --git debian/control debian/control +index 390be39..f120d1f 100644 +--- debian/control ++++ debian/control +@@ -3,12 +3,12 @@ Section: devel + Priority: optional + Maintainer: Debian Samba Maintainers + Uploaders: Jelmer Vernooij +-Build-Depends: debhelper (>= 8.1.3), ++Build-Depends: debhelper (>= 9), + dh-python, + docbook-xml, + docbook-xsl, +- python-all-dbg (>= 2.6.6-3), +- python-all-dev (>= 2.6.6-3), ++ python-dev (>= 2.6.6-3), ++ python3-dev, + xsltproc + Homepage: http://tdb.samba.org/ + Standards-Version: 3.9.6 +@@ -98,3 +98,35 @@ Description: Python bindings for TDB - debug extension + appropriate locking and transactions. + . + This package contains the Python debug extension. ++ ++Package: python3-tdb ++Section: python ++Architecture: linux-any kfreebsd-any ++Depends: libtdb1 (= ${binary:Version}), ++ ${misc:Depends}, ++ ${python3:Depends}, ++ ${shlibs:Depends} ++Provides: ${python3:Provides} ++Description: Python3 bindings for TDB ++ This is a simple database API. It is modelled after the structure ++ of GDBM. TDB features, unlike GDBM, multiple writers support with ++ appropriate locking and transactions. ++ . ++ This package contains the Python3 bindings. ++ ++Package: python3-tdb-dbg ++Section: debug ++Architecture: linux-any kfreebsd-any ++Priority: extra ++Depends: python3-tdb (= ${binary:Version}), ++ ${misc:Depends}, ++ ${python3:Depends}, ++ ${shlibs:Depends} ++Recommends: python3-dbg, libtdb1-dbg ++Provides: ${python3:Provides} ++Description: Python3 bindings for TDB - debug extension ++ This is a simple database API. It is modelled after the structure ++ of GDBM. TDB features, unlike GDBM, multiple writers support with ++ appropriate locking and transactions. ++ . ++ This package contains the Python3 debug extension. +diff --git debian/python-tdb.install debian/python-tdb.install +index 607c065..b2cc136 100644 +--- debian/python-tdb.install ++++ debian/python-tdb.install +@@ -1 +1 @@ +-usr/lib/python* ++usr/lib/python2* +diff --git debian/python3-tdb.install debian/python3-tdb.install +new file mode 100644 +index 0000000..4606faa +--- /dev/null ++++ debian/python3-tdb.install +@@ -0,0 +1 @@ ++usr/lib/python3* +diff --git debian/rules debian/rules +index 390e99f..883d9ad 100755 +--- debian/rules ++++ debian/rules +@@ -10,16 +10,19 @@ LDFLAGS += -Wl,--as-needed + + DESTDIR=$(CURDIR)/debian/tmp + export PYTHON=$(shell which `pyversions -d`) +-export PYTHON_CONFIG=$(PYTHON)-config + + DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + + %: +- dh $* --with python2 ++ dh $* --with python2,python3 + + override_dh_auto_configure: +- CPPFLAGS="$(CPPFLAGS)" PYTHON="$(PYTHON)" PYTHON_CONFIG="$(PYTHON_CONFIG)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ +- ./configure --prefix=/usr --disable-rpath-install --libdir=/usr/lib/$(DEB_HOST_MULTIARCH) ++ PYTHON="$(PYTHON)" \ ++ CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ ++ ./configure --prefix=/usr --disable-rpath-install \ ++ --libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \ ++ --extra-python=python3 \ ++ -v + + get-packaged-orig-source: + ./debian/build-orig.sh +@@ -28,7 +31,7 @@ override_dh_python2: + dh_python2 --no-guessing-versions + + override_dh_auto_build: +- $(MAKE) all ++ $(MAKE) all V=2 + + override_dh_auto_test: + ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) +@@ -52,6 +55,9 @@ override_dh_auto_clean: + buildtools/wafsamba/*/*.pyc \ + buildtools/wafsamba/*.pyc + ++override_dh_install: ++ dh_install --list-missing ++ + override_dh_auto_install: + $(MAKE) install DESTDIR=$(DESTDIR) + # Waf should be doing this.. +@@ -65,7 +71,8 @@ override_dh_auto_install: + override_dh_strip: + dh_strip -p libtdb1 --dbg-package=libtdb1-dbg + dh_strip -p python-tdb --dbg-package=python-tdb-dbg ++ dh_strip -p python3-tdb --dbg-package=python3-tdb-dbg + dh_strip -p tdb-tools + + override_dh_makeshlibs: +- dh_makeshlibs -- -c4 ++ dh_makeshlibs -Npython-tdb -Npython3-tdb -- -c4 diff --git a/tdb/02_python3.patch b/tdb/02_python3.patch new file mode 100644 index 0000000..bd568f6 --- /dev/null +++ b/tdb/02_python3.patch @@ -0,0 +1,27 @@ +diff --git debian/rules debian/rules +index 883d9ad..e3aa3f1 100755 +--- debian/rules ++++ debian/rules +@@ -9,7 +9,7 @@ CFLAGS += -g -Wall + LDFLAGS += -Wl,--as-needed + + DESTDIR=$(CURDIR)/debian/tmp +-export PYTHON=$(shell which `pyversions -d`) ++export PYTHON=$(shell which python3) + + DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + +@@ -17,11 +17,11 @@ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + dh $* --with python2,python3 + + override_dh_auto_configure: +- PYTHON="$(PYTHON)" \ ++ PYTHON="" \ + CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ + ./configure --prefix=/usr --disable-rpath-install \ + --libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \ +- --extra-python=python3 \ ++ --extra-python=python2 \ + -v + + get-packaged-orig-source: -- 2.11.0