[PATCH 3/4] Add python-libxml2-dbg package; closes: #583582

Loïc Minier lool at dooz.org
Sun May 30 14:16:10 UTC 2010


---
 debian/control                    |   19 ++++++++++++++++++-
 debian/python-libxml2-dbg.install |    1 +
 debian/rules                      |   29 +++++++++++++++++++++++++----
 3 files changed, 44 insertions(+), 5 deletions(-)
 create mode 100644 debian/python-libxml2-dbg.install

diff --git a/debian/control b/debian/control
index db3cf16..74deeda 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Section: libs
 Maintainer: Debian XML/SGML Group <debian-xml-sgml-pkgs at lists.alioth.debian.org>
 Uploaders: Mike Hommey <glandium at debian.org>
 Standards-Version: 3.8.4.0
-Build-Depends: debhelper (>= 7.0.50~), zlib1g-dev | libz-dev, python-all-dev (>= 2.3.5-11), python-support (>= 0.3), autotools-dev, libreadline-dev | libreadline5-dev, binutils (>= 2.14.90.0.7), dpkg-dev (>= 1.14.9)
+Build-Depends: debhelper (>= 7.0.50~), zlib1g-dev | libz-dev, python-all-dev (>= 2.3.5-11), python-all-dbg, python-support (>= 0.3), autotools-dev, libreadline-dev | libreadline5-dev, binutils (>= 2.14.90.0.7), dpkg-dev (>= 1.14.9)
 Homepage: http://xmlsoft.org/
 Vcs-Git: git://git.debian.org/debian-xml-sgml/libxml2.git
 Vcs-Browser: http://git.debian.org/?p=debian-xml-sgml/libxml2.git
@@ -102,6 +102,7 @@ Conflicts: python2.3-libxml2 (<< 2.6.26.dfsg-2), python2.4-libxml2 (<< 2.6.26.df
 Replaces: python2.3-libxml2 (<< 2.6.26.dfsg-2), python2.4-libxml2 (<< 2.6.26.dfsg-2)
 Provides: ${python:Provides}
 Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}
+Suggests: python-libxml2-dbg
 XB-Python-Version: ${python:Versions}
 Description: Python bindings for the GNOME XML library
  XML is a metalanguage to let you design your own markup language.
@@ -113,3 +114,19 @@ Description: Python bindings for the GNOME XML library
  .
  This package contains the files needed to use the GNOME XML library
  in Python programs.
+
+Package: python-libxml2-dbg
+Priority: extra
+Architecture: any
+Section: python
+Depends: python-dbg, python-libxml2 (= ${binary:Version}), ${shlibs:Depends},
+         ${misc:Depends}
+Description: Python bindings for the GNOME XML library (debug extension)
+ XML is a metalanguage to let you design your own markup language.
+ A regular markup language defines a way to describe information in
+ a certain class of documents (eg HTML). XML lets you define your
+ own customized markup languages for many classes of document. It
+ can do this because it's written in SGML, the international standard
+ metalanguage for markup languages.
+ .
+ This package contains the extension built for the python debug interpreter.
diff --git a/debian/python-libxml2-dbg.install b/debian/python-libxml2-dbg.install
new file mode 100644
index 0000000..abe9f5b
--- /dev/null
+++ b/debian/python-libxml2-dbg.install
@@ -0,0 +1 @@
+usr/lib/python*/*-packages/*_d.so
diff --git a/debian/rules b/debian/rules
index e012ea0..d011314 100755
--- a/debian/rules
+++ b/debian/rules
@@ -22,6 +22,10 @@ configure-python%: configure-main
 	dh_auto_configure --builddirectory=build-python$* -- --with-history --with-python=/usr/bin/python$* CC="gcc -Wl,--as-needed" CFLAGS="$(CFLAGS)" --cache-file="$(CURDIR)/build/config.cache"
 	mv build-python$*/python build/python$*
 	rm -rf build-python$*
+	# upstream configure isn't flexible enough to pass the various vars
+	# which python$*-dbg would need, so we just override them during
+	# $(MAKE) and $(MAKE) install
+	cp -a build/python$* build/python$*-dbg
 
 override_dh_auto_build: build-main $(PYVERS:%=build-%)
 
@@ -29,10 +33,15 @@ build-main:
 	dh_auto_build --builddirectory=build
 
 build-python%:
+	dh_auto_build --builddirectory=build/python$*-dbg \
+		-- \
+		CFLAGS="$(CFLAGS) -Wextra -O0 -fno-strict-aliasing -pedantic" \
+		PYTHON=/usr/bin/python$*-dbg \
+		PYTHON_INCLUDES=/usr/include/python$*_d
 	dh_auto_build --builddirectory=build/python$*
 
 override_dh_auto_clean:
-	rm -rf build build-python*
+	rm -rf build build-python* debian/tmp-dbg
 
 	-test -r /usr/share/misc/config.sub && \
 	cp -f /usr/share/misc/config.sub config.sub
@@ -62,6 +71,17 @@ install-main:
 		doc/tutorial debian/tmp/usr/share/doc/libxml2-doc
 
 install-python%:
+	dh_auto_install --builddirectory=build/python$*-dbg \
+		-- \
+		CFLAGS="$(CFLAGS) -Wextra -O0 -fno-strict-aliasing -pedantic" \
+		PYTHON=/usr/bin/python$*-dbg \
+		PYTHON_INCLUDES=/usr/include/python$*_d
+	for i in $$(find debian/tmp/usr/lib/python$* -name '*.so'); do \
+	  b=$$(basename $$i .so); \
+	  mv $$i $$(dirname $$i)/$${b}_d.so; \
+	done
+	mkdir -p debian/tmp-dbg/usr/lib
+	mv debian/tmp/usr/lib/python$* debian/tmp-dbg/usr/lib
 	dh_auto_install --builddirectory=build/python$*
 
 override_dh_installdocs:
@@ -76,12 +96,13 @@ override_dh_installchangelogs:
 	dh_installchangelogs -Nlibxml2 -XChangeLog
 
 override_dh_install:
-	dh_install
+	dh_install -Npython-libxml2-dbg
+	dh_install -ppython-libxml2-dbg --sourcedir=debian/tmp-dbg
 	sed "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/libxml2.la > debian/libxml2-dev/usr/lib/libxml2.la
 
 override_dh_strip:
-	dh_strip -a --dbg-package=libxml2-dbg -Npython-libxml2
-	dh_strip -ppython-libxml2
+	dh_strip -a --dbg-package=libxml2-dbg -Npython-libxml2 -Npython-libxml2-dbg
+	dh_strip -ppython-libxml2 --dbg-package=python-libxml2-dbg
 	$(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 \
-- 
1.7.0.4


--AqsLC8rIMeq19msA
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0004-Add-python-libxml2-dbg.preinst-for-Ubuntu.patch"



More information about the debian-xml-sgml-pkgs mailing list