From 88f69c41fd100138c9b47d7d07bb351fc3c26744 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 30 Aug 2019 15:54:31 +0100 Subject: Add a build-profile to disable Python 2 packages We can't remove them yet (see the blocking bugs of #936371) but at least we can start to clear a path to doing so. --- debian/changelog | 3 +++ debian/control | 13 +++++++++---- debian/rules | 18 ++++++++++++++++-- 3 files changed, 28 insertions(+), 6 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index dab36c2..089805a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ dbus-python (1.2.8-4) UNRELEASED; urgency=medium and python-all-dev. Only build for the default version of Python 2, not for all versions of Python 2 (in practice this has meant the same thing since 2.6 was de-supported in 2013). + * Add a build-profile to disable Python 2 packages. + We can't remove them yet (see the blocking bugs of #936371) but at + least we can start to clear a path to doing so. -- Simon McVittie Sun, 23 Jun 2019 19:19:02 +0100 diff --git a/debian/control b/debian/control index 83cea70..05b9906 100644 --- a/debian/control +++ b/debian/control @@ -14,13 +14,15 @@ Build-Depends: dbus (>= 1.8), debhelper (>= 11~), dh-python, + dh-sequence-python2 , + dh-sequence-python3, dpkg-dev (>= 1.16.1), libdbus-1-dev (>= 1.8), libglib2.0-dev (>= 2.40), - python2-dbg, - python2-dev, - python-gi, - python-tap, + python2-dbg , + python2-dev , + python-gi , + python-tap , python3-all-dbg, python3-all-dev, python3-gi, @@ -38,6 +40,7 @@ Vcs-Browser: https://salsa.debian.org/debian/dbus-python Testsuite: autopkgtest-pkg-python Package: python-dbus +Build-Profiles: Section: python Architecture: any Depends: @@ -69,6 +72,7 @@ Description: simple interprocess messaging system (Python interface) See the dbus description for more information about D-Bus in general. Package: python-dbus-dbg +Build-Profiles: Section: debug Architecture: any Depends: @@ -118,6 +122,7 @@ Description: Documentation for the D-Bus Python interface python-dbus and python3-dbus packages. Package: python-dbus-tests +Build-Profiles: Section: python Architecture: any Depends: diff --git a/debian/rules b/debian/rules index 43a3760..2e1f29a 100755 --- a/debian/rules +++ b/debian/rules @@ -4,18 +4,24 @@ # Copyright © 2006 Sjoerd Simons # Copyright © 2012 Collabora Ltd. +binaries := $(shell dh_listpackages) + export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow include /usr/share/dpkg/default.mk +ifneq ($(filter python-dbus,$(binaries)),) PYTHON2 := $(shell pyversions --default --version) +else +PYTHON2 := +endif PYTHON3 := $(shell py3versions --requested --version debian/control) PYDEFAULTVER := $(shell py3versions --default --version) FLAVOURS := $(patsubst %,%-dbg,$(PYTHON2) $(PYTHON3)) $(PYTHON2) $(PYTHON3) %: - dh $@ --with python2,python3,sphinxdoc --buildsystem=autoconf + dh $@ --with sphinxdoc --buildsystem=autoconf # The special case for 2.7-dbg is a workaround. Python 2 doesn't have the # LDVERSION sysconfig variable, which would give AX_PYTHON_DEVEL the @@ -79,6 +85,7 @@ override_dh_auto_test-indep: : override_dh_auto_install-arch: +ifneq ($(filter python-dbus,$(binaries)),) set -e; for x in $(PYTHON2); do \ PYTHON=/usr/bin/python$$x \ dh_auto_install \ @@ -107,6 +114,7 @@ override_dh_auto_install-arch: install debian/tmp-dbg/usr/lib/python$$x/dist-packages/_dbus_glib_bindings.so \ debian/tmp/usr/lib/python$$x/dist-packages/_dbus_glib_bindings_d.so; \ done +endif set -e; for x in $(PYTHON3); do \ PYTHON=/usr/bin/python$$x \ dh_auto_install \ @@ -165,9 +173,11 @@ override_dh_installexamples: dh_installexamples --remaining-packages override_dh_installdocs: +ifneq ($(filter python-dbus,$(binaries)),) dh_installdocs --link-doc=python-dbus -ppython-dbus-dbg - dh_installdocs --link-doc=python3-dbus -ppython3-dbus-dbg dh_installdocs --doc-main-package=python-dbus -ppython-dbus +endif + dh_installdocs --link-doc=python3-dbus -ppython3-dbus-dbg dh_installdocs --doc-main-package=python-dbus-doc -ppython-dbus-doc dh_installdocs --doc-main-package=python3-dbus -ppython3-dbus dh_installdocs --remaining-packages @@ -184,15 +194,19 @@ override_dh_missing: dh_missing --fail-missing override_dh_strip: +ifneq ($(filter python-dbus,$(binaries)),) dh_strip --dbg-package=python-dbus-dbg -ppython-dbus -ppython-dbus-dbg -ppython-dbus-tests +endif dh_strip --dbg-package=python3-dbus-dbg -ppython3-dbus -ppython3-dbus-dbg -ppython3-dbus-tests +ifneq ($(filter python-dbus,$(binaries)),) override_dh_python2: dh_python2 set -e; for x in $(PYTHON2) $(patsubst %,%-dbg,$(PYTHON2)); do \ dh_python2 --shebang="/usr/bin/python$$x" \ /usr/lib/$(DEB_HOST_MULTIARCH)/installed-tests/dbus-python/python$$x; \ done +endif override_dh_python3: dh_python3 -- cgit v1.2.3