Verified Commit 8dfa4aa7 authored by Helmut Grohne's avatar Helmut Grohne Committed by Mattia Rizzolo

Improve build profiles support

+ Rename stage1 to meaningful nopython.
+ Use the standard variable DEB_BUILD_PROFILES rather than
  DEB_BUILD_PROFILE by checking dh_listpackages.
+ Correctly build nopython even when python is installed.
+ Add build profile annotations to debian/control.

Closes: #862867
Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent e6685afd
......@@ -5,10 +5,10 @@ Maintainer: Debian XML/SGML Group <debian-xml-sgml-pkgs@lists.alioth.debian.org>
Uploaders: Aron Xu <aron@debian.org>, YunQiang Su <wzssyqa@gmail.com>
Standards-Version: 3.9.8
Build-Depends: debhelper (>= 9), dh-autoreconf, autotools-dev, pkg-config,
libpython-all-dev, libpython-all-dbg,
python-all-dev:any (>= 2.7.5-5~), python-all-dbg:any,
libpython3-all-dev, libpython3-all-dbg,
python3-all-dev:any (>= 3.5), python3-all-dbg:any,
libpython-all-dev <!nopython>, libpython-all-dbg <!nopython>,
python-all-dev:any (>= 2.7.5-5~) <!nopython>, python-all-dbg:any <!nopython>,
libpython3-all-dev <!nopython>, libpython3-all-dbg <!nopython>,
python3-all-dev:any (>= 3.5) <!nopython>, python3-all-dbg:any <!nopython>,
zlib1g-dev | libz-dev, liblzma-dev, libicu-dev
Homepage: http://xmlsoft.org/
Vcs-Git: https://anonscm.debian.org/git/debian-xml-sgml/libxml2.git
......@@ -117,6 +117,7 @@ Description: Documentation for the GNOME XML library
Package: python-libxml2
Architecture: any
Build-Profiles: <!nopython>
Section: python
Provides: ${python:Provides}
Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}
......@@ -133,6 +134,7 @@ Description: Python bindings for the GNOME XML library
Package: python-libxml2-dbg
Architecture: any
Build-Profiles: <!nopython>
Section: debug
Priority: extra
Provides: ${python:Provides}
......@@ -150,6 +152,7 @@ Description: Python bindings for the GNOME XML library (debug extension)
Package: python3-libxml2
Architecture: any
Build-Profiles: <!nopython>
Section: python
Multi-Arch: same
Provides: ${python3:Provides}
......@@ -167,6 +170,7 @@ Description: Python3 bindings for the GNOME XML library
Package: python3-libxml2-dbg
Architecture: any
Build-Profiles: <!nopython>
Section: debug
Priority: extra
Multi-Arch: same
......
#!/usr/bin/make -f
export DH_VERBOSE=1
DOPACKAGES = $(shell dh_listpackages)
ifneq (,$(filter python-libxml2 python-libxml2-dbg,$(DOPACKAGES)))
# The versions of python currently supported
PYVERS=$(shell pyversions -s)
PY3VERS=$(shell py3versions -s)
# The current default version of python
PYVER=$(shell pyversions -d)
else
PYVERS=
PYVER=
endif
ifneq (,$(filter python3-libxml2 python3-libxml2-dbg,$(DOPACKAGES)))
# The versions of python3 currently supported
PY3VERS=$(shell py3versions -s)
# The current default version of python3
PY3VER=$(shell py3versions -d)
else
PY3VERS=
PY3VER=
endif
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
......@@ -29,11 +43,6 @@ $(if $(shell grep -q libxml2-udeb debian/control && echo yes),$(shell sed -i /li
export DH_OPTIONS = -Nlibxml2-udeb
endif
ifeq ($(DEB_BUILD_PROFILE),stage1)
DH_OPTIONS += -Npython-libxml2 -Npython-libxml2-dbg -Npython3-libxml2 -Npython3-libxml2-dbg
export DH_OPTIONS
endif
CONFIGURE_FLAGS := --disable-silent-rules --with-history CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" --cache-file="$(CURDIR)/builddir/config.cache"
override_dh_auto_configure: $(TARGETS:%=doconfigure-%)
......@@ -123,8 +132,10 @@ override_dh_installchangelogs:
override_dh_install-arch:
dh_install -Npython-libxml2-dbg -Npython3-libxml2-dbg -Nlibxml2-udeb
ifneq ($(DEB_BUILD_PROFILE),stage1)
ifneq (,$(filter python-libxml2-dbg,$(DOPACKAGES)))
dh_install -ppython-libxml2-dbg --sourcedir=debian/tmp-dbg
endif
ifneq (,$(filter python3-libxml2-dbg,$(DOPACKAGES)))
dh_install -ppython3-libxml2-dbg --sourcedir=debian/tmp-dbg
endif
dh_install -plibxml2-udeb --sourcedir=debian/tmp-udeb
......@@ -133,8 +144,10 @@ endif
override_dh_strip:
dh_strip -a --dbg-package=libxml2-dbg -Nlibxml2-udeb -Nlibxml2-utils -Nlibxml2-utils-dbg -Npython-libxml2 -Npython-libxml2-dbg -Npython3-libxml2 -Npython3-libxml2-dbg
dh_strip -plibxml2-utils --dbg-package=libxml2-utils-dbg
ifneq ($(DEB_BUILD_PROFILE),stage1)
ifneq (,$(filter python-libxml2 python-libxml2-dbg,$(DOPACKAGES)))
dh_strip -ppython-libxml2 --dbg-package=python-libxml2-dbg
endif
ifneq (,$(filter python3-libxml2 python3-libxml2-dbg,$(DOPACKAGES)))
dh_strip -ppython3-libxml2 --dbg-package=python3-libxml2-dbg
endif
$(foreach python, $(filter-out $(PYVER), $(PYVERS)),\
......@@ -158,8 +171,8 @@ override_dh_gencontrol:
dh_gencontrol -- -Vdep:libicudbg="`dpkg-query -f '$${Depends}' -W libicu-dev | sed 's/.*\(libicu[0-9]*\).*/\1/'`-dbg"
%:
ifeq ($(DEB_BUILD_PROFILE),stage1)
dh $@ --with autoreconf
else
dh $@ --parallel --with autoreconf,python2,python3
endif
dh $@ \
--parallel \
--with autoreconf \
$(if $(filter python-libxml2 python-libxml2-dbg,$(DOPACKAGES)),--with python2) \
$(if $(filter python3-libxml2 python3-libxml2-dbg,$(DOPACKAGES)),--with python3)
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