Source: libxml2
Version: 2.9.1+dfsg1-3
Severity: wishlist
Tags: patch

For example: libxml2 Build-Depends on python, which Depends on python2.7, 
which Build-Depends on sharutils, which Build-Depends on texinfo, which 
Depends on libxml-libxml-perl, which Build-Depends on libxml2-dev.  So, here's 
a patch to break such cycles by making it possible to bootstrap src:libxml2 
without its python modules.
-- 
Daniel Schepler
diff -urN libxml2-2.9.1+dfsg1.old/debian/rules libxml2-2.9.1+dfsg1/debian/rules
--- libxml2-2.9.1+dfsg1.old/debian/rules	2013-06-08 09:55:16.000000000 -0700
+++ libxml2-2.9.1+dfsg1/debian/rules	2013-06-27 22:51:44.513407076 -0700
@@ -25,6 +25,11 @@
 export DH_OPTIONS = -Nlibxml2-udeb
 endif
 
+ifeq ($(DEB_BUILD_PROFILE),stage1)
+DH_OPTIONS += -Npython-libxml2 -Npython-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-%)
@@ -103,14 +108,18 @@
 
 override_dh_install:
 	dh_install -Npython-libxml2-dbg -Nlibxml2-udeb
+ifneq ($(DEB_BUILD_PROFILE),stage1)
 	dh_install -ppython-libxml2-dbg --sourcedir=debian/tmp-dbg
+endif
 	dh_install -plibxml2-udeb --sourcedir=debian/tmp-udeb
 	sed -i -e 's,/lib/$(DEB_HOST_MULTIARCH),/lib,' debian/libxml2-dev/usr/bin/xml2-config
 
 override_dh_strip:
 	dh_strip -a --dbg-package=libxml2-dbg -Nlibxml2-udeb -Nlibxml2-utils -Nlibxml2-utils-dbg -Npython-libxml2 -Npython-libxml2-dbg
 	dh_strip -plibxml2-utils --dbg-package=libxml2-utils-dbg
+ifneq ($(DEB_BUILD_PROFILE),stage1)
 	dh_strip -ppython-libxml2 --dbg-package=python-libxml2-dbg
+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 \
@@ -123,6 +132,10 @@
 	dh_makeshlibs -a $(if $(WITH_UDEB),--add-udeb=libxml2-udeb )-V 'libxml2 (>= 2.7.4)' -- -c4
 
 %:
+ifeq ($(DEB_BUILD_PROFILE),stage1)
+	dh $@ --with autoreconf
+else
 	dh $@ --with autoreconf,python2
+endif
 
 

Reply via email to