Package: libxml2 
Version: 2.7.8.dfsg-4
Severity: normal
User: debian-d...@lists.debian.org
Usertags: multiarch
Tags: patch

Hi,

The following patch converts libxml2 to multiarch directories (by modifyin 
rules)
and adds needed Multi-Arch: stanzas to control file. dpkg-dev build-dep was 
dropped
as debhelper > 8.1.3 already pulls newer dpkg-dev in.

"Multi-Arch: same" packages must have identical files installed to same path, 
for
this reason /usr/bin/xml2-config is modified to get rid the arch-specific 
libdir.
Since the linked will search the multiarch path anyways, no functionality is 
lost.

http://wiki.debian.org/Multiarch/Implementation

Riku
diff -urN orig/libxml2-2.7.8.dfsg//debian/control libxml2-2.7.8.dfsg//debian/control
--- orig/libxml2-2.7.8.dfsg//debian/control	2011-09-26 18:44:31.000000000 +0300
+++ libxml2-2.7.8.dfsg//debian/control	2011-09-26 18:45:15.511228603 +0300
@@ -4,7 +4,7 @@
 Maintainer: Debian XML/SGML Group <debian-xml-sgml-p...@lists.alioth.debian.org>
 Uploaders: Mike Hommey <gland...@debian.org>
 Standards-Version: 3.9.2.0
-Build-Depends: debhelper (>= 7.0.50~), zlib1g-dev | libz-dev, python-all-dev (>= 2.6.6-3~), python-all-dbg, autotools-dev, libreadline-dev | libreadline5-dev, binutils (>= 2.14.90.0.7), dpkg-dev (>= 1.14.9), perl
+Build-Depends: debhelper (>= 8.1.3), zlib1g-dev | libz-dev, python-all-dev (>= 2.6.6-3~), python-all-dbg, autotools-dev, libreadline-dev | libreadline5-dev, binutils (>= 2.14.90.0.7), perl
 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
@@ -15,6 +15,8 @@
 Section: libs
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Recommends: xml-core
+Pre-Depends: ${misc:Pre-Depends}
+Multi-Arch: same
 Description: GNOME XML library
  XML is a metalanguage to let you design your own markup language.
  A regular markup language defines a way to describe information in
@@ -30,6 +32,7 @@
 Architecture: any
 Section: text
 Depends: ${shlibs:Depends}, ${misc:Depends}
+Multi-Arch: foreign
 Description: XML utilities
  XML is a metalanguage to let you design your own markup language.
  A regular markup language defines a way to describe information in
@@ -46,6 +49,7 @@
 Architecture: any
 Section: libdevel
 Depends: libxml2 (= ${binary:Version}), ${misc:Depends}
+Multi-Arch: same
 Description: Development files for the GNOME XML library
  XML is a metalanguage to let you design your own markup language.
  A regular markup language defines a way to describe information in
@@ -123,3 +127,18 @@
  This package contains the files needed to use the GNOME XML library
  in Python programs for use with the Python debug interpreter.
 
+Package: libxml2-udeb
+XC-Package-Type: udeb
+Architecture: any
+Section: debian-installer
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: GNOME XML library - minimal runtime
+ 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 is a minimal package for use in debian-installer that yields a
+ library providing an extensive API to handle such XML data files.
diff -urN orig/libxml2-2.7.8.dfsg//debian/libxml2-dev.install libxml2-2.7.8.dfsg//debian/libxml2-dev.install
--- orig/libxml2-2.7.8.dfsg//debian/libxml2-dev.install	2011-09-26 18:44:31.000000000 +0300
+++ libxml2-2.7.8.dfsg//debian/libxml2-dev.install	2011-09-26 18:37:08.111228378 +0300
@@ -1,7 +1,7 @@
 usr/bin/xml2-config
-usr/lib/libxml2.so
-usr/lib/libxml2.a
-usr/lib/xml2Conf.sh
+usr/lib/*/libxml2.so
+usr/lib/*/libxml2.a
+usr/lib/*/xml2Conf.sh
 usr/share/aclocal
-usr/lib/pkgconfig
+usr/lib/*/pkgconfig
 usr/include/libxml2
diff -urN orig/libxml2-2.7.8.dfsg//debian/libxml2.install libxml2-2.7.8.dfsg//debian/libxml2.install
--- orig/libxml2-2.7.8.dfsg//debian/libxml2.install	2011-09-26 18:44:31.000000000 +0300
+++ libxml2-2.7.8.dfsg//debian/libxml2.install	2011-09-26 18:37:18.251228382 +0300
@@ -1 +1 @@
-usr/lib/libxml2.so.*
+usr/lib/*/libxml2.so.*
diff -urN orig/libxml2-2.7.8.dfsg//debian/rules libxml2-2.7.8.dfsg//debian/rules
--- orig/libxml2-2.7.8.dfsg//debian/rules	2011-09-26 18:44:31.000000000 +0300
+++ libxml2-2.7.8.dfsg//debian/rules	2011-09-26 19:53:09.051230480 +0300
@@ -32,7 +32,7 @@
 configure-%:
 	dh_auto_configure --builddirectory=build/$* -- $(CONFIGURE_FLAGS)
 
-configure-main: CONFIGURE_FLAGS += --without-python
+configure-main: CONFIGURE_FLAGS += --without-python --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)
 configure-python%: CONFIGURE_FLAGS += --with-python=/usr/bin/$*
 configure-udeb: CONFIGURE_FLAGS += --without-history --with-minimum --with-tree --with-output
 
@@ -45,7 +45,8 @@
 
 build-python%: BUILD_DIR=build/main/$*
 build-python%: BUILD_FLAGS = libxml2mod_la_LIBADD='$$(mylibs)'
-build-python%-dbg: BUILD_FLAGS += PYTHON_INCLUDES=/usr/include/$(*:-dbg=_d) LDFLAGS="-L$(CURDIR)/debian/tmp/usr/lib" CFLAGS="-Wall -g -O0"
+build-python%-dbg: BUILD_FLAGS += PYTHON_INCLUDES=/usr/include/$(*:-dbg=_d) \
+ LDFLAGS="-L$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)" CFLAGS="-Wall -g -O0"
 
 override_dh_auto_clean:
 	rm -rf build debian/tmp-dbg
@@ -102,7 +103,10 @@
 	dh_install -Npython-libxml2-dbg -Nlibxml2-udeb
 	dh_install -ppython-libxml2-dbg --sourcedir=debian/tmp-dbg
 	dh_install -plibxml2-udeb --sourcedir=debian/tmp-udeb
-	sed "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/libxml2.la > debian/libxml2-dev/usr/lib/libxml2.la
+	sed "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libxml2.la > \
+	 debian/libxml2-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libxml2.la
+	# for multiarch xml2-config needs to be identical on all archs
+	sed -i -e 's,/usr/lib/$(DEB_HOST_MULTIARCH),/usr/lib,' debian/libxml2-dev/usr/bin/xml2-config
 
 override_dh_strip:
 	dh_strip -a --dbg-package=libxml2-dbg -Npython-libxml2 -Npython-libxml2-dbg

Reply via email to