On Mon, Jan 21, 2008 at 05:06:09PM -0500, Joey Hess wrote:

> In #132989 I described four ways to fix that bug, and ended up using
> the first of them, since the maintainer made the mecessary changes to
> libxml-encoding-perl to allow it, and since that was more NMU-amenable
> solution to the bug than adding a bunch of uuencoded encoding files to
> libxml-parser-perl.
> 
> To avoid the build dependency loop, any of the other three solutions
> could be used. Note that #132989 includes an old patch implementing the
> fourth option, if you're looking for a quick fix. I'm not sure if that
> patch includes all the encoding files, so it might need to be updated.

Time is running out: libxml-parser-perl will be uninstallable and
unbuildable (taking along a bunch of other packages) in a week or so
unless this is fixed. See

 http://lists.debian.org/debian-perl/2008/02/msg00093.html

I came up with one more possible solution: as the encoding maps are
architecture independent, they could be split out into a separate package
so that libxml-encoding-perl isn't needed for binNMUs at all.

Proposed patch attached; this seems to work for me. It's not a solution
suitable for an NMU, so I would appreciate comments from the package
maintainers.

The patch puts the encodings in /usr/share/libxml-parser-perl and symlinks
/usr/share/perl5/XML/Parser/Encodings there. XML::Parser looks for the
encoding files in the whole @INC, so moving them from /usr/lib/perl5
isn't a problem.

Cheers,
-- 
Niko Tyni   [EMAIL PROTECTED]
diff -u libxml-parser-perl-2.36/debian/rules libxml-parser-perl-2.36/debian/rules
--- libxml-parser-perl-2.36/debian/rules
+++ libxml-parser-perl-2.36/debian/rules
@@ -38,12 +38,13 @@
 		dh_testroot
 		[ ! -f Makefile ] || $(MAKE) realclean
 		dh_clean README.Encodings build-stamp install-stamp \
+			build-encodings-stamp install-encodings-stamp \
+			README.Japanese_Encodings \
 			$(foreach encoding,$(ADDED_ENCODINGS),Parser/Encodings/$(encoding).enc)
 
 build:		build-stamp
 build-stamp:
 		dh_testdir
-		$(foreach encoding,$(ADDED_ENCODINGS),compile_encoding -o Parser/Encodings/$(encoding).enc /usr/share/libxml-encoding-perl/$(encoding).xml ;)
 		perl Makefile.PL INSTALLDIRS=vendor
 		$(MAKE) OPTIMIZE="$(CFLAGS)"
 		$(MAKE) test
@@ -56,27 +57,51 @@
 		dh_clean -k
 		dh_installdirs
 		$(MAKE) install DESTDIR=$(TMP_DIR) PREFIX=/usr
-		cp -a Parser/Encodings/README README.Encodings
 		touch install-stamp
 
-binary-indep:
+build-encodings: build-encodings-stamp
+build-encodings-stamp:
+		$(foreach encoding,$(ADDED_ENCODINGS),compile_encoding -o Parser/Encodings/$(encoding).enc /usr/share/libxml-encoding-perl/$(encoding).xml ;)
+		touch $@
+
+install-encodings: install-encodings-stamp
+install-encodings-stamp: build-encodings-stamp
+		install -d $(TMP_DIR)/usr/share/libxml-parser-perl
+		install -m 644 Parser/Encodings/*.enc $(TMP_DIR)/usr/share/libxml-parser-perl
+		cp -a Parser/Encodings/README README.Encodings
+		cp -a Parser/Encodings/Japanese_Encodings.msg README.Japanese_Encodings
+		touch $@
+
+binary-indep: build-encodings install-encodings
+		dh_testdir
+		dh_testroot
+		dh_install -i --sourcedir=$(TMP_DIR)
+		dh_installdocs -i
+		dh_installchangelogs -i
+		dh_compress -i
+		dh_fixperms -i
+		dh_installdeb -i
+		dh_gencontrol -i
+		dh_md5sums -i
+		dh_builddeb -i
 
 binary-arch:	build install
 		dh_testdir
 		dh_testroot
-		dh_install --sourcedir=$(TMP_DIR)
-		dh_installdocs
-		dh_installexamples
-		dh_installchangelogs Changes
-		dh_strip
-		dh_compress
-		dh_fixperms
-		dh_installdeb
-		dh_shlibdeps
-		dh_perl
-		dh_gencontrol
-		dh_md5sums
-		dh_builddeb
+		dh_install -a --sourcedir=$(TMP_DIR) -XXML/Parser/Encodings
+		dh_link usr/share/libxml-parser-perl usr/share/perl5/XML/Parser/Encodings
+		dh_installdocs -a
+		dh_installexamples -a
+		dh_installchangelogs -a Changes
+		dh_strip -a
+		dh_compress -a
+		dh_fixperms -a
+		dh_installdeb -a
+		dh_shlibdeps -a
+		dh_perl -a
+		dh_gencontrol -a
+		dh_md5sums -a
+		dh_builddeb -a
 
 binary:		binary-indep binary-arch
 
diff -u libxml-parser-perl-2.36/debian/control libxml-parser-perl-2.36/debian/control
--- libxml-parser-perl-2.36/debian/control
+++ libxml-parser-perl-2.36/debian/control
@@ -7,13 +7,15 @@
 Vcs-Browser: http://alioth.debian.org/plugins/scmcvs/cvsweb.php/packages/libxml-parser-perl/?cvsroot=debian-xml-sgml
 Vcs-Cvs: :pserver:[EMAIL PROTECTED]:/cvsroot/debian-xml-sgml/packages/libxml-parser-perl
 Standards-Version: 3.7.3
-Build-Depends: debhelper (>= 5.0), perl (>= 5.8.0-3), liburi-perl, libwww-perl, libexpat1-dev, libxml-encoding-perl (>= 1.01-9)
+Build-Depends: debhelper (>= 5.0), perl (>= 5.8.0-3), liburi-perl, libwww-perl, libexpat1-dev
+Build-Depends-Indep: libxml-encoding-perl (>= 1.01-9)
 
 Package: libxml-parser-perl
 Section: perl
 Priority: optional
 Architecture: any
-Depends: ${perl:Depends}, liburi-perl, libwww-perl, ${shlibs:Depends}
+Depends: ${perl:Depends}, liburi-perl, libwww-perl, ${shlibs:Depends},
+ libxml-parser-perl-encodings (= ${source:Version})
 Description: Perl module for parsing XML files
  This module provides ways to parse XML documents.  It is built on top
  of XML::Parser::Expat, which is a lower level interface to James
@@ -35,0 +38,9 @@
+
+Package: libxml-parser-perl-encodings
+Section: perl
+Priority: optional
+Architecture: all
+Description: collection of encoding maps for libxml-parser-perl
+ This module contains architecture independent binary encoding maps
+ for some selected encodings. They are automatically loaded by the
+ XML::Parser::Expat::load_encoding() function as needed.
diff -u libxml-parser-perl-2.36/debian/changelog libxml-parser-perl-2.36/debian/changelog
--- libxml-parser-perl-2.36/debian/changelog
+++ libxml-parser-perl-2.36/debian/changelog
@@ -1,3 +1,12 @@
+libxml-parser-perl (2.36-1.1) unstable; urgency=low
+
+  * Fake NMU.
+  * Split the encoding maps into a new architecture independent package
+    called libxml-parser-perl-encodings. This makes it possible to binNMU
+    libxml-parser-perl even when it's uninstallable. (Closes: #458144)
+
+ -- Niko Tyni <[EMAIL PROTECTED]>  Fri, 22 Feb 2008 20:50:14 +0200
+
 libxml-parser-perl (2.36-1) unstable; urgency=low
 
   * New upstream release
diff -u libxml-parser-perl-2.36/debian/libxml-parser-perl.docs libxml-parser-perl-2.36/debian/libxml-parser-perl.docs
--- libxml-parser-perl-2.36/debian/libxml-parser-perl.docs
+++ libxml-parser-perl-2.36/debian/libxml-parser-perl.docs
@@ -2 +1,0 @@
-README.Encodings
only in patch2:
unchanged:
--- libxml-parser-perl-2.36.orig/debian/libxml-parser-perl-encodings.docs
+++ libxml-parser-perl-2.36/debian/libxml-parser-perl-encodings.docs
@@ -0,0 +1,2 @@
+README.Encodings
+README.Japanese_Encodings
only in patch2:
unchanged:
--- libxml-parser-perl-2.36.orig/debian/libxml-parser-perl-encodings.install
+++ libxml-parser-perl-2.36/debian/libxml-parser-perl-encodings.install
@@ -0,0 +1 @@
+usr/share/libxml-parser-perl

Reply via email to