+++ Colin Watson [2012-11-21 12:57 +0000]: > On Sun, Nov 18, 2012 at 03:08:35AM +0000, Wookey wrote: > > OK. As I was getting very bored of marking Build-deps 'gettext:any' in > > Ubuntu (and they'd all have to be changed back eventually anyway), > > I've done the work to extend PJs patch to split into two libraries. > > Not yet very carefully checked or tested, but it looks OK. > > > +Package: libgettextpo-dev > > +Section: libdevel > > +Architecture: any > > +Multi-Arch: same > > +Depends: libgettextpo0 (= ${binary:Version}) > > +Suggests: gettext-doc > > +Description: GNU Internationalization library development files > > + This package contains development files for the libgettextpo library. > > This needs "Replaces: gettext (<< 0.18.1.1-10)", as it includes files > previously in gettext.
good point. > > +Package: libasprintf-dev > > +Section: libdevel > > +Architecture: any > > +Multi-Arch: same > > +Depends: libasprintf0c2 (= ${binary:Version}) > > +Suggests: gettext-doc > > +Description: GNU Internationalization library development files > > + This package contains development files for the libasprintf library. > > Ditto. Also, this needs the same "Depends: dpkg (>= 1.15.4) | > install-info" as gettext, since one of the info files now lives in > libasprintf-dev. Ah yes. Thought I checked that, but clearly not. > Also, the file lists of libgettextpo-dev and libasprintf-dev both look > rather wrong. Both of them contain both /usr/include/gettext-po.h and > /usr/include/autosprintf.h, but they ought to have one of those each. > libgettextpo-dev contains lots of stuff in /usr/share/gettext/, while > libasprintf-dev contains lots of stuff in /usr/share/aclocal/, and > neither looks right - surely these directories still belong in the > gettext package? This patch was 90% guesswork as I don't know what _any_ of the files/binaries in gettext actually do which greatly limited how much expertise I could apply to the problem. All that seems reasonable to me, but then almost anything would. Which package should /usr/share/gettext/intl live in? They looked like headers so I put them in the -dev package. But there is .c in there too. OK some reading online says that these are stuff done by gettextize and do not seem arch-dependent so should indeed be in gettext main package. Like I say, having no idea how this package works, or what the parts do, limits my ability to make intelligent choices. Santiago? Is this right? Tell me what should go where and I'll send the patches. Cheers for checking my shoddy work - I was hoping that sending in a patch would prompt someone to comment on how broken it was :-) Here's an update with all that fixed. I'm about to try it and see if it works Wookey -- Principal hats: Linaro, Emdebian, Wookware, Balloonboard, ARM http://wookware.org/
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 10:08:07.000000000 +0000 +++ gettext-0.18.1.1/debian/changelog 2012-11-18 03:10:37.000000000 +0000 @@ -1,3 +1,11 @@ +gettext (0.18.1.1-9multiarch1) unstable; 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 10:00:00.000000000 +0000 +++ gettext-0.18.1.1/debian/control 2012-11-21 15:16:46.000000000 +0000 @@ -17,7 +17,8 @@ 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 Recommends: curl | wget | lynx-cur, autopoint Breaks: autopoint (<= 0.17-11) Suggests: gettext-doc @@ -81,3 +82,23 @@ 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 +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 +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 14:45:44.000000000 +0000 +++ gettext-0.18.1.1/debian/gettext.lintian-overrides 2012-11-15 17:27:18.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 \ No newline at end of file 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 00:00:00.000000000 +0000 +++ gettext-0.18.1.1/debian/patches/eglibc-21.6-ftbfs-nogets 2012-11-15 19:14:59.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 10:00:56.000000000 +0000 +++ gettext-0.18.1.1/debian/patches/series 2012-11-15 18:46:24.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 10:07:34.000000000 +0000 +++ gettext-0.18.1.1/debian/rules 2012-11-21 15:20:55.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,10 +138,14 @@ 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 + rm -f debian/$@/usr/lib/libgettextsrc.so + rm -f debian/$@/usr/lib/libgettextlib.so cp -a debian/tmp/usr/share/info debian/$@/usr/share - cp -a debian/tmp/usr/share/aclocal debian/$@/usr/share + rm -f debian/$@/usr/share/info/autosprintf.info cp -a debian/tmp/usr/share/gettext debian/$@/usr/share + rm -rf debian/$@/usr/share/gettext/intl + rm -f debian/$@/usr/share/gettext/config.rpath + rm -f debian/$@/usr/share/gettext/gettext.h rm -f debian/$@/usr/share/gettext/libintl.jar ifeq (,$(findstring %$(DEB_HOST_ARCH)%,$(NOJAVA_ARCHS))) mv debian/$@/usr/share/gettext/gettext.jar debian/$@/usr/share/java @@ -149,18 +155,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 +220,52 @@ 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) + cp -a debian/tmp/usr/include/gettext-po.h debian/$@/usr/include + install -d debian/$@/usr/share/gettext + cp -a debian/tmp/usr/share/gettext/intl debian/$@/usr/share/gettext + cp -a debian/tmp/usr/share/gettext/config.rpath debian/$@/usr/share/gettext + cp -a debian/tmp/usr/share/gettext/gettext.h debian/$@/usr/share/gettext + $(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) + 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 +345,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