Build for all supported python versions

Closes: #864328
Thanks: YunQiang Su <wzssyqa@gmail.com> for the initial patch
Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 8dfa4aa7
...@@ -5,6 +5,7 @@ Maintainer: Debian XML/SGML Group <debian-xml-sgml-pkgs@lists.alioth.debian.org> ...@@ -5,6 +5,7 @@ Maintainer: Debian XML/SGML Group <debian-xml-sgml-pkgs@lists.alioth.debian.org>
Uploaders: Aron Xu <aron@debian.org>, YunQiang Su <wzssyqa@gmail.com> Uploaders: Aron Xu <aron@debian.org>, YunQiang Su <wzssyqa@gmail.com>
Standards-Version: 3.9.8 Standards-Version: 3.9.8
Build-Depends: debhelper (>= 9), dh-autoreconf, autotools-dev, pkg-config, Build-Depends: debhelper (>= 9), dh-autoreconf, autotools-dev, pkg-config,
dh-python,
libpython-all-dev <!nopython>, libpython-all-dbg <!nopython>, libpython-all-dev <!nopython>, libpython-all-dbg <!nopython>,
python-all-dev:any (>= 2.7.5-5~) <!nopython>, python-all-dbg:any <!nopython>, python-all-dev:any (>= 2.7.5-5~) <!nopython>, python-all-dbg:any <!nopython>,
libpython3-all-dev <!nopython>, libpython3-all-dbg <!nopython>, libpython3-all-dev <!nopython>, libpython3-all-dbg <!nopython>,
......
...@@ -6,20 +6,14 @@ DOPACKAGES = $(shell dh_listpackages) ...@@ -6,20 +6,14 @@ DOPACKAGES = $(shell dh_listpackages)
ifneq (,$(filter python-libxml2 python-libxml2-dbg,$(DOPACKAGES))) ifneq (,$(filter python-libxml2 python-libxml2-dbg,$(DOPACKAGES)))
# The versions of python currently supported # The versions of python currently supported
PYVERS=$(shell pyversions -s) PYVERS=$(shell pyversions -s)
# The current default version of python
PYVER=$(shell pyversions -d)
else else
PYVERS= PYVERS=
PYVER=
endif endif
ifneq (,$(filter python3-libxml2 python3-libxml2-dbg,$(DOPACKAGES))) ifneq (,$(filter python3-libxml2 python3-libxml2-dbg,$(DOPACKAGES)))
# The versions of python3 currently supported # The versions of python3 currently supported
PY3VERS=$(shell py3versions -s) PY3VERS=$(shell py3versions -s)
# The current default version of python3
PY3VER=$(shell py3versions -d)
else else
PY3VERS= PY3VERS=
PY3VER=
endif endif
export DEB_BUILD_MAINT_OPTIONS=hardening=+all export DEB_BUILD_MAINT_OPTIONS=hardening=+all
...@@ -52,9 +46,10 @@ debian/autoreconf.after: ...@@ -52,9 +46,10 @@ debian/autoreconf.after:
doconfigure-%: debian/autoreconf.after doconfigure-%: debian/autoreconf.after
dh_auto_configure --parallel --builddirectory=builddir/$(*) -- $(CONFIGURE_FLAGS) dh_auto_configure --parallel --builddirectory=builddir/$(*) -- $(CONFIGURE_FLAGS)
touch $@
doconfigure-main: CONFIGURE_FLAGS += --without-python --with-icu doconfigure-main: CONFIGURE_FLAGS += --without-python --with-icu
doconfigure-python%: CONFIGURE_FLAGS += --with-python=/usr/bin/$(*) doconfigure-python%: CONFIGURE_FLAGS += --with-python=/usr/bin/$(subst -dbg,,$(*)) --with-python-install-dir=/usr/lib/$(subst -dbg,,$(*))/dist-packages
#doconfigure-udeb: CONFIGURE_FLAGS += --without-history --with-minimum --with-tree --with-output #doconfigure-udeb: CONFIGURE_FLAGS += --without-history --with-minimum --with-tree --with-output
doconfigure-udeb: CONFIGURE_FLAGS += --without-history --with-tree --with-output --without-python --without-icu doconfigure-udeb: CONFIGURE_FLAGS += --without-history --with-tree --with-output --without-python --without-icu
...@@ -79,6 +74,7 @@ build: build-arch build-indep ...@@ -79,6 +74,7 @@ build: build-arch build-indep
override_dh_auto_clean: override_dh_auto_clean:
rm -rf builddir debian/tmp-dbg debian/tmp-udeb rm -rf builddir debian/tmp-dbg debian/tmp-udeb
rm -f doconfigure-*
dh_auto_clean dh_auto_clean
override_dh_auto_install-arch: $(TARGETS:%=doinstall-%) override_dh_auto_install-arch: $(TARGETS:%=doinstall-%)
...@@ -150,18 +146,6 @@ endif ...@@ -150,18 +146,6 @@ endif
ifneq (,$(filter python3-libxml2 python3-libxml2-dbg,$(DOPACKAGES))) ifneq (,$(filter python3-libxml2 python3-libxml2-dbg,$(DOPACKAGES)))
dh_strip -ppython3-libxml2 --dbg-package=python3-libxml2-dbg dh_strip -ppython3-libxml2 --dbg-package=python3-libxml2-dbg
endif endif
$(foreach python, $(filter-out $(PYVER), $(PYVERS)),\
cd $(CURDIR)/debian/python-libxml2/usr/lib/pyshared; \
if diff $(python)/libxml2mod.so $(PYVER)/libxml2mod.so > /dev/null 2>&1; then \
rm -f $(python)/libxml2mod.so; \
ln -s ../$(PYVER)/libxml2mod.so $(python)/libxml2mod.so; \
fi;)
$(foreach python3, $(filter-out $(PY3VER), $(PY3VERS)),\
cd $(CURDIR)/debian/python3-libxml2/usr/lib/pyshared; \
if diff $(python3)/libxml2mod.so $(PYVER)/libxml2mod.so > /dev/null 2>&1; then \
rm -f $(python3)/libxml2mod.so; \
ln -s ../$(PY3VER)/libxml2mod.so $(python3)/libxml2mod.so; \
fi;)
dh_strip -Npython-libxml2-dbg -Npython3-libxml2-dbg dh_strip -Npython-libxml2-dbg -Npython3-libxml2-dbg
override_dh_makeshlibs: override_dh_makeshlibs:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment