On Wed, Nov 21, 2012 at 09:15:51PM +0100, Santiago Vila wrote:
> El 21/11/12 18:31, Colin Watson escribió:
> >I would say that only things tightly associated with libasprintf and
> >libgettextpo - so autosprintf.h / gettext-po.h respectively plus the
> >corresponding .a/.so - should go in the -dev package.
> >
> >Everything else (and in particular everything under /usr/share/aclocal/
> >and /usr/share/gettext/) should stay exactly where it is, in the main
> >gettext package; it's generally only intended for being copied into
> >people's source packages by various tools.
> 
> Yes, that's what I believe as well.

Wookey sent me a new version of his patch earlier today, and I tweaked
it some more; I put /usr/share/aclocal/ back, as well as
libgettextsrc.so and libgettextlib.so.  I restored the version to
0.18.1.1-10 so that it matches the Breaks/Replaces.

It also occurred to me that gettext should depend on libasprintf-dev and
libgettextpo-dev, otherwise anything that Build-Depends on gettext
expecting to be able to use one of those libraries will immediately
FTBFS.  Perhaps it will be possible to get rid of this dependency later
after a migration period, as in some ways it's a bit odd for gettext to
suck in development libraries.

I dropped the Provides in gettext as they clearly no longer belong
there.

I've confirmed that these -dev packages are multiarch-coinstallable,
which is good.  There is one remaining niggle here: while
/usr/share/info/autosprintf.info.gz is currently identical across
architectures, it starts with a line containing "produced by makeinfo
version 4.13".  That means that if gettext ever happens to be built when
texinfo is at different upstream versions on different architectures,
the results will not be multiarch-coinstallable.  I think this is a bit
of a timebomb and we should avoid it.  Perhaps it would make sense to
leave that info documentation in the gettext package, and add a
"Suggests: gettext" in libasprintf-dev?  (We could move it to
gettext-doc instead, but that seems like fairly pointless
deckchair-rearrangement to me.)

I'd like to get this into Ubuntu as soon as possible to replace our
current "Multi-Arch: allowed" hack in sufficient time to undo all the
build-dependencies we've accumulated on "gettext:any".  Do you think it
might be possible to have this patch applied in experimental, or should
we apply it ourselves once we've agreed on package names and contents?

Thanks,

