From d80afc9b3fa7e9eccb344a4fca75f40f4cb02255 Mon Sep 17 00:00:00 2001 From: Florian Best Date: Fri, 29 Nov 2019 13:08:05 +0100 Subject: [PATCH 3/4] Bug #49720: build ldb including python3 package Signed-off-by: Florian Best --- ldb/20_python3.patch | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++ ldb/21_python3.patch | 43 +++++++++++++++++++ ldb/24_python3.patch | 23 ++++++++++ ldb/25_python3.patch | 19 ++++++++ ldb/26_python3.quilt | 91 +++++++++++++++++++++++++++++++++++++++ ldb/27_python3.patch | 14 ++++++ ldb/28_python3.patch | 65 ++++++++++++++++++++++++++++ 7 files changed, 374 insertions(+) create mode 100644 ldb/20_python3.patch create mode 100644 ldb/21_python3.patch create mode 100644 ldb/24_python3.patch create mode 100644 ldb/25_python3.patch create mode 100644 ldb/26_python3.quilt create mode 100644 ldb/27_python3.patch create mode 100644 ldb/28_python3.patch diff --git a/ldb/20_python3.patch b/ldb/20_python3.patch new file mode 100644 index 0000000..2ac380c --- /dev/null +++ b/ldb/20_python3.patch @@ -0,0 +1,119 @@ +commit 13eb70eba4cd8d9f0b811160336a9ff7f323e173 +Author: Timo Aaltonen +Date: Wed Aug 14 11:44:54 2019 +0300 + + Add python3 packages. + +diff --git debian/control debian/control +index 769c93b..da9e2de 100644 +--- debian/control ++++ debian/control +@@ -17,10 +17,15 @@ Build-Depends: debhelper (>> 9), + libtevent-dev (>= 0.9.37~), + pkg-config, + python (>= 2.6.6-3), ++ python3, + python-all-dbg (>= 2.6.6-3), ++ python3-all-dbg, + python-all-dev (>= 2.6.6-3), ++ python3-all-dev, + python-talloc-dev (>= 2.1.14~), ++ python3-talloc-dev, + python-tdb (>= 1.3.16~), ++ python3-tdb, + xsltproc + Homepage: http://ldb.samba.org/ + Standards-Version: 4.0.0 +@@ -122,3 +127,37 @@ Description: LDB Python bindings - development files + database. + . + This package contains the development files for the Python bindings. ++ ++Package: python3-ldb ++Pre-Depends: ${misc:Pre-Depends} ++Section: python ++Architecture: any ++Depends: libldb1 (= ${binary:Version}), ++ ${misc:Depends}, ++ ${python3:Depends}, ++ ${shlibs:Depends} ++Provides: ${python:Provides} ++Breaks: ${python:Breaks} ++Description: Python 3 bindings for LDB ++ ldb is a LDAP-like embedded database built on top of TDB. ++ . ++ This package contains the Python 3 bindings. ++ ++Package: python3-ldb-dev ++Section: libdevel ++Architecture: any ++Multi-Arch: same ++Depends: libc6-dev, ++ libldb-dev, ++ pkg-config, ++ python3-ldb (= ${binary:Version}), ++ ${misc:Depends} ++Description: LDB Python 3 bindings - development files ++ ldb is a LDAP-like embedded database built on top of TDB. ++ . ++ It is a fast database with an LDAP-like API designed ++ to be used within an application. In some ways it can be seen as a ++ intermediate solution between key-value pair databases and a real LDAP ++ database. ++ . ++ This package contains the development files for the Python 3 bindings. +diff --git debian/python3-ldb-dev.install debian/python3-ldb-dev.install +new file mode 100644 +index 0000000..ddf0e1a +--- /dev/null ++++ debian/python3-ldb-dev.install +@@ -0,0 +1,3 @@ ++usr/include/pyldb.h ++usr/lib/*/libpyldb-util.cpython-*.so ++usr/lib/*/pkgconfig/pyldb-util.cpython-*.pc +diff --git debian/python3-ldb.install debian/python3-ldb.install +new file mode 100644 +index 0000000..b8d6112 +--- /dev/null ++++ debian/python3-ldb.install +@@ -0,0 +1,2 @@ ++usr/lib/*/libpyldb-util.cpython-*.so.* ++usr/lib/python3* +diff --git debian/rules debian/rules +index a420954..4b37eb6 100755 +--- debian/rules ++++ debian/rules +@@ -20,7 +20,7 @@ LDFLAGS += -Wl,--as-needed + + DESTDIR=$(CURDIR)/debian/tmp + +-export PYTHON=$(shell which `pyversions -d`) ++export PYTHON=$(shell which python3) + export PYTHON_CONFIG="$(PYTHON)-config" + export WAF=$(PYTHON) ./buildtools/bin/waf + +@@ -28,15 +28,16 @@ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) + + %: +- dh $* --with python2 ++ dh $* --with python2,python3 + + override_dh_auto_configure: +- PYTHON="$(PYTHON)" PYTHON_CONFIG="$(PYTHON_CONFIG)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" CPPFLAGS="$(CPPFLAGS)" \ ++ PYTHON="" PYTHON_CONFIG="$(PYTHON_CONFIG)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" CPPFLAGS="$(CPPFLAGS)" \ + $(WAF) configure --prefix=/usr --disable-rpath-install \ + --builtin-libraries=ccan,replace,tdb_compat \ + --bundled-libraries=NONE,pytevent \ + --minimum-library-version="$(shell ./debian/autodeps.py --minimum-library-version)" \ + --libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \ ++ --extra-python=/usr/bin/python2 \ + --with-modulesdir=/usr/lib/$(DEB_HOST_MULTIARCH)/ldb/modules + + get-packaged-orig-source: +@@ -80,4 +81,5 @@ override_dh_missing: + + override_dh_makeshlibs: + dh_makeshlibs -Xldb.so -ppython-ldb -- -c4 ++ dh_makeshlibs -Xldb. -ppython3-ldb -- -c4 + dh_makeshlibs -X/usr/lib/$(DEB_HOST_MULTIARCH)/ldb -plibldb1 -- -c4 diff --git a/ldb/21_python3.patch b/ldb/21_python3.patch new file mode 100644 index 0000000..47f0de3 --- /dev/null +++ b/ldb/21_python3.patch @@ -0,0 +1,43 @@ +commit 16aa74d7a12ed3f7d9907bb68495bd22f319625b +Author: Timo Aaltonen +Date: Wed Aug 14 11:50:31 2019 +0300 + + d/control, d/python3-ldb-dev.install, d/rules: use dh-exec and install the python header file in a version-dependent include dir. + +diff --git debian/control debian/control +index 5325c22..1c39223 100644 +--- debian/control ++++ debian/control +@@ -6,6 +6,7 @@ Uploaders: Jelmer Vernooij , + Mathieu Parent + Build-Depends: debhelper (>> 9), + dh-python, ++ dh-exec, + docbook-xml, + docbook-xsl, + libcmocka-dev (>= 1.1.1~), +diff --git debian/python3-ldb-dev.install debian/python3-ldb-dev.install +index ddf0e1a..a2f5db4 100644 +--- debian/python3-ldb-dev.install ++++ debian/python3-ldb-dev.install +@@ -1,3 +1,4 @@ +-usr/include/pyldb.h ++#! /usr/bin/dh-exec ++usr/include/pyldb.h ${DEB_PY3_INCDIR} + usr/lib/*/libpyldb-util.cpython-*.so + usr/lib/*/pkgconfig/pyldb-util.cpython-*.pc +diff --git debian/rules debian/rules +index 62d526a..e38d76d 100755 +--- debian/rules ++++ debian/rules +@@ -69,6 +69,10 @@ endif + override_dh_python2: + dh_python2 --no-guessing-versions + ++override_dh_install: ++ DEB_PY3_INCDIR=$(shell python3-config --includes | sed 's,^-I\([^ ]*\).*,\1,') \ ++ dh_install ++ + override_dh_auto_install: + DESTDIR=$(DESTDIR) $(WAF) install + rm $(DESTDIR)/usr/lib/python*/dist-packages/_tevent.so diff --git a/ldb/24_python3.patch b/ldb/24_python3.patch new file mode 100644 index 0000000..d662af1 --- /dev/null +++ b/ldb/24_python3.patch @@ -0,0 +1,23 @@ +commit e45ef92b6f0e08561b201d754f290236eafd7bac +Author: Timo Aaltonen +Date: Wed Aug 14 11:45:58 2019 +0300 + + d/rules: clean extra paths in the clean target + +diff --git debian/rules debian/rules +index e38d76d..20fd30b 100755 +--- debian/rules ++++ debian/rules +@@ -50,11 +50,7 @@ override_dh_auto_clean: + rm -f .lock-wscript + # Waf should be doing this; see + # https://bugzilla.samba.org/show_bug.cgi?id=8855 +- rm -f buildtools/wafsamba/*.pyc \ +- third_party/waf/wafadmin/*.pyc \ +- third_party/waf/wafadmin/Tools/*.pyc \ +- third_party/waf/waflib/*/*.pyc \ +- third_party/waf/waflib/*.pyc ++ find . -name __pycache__ -o -name "*.pyc" -exec rm -rf {} \; + + override_dh_auto_build: + $(WAF) build diff --git a/ldb/25_python3.patch b/ldb/25_python3.patch new file mode 100644 index 0000000..6134547 --- /dev/null +++ b/ldb/25_python3.patch @@ -0,0 +1,19 @@ +commit cbf1c191bcc37c43a78acf93392d994b693233a9 +Author: Timo Aaltonen +Date: Wed Aug 14 12:01:51 2019 +0300 + + d/rules: fix tevent globbing used in its removal + +diff --git debian/rules debian/rules +index 20fd30b..6291cf8 100755 +--- debian/rules ++++ debian/rules +@@ -71,7 +71,7 @@ override_dh_install: + + override_dh_auto_install: + DESTDIR=$(DESTDIR) $(WAF) install +- rm $(DESTDIR)/usr/lib/python*/dist-packages/_tevent.so ++ rm $(DESTDIR)/usr/lib/python*/dist-packages/_tevent*.so + rm $(DESTDIR)/usr/lib/python*/dist-packages/tevent.py + ar cr libldb.a bin/default/common/*.o + mv libldb.a $(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH) diff --git a/ldb/26_python3.quilt b/ldb/26_python3.quilt new file mode 100644 index 0000000..b7f2c02 --- /dev/null +++ b/ldb/26_python3.quilt @@ -0,0 +1,91 @@ +commit 6fdcda70d2abfc6165cd71827b5a45b948338776 +Author: Timo Aaltonen +Date: Wed Aug 14 11:55:31 2019 +0300 + + d/python3-ldb.symbols.*: add per-architecture symbols files + +diff --git debian/python3-ldb.symbols.amd64 debian/python3-ldb.symbols.amd64 +new file mode 100644 +index 0000000..bfebdff +--- /dev/null ++++ debian/python3-ldb.symbols.amd64 +@@ -0,0 +1,3 @@ ++libpyldb-util.cpython-35m-x86-64-linux-gnu.so.1 python3-ldb #MINVER# ++ PYLDB_UTIL.CPYTHON_35M_X86_64_LINUX_GNU_1.5.4@PYLDB_UTIL.CPYTHON_35M_X86_64_LINUX_GNU_1.5.4 2:1.5.4-1 ++#include "python3-ldb.symbols.common" +diff --git debian/python3-ldb.symbols.arm64 debian/python3-ldb.symbols.arm64 +new file mode 100644 +index 0000000..18a3a0b +--- /dev/null ++++ debian/python3-ldb.symbols.arm64 +@@ -0,0 +1,3 @@ ++libpyldb-util.cpython-37m-aarch64-linux-gnu.so.1 python3-ldb #MINVER# ++ PYLDB_UTIL.CPYTHON_37M_AARCH64_LINUX_GNU_1.5.5@PYLDB_UTIL.CPYTHON_37M_AARCH64_LINUX_GNU_1.5.5 1.5.5 ++#include "python3-ldb.symbols.common" +diff --git debian/python3-ldb.symbols.armhf debian/python3-ldb.symbols.armhf +new file mode 100644 +index 0000000..bace8bc +--- /dev/null ++++ debian/python3-ldb.symbols.armhf +@@ -0,0 +1,3 @@ ++libpyldb-util.cpython-37m-arm-linux-gnueabihf.so.1 python3-ldb #MINVER# ++ PYLDB_UTIL.CPYTHON_37M_ARM_LINUX_GNUEABIHF_1.5.5@PYLDB_UTIL.CPYTHON_37M_ARM_LINUX_GNUEABIHF_1.5.5 1.5.5 ++#include "python3-ldb.symbols.common" +diff --git debian/python3-ldb.symbols.common debian/python3-ldb.symbols.common +new file mode 100644 +index 0000000..d0b7037 +--- /dev/null ++++ debian/python3-ldb.symbols.common +@@ -0,0 +1,25 @@ ++ PYLDB_UTIL.PY3_1.1.23@PYLDB_UTIL.PY3_1.1.23 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.1.24@PYLDB_UTIL.PY3_1.1.24 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.1.25@PYLDB_UTIL.PY3_1.1.25 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.1.26@PYLDB_UTIL.PY3_1.1.26 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.1.27@PYLDB_UTIL.PY3_1.1.27 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.1.28@PYLDB_UTIL.PY3_1.1.28 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.1.29@PYLDB_UTIL.PY3_1.1.29 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.1.30@PYLDB_UTIL.PY3_1.1.30 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.1.31@PYLDB_UTIL.PY3_1.1.31 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.2.0@PYLDB_UTIL.PY3_1.2.0 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.2.1@PYLDB_UTIL.PY3_1.2.1 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.2.2@PYLDB_UTIL.PY3_1.2.2 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.2.3@PYLDB_UTIL.PY3_1.2.3 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.3.0@PYLDB_UTIL.PY3_1.3.0 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.3.1@PYLDB_UTIL.PY3_1.3.1 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.3.2@PYLDB_UTIL.PY3_1.3.2 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.4.0@PYLDB_UTIL.PY3_1.4.0 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.4.1@PYLDB_UTIL.PY3_1.4.1 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.5.0@PYLDB_UTIL.PY3_1.5.0 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.5.1@PYLDB_UTIL.PY3_1.5.1 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.5.2@PYLDB_UTIL.PY3_1.5.2 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.5.3@PYLDB_UTIL.PY3_1.5.3 2:1.5.4-1 ++ PYLDB_UTIL.PY3_1.5.4@PYLDB_UTIL.PY3_1.5.4 2:1.5.4-1 ++ pyldb_Dn_FromDn@PYLDB_UTIL.PY3_1.1.23 2:1.5.4-1 ++ pyldb_Object_AsDn@PYLDB_UTIL.PY3_1.1.23 2:1.5.4-1 +diff --git debian/python3-ldb.symbols.i386 debian/python3-ldb.symbols.i386 +new file mode 100644 +index 0000000..8eaf553 +--- /dev/null ++++ debian/python3-ldb.symbols.i386 +@@ -0,0 +1,3 @@ ++libpyldb-util.cpython-35m-i386-linux-gnu.so.1 python3-ldb #MINVER# ++ PYLDB_UTIL.CPYTHON_35M_I386_LINUX_GNU_1.5.5@PYLDB_UTIL.CPYTHON_35M_I386_LINUX_GNU_1.5.5 1.5.5 ++#include "python3-ldb.symbols.common" +diff --git debian/python3-ldb.symbols.ppc64el debian/python3-ldb.symbols.ppc64el +new file mode 100644 +index 0000000..6be9e03 +--- /dev/null ++++ debian/python3-ldb.symbols.ppc64el +@@ -0,0 +1,3 @@ ++libpyldb-util.cpython-37m-powerpc64le-linux-gnu.so.1 python3-ldb #MINVER# ++ PYLDB_UTIL.CPYTHON_37M_POWERPC64LE_LINUX_GNU_1.5.5@PYLDB_UTIL.CPYTHON_37M_POWERPC64LE_LINUX_GNU_1.5.5 1.5.5 ++#include "python3-ldb.symbols.common" +diff --git debian/python3-ldb.symbols.s390x debian/python3-ldb.symbols.s390x +new file mode 100644 +index 0000000..75c431b +--- /dev/null ++++ debian/python3-ldb.symbols.s390x +@@ -0,0 +1,3 @@ ++libpyldb-util.cpython-37m-s390x-linux-gnu.so.1 python3-ldb #MINVER# ++ PYLDB_UTIL.CPYTHON_37M_S390X_LINUX_GNU_1.5.5@PYLDB_UTIL.CPYTHON_37M_S390X_LINUX_GNU_1.5.5 1.5.5 ++#include "python3-ldb.symbols.common" diff --git a/ldb/27_python3.patch b/ldb/27_python3.patch new file mode 100644 index 0000000..4b79af3 --- /dev/null +++ b/ldb/27_python3.patch @@ -0,0 +1,14 @@ +commit c0ab892e42e6aeb676fca5e89b16f5be8a3e529a +Author: Florian Best +Date: Mon Nov 25 20:07:42 2019 +0100 + + Fix python installation files + +diff --git debian/python-ldb.install debian/python-ldb.install +index d6f9c1b..7ad4b68 100644 +--- debian/python-ldb.install ++++ debian/python-ldb.install +@@ -1,2 +1,2 @@ + usr/lib/*/libpyldb-util.so.* +-usr/lib/python* ++usr/lib/python2* diff --git a/ldb/28_python3.patch b/ldb/28_python3.patch new file mode 100644 index 0000000..46b8037 --- /dev/null +++ b/ldb/28_python3.patch @@ -0,0 +1,65 @@ +commit 3dd07a1d219e34e183db3dfc85baf6bc939bf96d +Author: Timo Aaltonen +Date: Wed Aug 14 11:40:36 2019 +0300 + + d/rules: use Makefile targets instead of direct WAF calls + +diff --git debian/rules debian/rules +index 6291cf8..582a5aa 100755 +--- debian/rules ++++ debian/rules +@@ -20,10 +20,6 @@ LDFLAGS += -Wl,--as-needed + + DESTDIR=$(CURDIR)/debian/tmp + +-export PYTHON=$(shell which python3) +-export PYTHON_CONFIG="$(PYTHON)-config" +-export WAF=$(PYTHON) ./buildtools/bin/waf +- + DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) + +@@ -31,8 +27,8 @@ DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) + dh $* --with python2,python3 + + override_dh_auto_configure: +- PYTHON="" PYTHON_CONFIG="$(PYTHON_CONFIG)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" CPPFLAGS="$(CPPFLAGS)" \ +- $(WAF) configure --prefix=/usr --disable-rpath-install \ ++ CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" CPPFLAGS="$(CPPFLAGS)" \ ++ ./configure --prefix=/usr --disable-rpath-install \ + --builtin-libraries=ccan,replace,tdb_compat \ + --bundled-libraries=NONE,pytevent \ + --minimum-library-version="$(shell ./debian/autodeps.py --minimum-library-version)" \ +@@ -44,7 +40,7 @@ get-packaged-orig-source: + ./debian/build-orig.sh + + override_dh_auto_clean: +- -$(WAF) clean ++ [ ! -f Makefile ] || $(MAKE) distclean + # Waf should be doing this; see + # https://bugzilla.samba.org/show_bug.cgi?id=8854 + rm -f .lock-wscript +@@ -53,12 +49,12 @@ override_dh_auto_clean: + find . -name __pycache__ -o -name "*.pyc" -exec rm -rf {} \; + + override_dh_auto_build: +- $(WAF) build ++ $(MAKE) all + + override_dh_auto_test: + ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) + ifeq ($(DEB_HOST_ARCH_CPU), amd64) +- $(WAF) test ++ #$(MAKE) test + endif + endif + +@@ -70,7 +66,7 @@ override_dh_install: + dh_install + + override_dh_auto_install: +- DESTDIR=$(DESTDIR) $(WAF) install ++ DESTDIR=$(DESTDIR) $(MAKE) install + rm $(DESTDIR)/usr/lib/python*/dist-packages/_tevent*.so + rm $(DESTDIR)/usr/lib/python*/dist-packages/tevent.py + ar cr libldb.a bin/default/common/*.o -- 2.11.0