-- 
Colin Watson                                       [cjwat...@ubuntu.com]
diff -Nru gettext-0.18.1.1/debian/changelog gettext-0.18.1.1/debian/changelog
--- gettext-0.18.1.1/debian/changelog	2012-06-07 11:08:07.000000000 +0100
+++ gettext-0.18.1.1/debian/changelog	2012-11-22 17:58:40.000000000 +0000
@@ -1,3 +1,11 @@
+gettext (0.18.1.1-10) UNRELEASED; urgency=low
+
+  * Split out libgettextpo-dev and libasprintf-dev for multiarch
+    dependencies. Thanks to P.J McDermott for core patch. (Closes: #683751)
+  * Fix FTBFS on eglibc-2.16 (due to gets removal/outdated gnulib)
+
+ -- Wookey <woo...@wookware.org>  Thu, 15 Nov 2012 17:04:09 +0000
+
 gettext (0.18.1.1-9) unstable; urgency=low
 
   * Build with hardened build flags.
diff -Nru gettext-0.18.1.1/debian/control gettext-0.18.1.1/debian/control
--- gettext-0.18.1.1/debian/control	2012-06-07 11:00:00.000000000 +0100
+++ gettext-0.18.1.1/debian/control	2012-11-23 02:01:18.000000000 +0000
@@ -17,11 +17,11 @@
 
 Package: gettext
 Architecture: any
-Depends: ${shlibs:Depends}, libgettextpo0 (= ${binary:Version}), libasprintf0c2 (= ${binary:Version}), gettext-base, dpkg (>= 1.15.4) | install-info
+Multi-Arch: foreign
+Depends: ${shlibs:Depends}, gettext-base, dpkg (>= 1.15.4) | install-info, libasprintf-dev, libgettextpo-dev
 Recommends: curl | wget | lynx-cur, autopoint
 Breaks: autopoint (<= 0.17-11)
 Suggests: gettext-doc
-Provides: libasprintf-dev, libgettextpo-dev
 Description: GNU Internationalization utilities
  Interesting for authors or maintainers of other packages or programs
  which they want to see internationalized.
@@ -81,3 +81,25 @@
  This package contains the libasprintf shared library which makes the
  C formatted output routines (fprintf et al.) usable in C++ programs,
  for use with the <string> strings and the <iostream> streams.
+
+Package: libgettextpo-dev
+Section: libdevel
+Architecture: any
+Multi-Arch: same
+Depends: libgettextpo0 (= ${binary:Version})
+Suggests: gettext-doc
+Breaks: gettext (<< 0.18.1.1-10)
+Replaces: gettext (<< 0.18.1.1-10)
+Description: GNU Internationalization library development files
+ This package contains development files for the libgettextpo library.
+ 
+Package: libasprintf-dev
+Section: libdevel
+Architecture: any
+Multi-Arch: same
+Depends: libasprintf0c2 (= ${binary:Version}), dpkg (>= 1.15.4) | install-info
+Suggests: gettext-doc
+Breaks: gettext (<< 0.18.1.1-10)
+Replaces: gettext (<< 0.18.1.1-10)
+Description: GNU Internationalization library development files
+ This package contains development files for the libasprintf library.
diff -Nru gettext-0.18.1.1/debian/gettext.lintian-overrides gettext-0.18.1.1/debian/gettext.lintian-overrides
--- gettext-0.18.1.1/debian/gettext.lintian-overrides	2012-04-28 15:45:44.000000000 +0100
+++ gettext-0.18.1.1/debian/gettext.lintian-overrides	2012-11-23 02:08:05.000000000 +0000
@@ -5,10 +5,6 @@
 gettext: ldconfig-symlink-missing-for-shlib usr/lib/libgnuintl.so.8 usr/lib/preloadable_libintl.so libgnuintl.so.8
 gettext: shlib-missing-in-control-file libgnuintl 8 for usr/lib/preloadable_libintl.so
 #
-# gettext Provides libgettextpo-dev, so yes, it is a dev-pkg.
-#
-gettext: non-dev-pkg-with-shlib-symlink usr/lib/libgettextpo.so.0.5.1 usr/lib/libgettextpo.so
-#
 # These libraries are for internal use only and should not be used by
 # other programs.
 #
@@ -21,3 +17,4 @@
 gettext: no-shlibs-control-file usr/lib/preloadable_libintl.so
 gettext: no-shlibs-control-file usr/lib/libgettextsrc-0.18.1.so
 gettext: no-shlibs-control-file usr/lib/libgettextlib-0.18.1.so
+gettext: shlib-in-multi-arch-foreign-package usr/lib/preloadable_libintl.so
diff -Nru gettext-0.18.1.1/debian/patches/eglibc-21.6-ftbfs-nogets gettext-0.18.1.1/debian/patches/eglibc-21.6-ftbfs-nogets
--- gettext-0.18.1.1/debian/patches/eglibc-21.6-ftbfs-nogets	1970-01-01 01:00:00.000000000 +0100
+++ gettext-0.18.1.1/debian/patches/eglibc-21.6-ftbfs-nogets	2012-11-22 17:57:17.000000000 +0000
@@ -0,0 +1,71 @@
+Description:  Allow package to build with glibc-2.16
+ 'gets' has been removed from glibc-2.16 but gnulib still refers to it
+ causing build failures.
+ The simple fix for now is just to put a check around the reference in
+ lib/stdio.in.h
+ A new release made with a new gnulib is a better fix.
+ .
+ gettext (0.18.1.1-10) precise; urgency=low
+ .
+   * Fix FTBFS on eglibc-2.16 (due to gets removal/outdated gnulib)
+Author: Wookey <woo...@wookware.org>
+Last-Update: 2012-11-5
+Bug : http://lists.gnu.org/archive/html/bug-gnulib/2012-03/msg00186.html
+Bug-Debian: http://bugs.debian.org/687986
+Forwarded: no
+
+Index: gettext-0.18.1.1/gettext-tools/gnulib-lib/stdio.in.h
+===================================================================
+--- gettext-0.18.1.1.orig/gettext-tools/gnulib-lib/stdio.in.h	2012-11-15 18:46:24.000000000 +0000
++++ gettext-0.18.1.1/gettext-tools/gnulib-lib/stdio.in.h	2012-11-15 19:14:37.000000000 +0000
+@@ -138,10 +138,12 @@
+ #endif
+ 
+ /* It is very rare that the developer ever has full control of stdin,
+-   so any use of gets warrants an unconditional warning.  Assume it is
+-   always declared, since it is required by C89.  */
++   so any use of gets warrants an unconditional warning.  */
+ #undef gets
++#ifdef HAVE_RAW_DECL_GETS
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
++#endif
++#undef gets
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
+Index: gettext-0.18.1.1/gettext-runtime/gnulib-lib/stdio.in.h
+===================================================================
+--- gettext-0.18.1.1.orig/gettext-runtime/gnulib-lib/stdio.in.h	2010-05-17 19:56:12.000000000 +0000
++++ gettext-0.18.1.1/gettext-runtime/gnulib-lib/stdio.in.h	2012-11-15 19:11:15.000000000 +0000
+@@ -138,10 +138,11 @@
+ #endif
+ 
+ /* It is very rare that the developer ever has full control of stdin,
+-   so any use of gets warrants an unconditional warning.  Assume it is
+-   always declared, since it is required by C89.  */
++   so any use of gets warrants an unconditional warning. */
+ #undef gets
++#ifdef HAVE_RAW_DECL_GETS
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
++#endif
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
+Index: gettext-0.18.1.1/gettext-tools/libgettextpo/stdio.in.h
+===================================================================
+--- gettext-0.18.1.1.orig/gettext-tools/libgettextpo/stdio.in.h	2010-05-17 19:58:03.000000000 +0000
++++ gettext-0.18.1.1/gettext-tools/libgettextpo/stdio.in.h	2012-11-15 19:11:53.000000000 +0000
+@@ -138,10 +138,11 @@
+ #endif
+ 
+ /* It is very rare that the developer ever has full control of stdin,
+-   so any use of gets warrants an unconditional warning.  Assume it is
+-   always declared, since it is required by C89.  */
++   so any use of gets warrants an unconditional warning.  */
+ #undef gets
++#ifdef HAVE_RAW_DECL_GETS
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
++#endif
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
diff -Nru gettext-0.18.1.1/debian/patches/series gettext-0.18.1.1/debian/patches/series
--- gettext-0.18.1.1/debian/patches/series	2012-05-16 11:00:56.000000000 +0100
+++ gettext-0.18.1.1/debian/patches/series	2012-11-22 17:57:17.000000000 +0000
@@ -5,3 +5,4 @@
 05-quotes-around-pwd-in-project-id
 06-msgfmt-default-little-endian
 99-config-guess-config-sub
+eglibc-21.6-ftbfs-nogets
diff -Nru gettext-0.18.1.1/debian/rules gettext-0.18.1.1/debian/rules
--- gettext-0.18.1.1/debian/rules	2012-06-07 11:07:34.000000000 +0100
+++ gettext-0.18.1.1/debian/rules	2012-11-23 02:12:25.000000000 +0000
@@ -56,13 +56,15 @@
 	rm -f `find . -name "*~"`
 	rm -rf debian/tmp debian/files* core debian/substvars debian/a.out
 	cd debian && rm -rf gettext-base gettext gettext-el gettext-doc \
-		autopoint libgettextpo0 libasprintf0c2
+		autopoint libgettextpo0 libasprintf0c2 libgettextpo-dev libasprintf-dev
 
 binary-arch: build
 	debian/rules gettext-base
 	debian/rules gettext
 	debian/rules libgettextpo0
 	debian/rules libasprintf0c2
+	debian/rules libgettextpo-dev
+	debian/rules libasprintf-dev
 
 binary-indep: build
 	debian/rules gettext-el
@@ -136,8 +138,8 @@
 	cd debian/$@/usr/share/doc/$@ && gzip -9n changelog changelog.Debian
 	cp -a debian/tmp/usr/bin debian/$@/usr
 	cp -a debian/tmp/usr/lib debian/$@/usr
-	cp -a debian/tmp/usr/include debian/$@/usr
 	cp -a debian/tmp/usr/share/info debian/$@/usr/share
+	rm -f debian/$@/usr/share/info/autosprintf.info
 	cp -a debian/tmp/usr/share/aclocal debian/$@/usr/share
 	cp -a debian/tmp/usr/share/gettext debian/$@/usr/share
 	rm -f debian/$@/usr/share/gettext/libintl.jar
@@ -149,18 +151,13 @@
 	cp -a debian/tmp/usr/share/locale debian/$@/usr/share
 	find debian/$@/usr/share/locale | grep gettext-runtime | xargs rm
 	cd debian/$@/usr/bin && rm -f gettext ngettext envsubst gettext.sh
-	cd debian/$@/usr/lib && rm -f libasprintf.so.* libgettextpo.so.* *.la
-	install -d debian/$@/usr/lib/$(DEB_HOST_MULTIARCH)
-	cd debian/$@/usr/lib && mv libgettextpo.so $(DEB_HOST_MULTIARCH)
-	cd debian/$@/usr/lib && mv libasprintf.so $(DEB_HOST_MULTIARCH)
+	cd debian/$@/usr/lib && rm -f libasprintf* libgettextpo* *.la
 	cd debian/$@/usr/share/man/man1 && \
 		rm -f gettext.1 ngettext.1 envsubst.1
 	cd debian/$@/usr/lib && chmod 644 libgettextlib* libgettextsrc*
 	$(STRIP) debian/$@/usr/lib/preloadable_libintl.so
 	$(STRIP) debian/$@/usr/lib/libgettextlib*.so
 	$(STRIP) debian/$@/usr/lib/libgettextsrc*.so
-	$(ATRIP) debian/$@/usr/lib/libasprintf.a
-	$(ATRIP) debian/$@/usr/lib/libgettextpo.a
 	rm -f debian/$@/usr/bin/autopoint
 	rm -f debian/$@/usr/share/man/man1/autopoint.1
 	rm -f debian/$@/usr/share/gettext/archive.git.tar.gz
@@ -219,6 +216,49 @@
 	chmod -R u+w,go=rX debian/$@
 	dpkg --build debian/$@ ..
 
+libgettextpo-dev: build
+	rm -rf debian/$@
+	install -d debian/$@/DEBIAN debian/$@/usr/share/doc/$@
+	cp -p debian/copyright debian/$@/usr/share/doc/$@
+	cp -p ChangeLog debian/$@/usr/share/doc/$@/changelog
+	cp -p debian/changelog debian/$@/usr/share/doc/$@/changelog.Debian
+	cd debian/$@/usr/share/doc/$@ && gzip -9n changelog changelog.Debian
+	install -d debian/$@/usr/lib/$(DEB_HOST_MULTIARCH)
+	cp -a debian/tmp/usr/lib/libgettextpo.a debian/$@/usr/lib/$(DEB_HOST_MULTIARCH)
+	cp -a debian/tmp/usr/lib/libgettextpo.so debian/$@/usr/lib/$(DEB_HOST_MULTIARCH)
+	install -d debian/$@/usr/include
+	cp -a debian/tmp/usr/include/gettext-po.h debian/$@/usr/include/
+	$(ATRIP) debian/$@/usr/lib/$(DEB_HOST_MULTIARCH)/libgettextpo.a
+	dpkg-gencontrol -p$@ -Pdebian/$@
+	cd debian/$@ && \
+		md5sum `find * -type f ! -regex "DEBIAN/.*"` > DEBIAN/md5sums
+	chown -R 0:0 debian/$@
+	chmod -R u+w,go=rX debian/$@
+	dpkg --build debian/$@ ..
+
+libasprintf-dev: build
+	rm -rf debian/$@
+	install -d debian/$@/DEBIAN debian/$@/usr/share/doc/$@
+	cp -p debian/copyright debian/$@/usr/share/doc/$@
+	cp -p ChangeLog debian/$@/usr/share/doc/$@/changelog
+	cp -p debian/changelog debian/$@/usr/share/doc/$@/changelog.Debian
+	cd debian/$@/usr/share/doc/$@ && gzip -9n changelog changelog.Debian
+	install -d debian/$@/usr/lib/$(DEB_HOST_MULTIARCH)
+	cp -a debian/tmp/usr/lib/libasprintf.a debian/$@/usr/lib/$(DEB_HOST_MULTIARCH)
+	cp -a debian/tmp/usr/lib/libasprintf.so debian/$@/usr/lib/$(DEB_HOST_MULTIARCH)
+	install -d debian/$@/usr/include
+	cp -a debian/tmp/usr/include/autosprintf.h debian/$@/usr/include/
+	install -d debian/$@/usr/share/info
+	cp -a debian/tmp/usr/share/info/autosprintf.info debian/$@/usr/share/info
+	$(ATRIP) debian/$@/usr/lib/$(DEB_HOST_MULTIARCH)/libasprintf.a
+	gzip -9n debian/$@/usr/share/info/*
+	dpkg-gencontrol -p$@ -Pdebian/$@
+	cd debian/$@ && \
+		md5sum `find * -type f ! -regex "DEBIAN/.*"` > DEBIAN/md5sums
+	chown -R 0:0 debian/$@
+	chmod -R u+w,go=rX debian/$@
+	dpkg --build debian/$@ ..
+
 gettext-el: build
 	rm -rf debian/$@
 	install -d debian/$@/DEBIAN debian/$@/usr/share/doc/$@
@@ -298,4 +338,4 @@
 build-indep: build
 
 .PHONY: binary binary-arch binary-indep build-arch build-indep clean
-.PHONY: gettext-base gettext gettext-el gettext-doc autopoint libgettextpo0 libasprintf0c2
+.PHONY: gettext-base gettext gettext-el gettext-doc autopoint libgettextpo0 libasprintf0c2 libgettextpo-dev libasprintf-dev

Reply via email to