Package: libreadline5
Version: 5.1-7
Severity: wishlist
Tags: patch

Patch attached for 32-bit biarch support (lib32readline5 and 
lib32readline5-dev).

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-1-amd64-k8
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)

Versions of packages libreadline5 depends on:
ii  libc6                         2.3.6-15   GNU C Library: Shared libraries
ii  libncurses5                   5.5-2      Shared libraries for terminal hand
ii  readline-common               5.1-7      GNU readline and history libraries

libreadline5 recommends no packages.

-- no debconf information
diff -Nur readline5-5.1.old/debian/control readline5-5.1/debian/control
--- readline5-5.1.old/debian/control    2006-08-22 16:05:57.000000000 +0200
+++ readline5-5.1/debian/control        2006-08-22 16:17:05.000000000 +0200
@@ -3,7 +3,7 @@
 Priority: standard
 Maintainer: Matthias Klose <[EMAIL PROTECTED]>
 Standards-Version: 3.6.2
-Build-Depends: debhelper (>= 4.1), patch, libncurses5-dev, lib64ncurses5-dev 
[i386 powerpc sparc s390], mawk | awk, texinfo, autotools-dev, 
libc6-dev-sparc64 [sparc], libc6-dev-s390x [s390], libc6-dev-ppc64 [powerpc], 
libc6-dev-i386 [amd64 ppc64], libc6-dev-amd64 [i386], lib64gcc1 [i386 powerpc 
sparc s390], lib32gcc1 [amd64 ppc64]
+Build-Depends: debhelper (>= 4.1), patch, libncurses5-dev, lib32ncurses5-dev 
[amd64 ppc64], lib64ncurses5-dev [i386 powerpc sparc s390], mawk | awk, 
texinfo, autotools-dev, libc6-dev-sparc64 [sparc], libc6-dev-s390x [s390], 
libc6-dev-ppc64 [powerpc], libc6-dev-i386 [amd64 ppc64], libc6-dev-amd64 
[i386], lib64gcc1 [i386 powerpc sparc s390], lib32gcc1 [amd64 ppc64]
 
 Package: libreadline5
 Architecture: any
@@ -18,6 +18,19 @@
  The GNU history library provides a consistent user interface for
  recalling lines of previously typed input.
 
+Package: lib32readline5
+Architecture: amd64 ppc64
+Depends: readline-common, ${libxx:Depends}, ${shlibs:Depends}
+Section: libs
+Priority: optional
+Description: GNU readline and history libraries, run-time libraries (32-bit)
+ The GNU readline library aids in the consistency of user interface
+ across discrete programs that need to provide a command line
+ interface.
+ .
+ The GNU history library provides a consistent user interface for
+ recalling lines of previously typed input.
+
 Package: lib64readline5
 Architecture: i386 powerpc s390 sparc
 Depends: readline-common, ${libxx:Depends}, ${shlibs:Depends}
@@ -63,9 +76,25 @@
  .
  This package contains as well the readline documentation in info format.
 
+Package: lib32readline5-dev
+Architecture: amd64 ppc64
+Depends: lib32readline5 (= ${Source-Version}), libreadline5-dev, 
lib32ncurses5-dev, ${devxx:Depends}
+Provides: lib32readline-dev
+Conflicts: lib32readline-dev
+Replaces: libreadline5-dev (<< 4.1-6)
+Section: libdevel
+Priority: optional
+Description: GNU readline and history libraries, development files (32-bit)
+ The GNU readline library aids in the consistency of user interface
+ across discrete programs that need to provide a command line
+ interface.
+ .
+ The GNU history library provides a consistent user interface for
+ recalling lines of previously typed input.
+
 Package: lib64readline5-dev
 Architecture: i386 powerpc s390 sparc
-Depends: lib64readline5 (= ${Source-Version}), lib64ncurses5-dev, 
${devxx:Depends}
+Depends: lib64readline5 (= ${Source-Version}), libreadline5-dev, 
lib64ncurses5-dev, ${devxx:Depends}
 Provides: lib64readline-dev
 Conflicts: lib64readline-dev
 Replaces: libreadline5-dev (<< 4.1-6)
diff -Nur readline5-5.1.old/debian/control32 readline5-5.1/debian/control32
--- readline5-5.1.old/debian/control32  2006-08-22 16:05:57.000000000 +0200
+++ readline5-5.1/debian/control32      1970-01-01 01:00:00.000000000 +0100
@@ -1,29 +0,0 @@
-
-Package: lib32readline5
-Architecture: amd64 ppc64
-Depends: readline-common, ${libxx:Depends}, ${shlibs:Depends}
-Section: libs
-Priority: optional
-Description: GNU readline and history libraries, run-time libraries (32-bit)
- The GNU readline library aids in the consistency of user interface
- across discrete programs that need to provide a command line
- interface.
- .
- The GNU history library provides a consistent user interface for
- recalling lines of previously typed input.
-
-Package: lib32readline5-dev
-Architecture: i386 powerpc s390 sparc
-Depends: lib32readline5 (= ${Source-Version}), lib32ncurses5-dev, 
${devxx:Depends}
-Provides: lib32readline-dev
-Conflicts: lib32readline-dev
-Section: libdevel
-Priority: optional
-Description: GNU readline and history libraries, development files (32-bit)
- The GNU readline library aids in the consistency of user interface
- across discrete programs that need to provide a command line
- interface.
- .
- The GNU history library provides a consistent user interface for
- recalling lines of previously typed input.
-
diff -Nur readline5-5.1.old/debian/rules readline5-5.1/debian/rules
--- readline5-5.1.old/debian/rules      2006-08-22 16:05:57.000000000 +0200
+++ readline5-5.1/debian/rules  2006-08-22 16:24:45.000000000 +0200
@@ -33,6 +33,22 @@
   endif
 endif
 
+ifneq (,$(findstring /$(DEB_HOST_ARCH)/,/amd64/ppc64/))
+  build32 = yes
+  CC32 = gcc -m32
+  gencontrol_flags = -- \
+       '-Vlibxx:Depends=libc6-$(ARCH32)' \
+       '-Vdevxx:Depends=libc6-dev-$(ARCH32)'
+  ifeq ($(DEB_HOST_ARCH),amd64)
+    ARCH32 = i386
+    HOST32 = i686-linux-gnu
+  endif
+  ifeq ($(DEB_HOST_ARCH),ppc64)
+    ARCH32 = powerpc
+    HOST32 = powerpc-linux-gnu
+  endif
+endif
+
 ifeq ($(DEB_HOST_ARCH_OS),netbsd)
   CC_LINK_FLAGS =
 else
@@ -44,20 +60,25 @@
 
 PWD    := $(shell pwd)
 p_rl   = libreadline$(soversion)
+p_rl32 = lib32readline$(soversion)
 p_rl64 = lib64readline$(soversion)
 p_comm = readline-common
 p_rld  = $(p_rl)-dev
+p_rld32        = $(p_rl32)-dev
 p_rld64        = $(p_rl64)-dev
 p_rlg  = $(p_rl)-dbg
 p_doc  = $(p_rl)-doc
 p_rlfe = rlfe
 
 d      = debian/tmp
+d32    = debian/tmp32
 d64    = debian/tmp64
 d_rl   = debian/$(p_rl)
+d_rl32 = debian/$(p_rl32)
 d_rl64 = debian/$(p_rl64)
 d_comm = debian/$(p_comm)
 d_rld  = debian/$(p_rld)
+d_rld32        = debian/$(p_rld32)
 d_rld64        = debian/$(p_rld64)
 d_rlg  = debian/$(p_rlg)
 d_doc  = debian/$(p_doc)
@@ -65,6 +86,7 @@
 
 srcdir         = $(PWD)
 builddir       = $(PWD)/build
+builddir32     = $(PWD)/build32
 builddir64     = $(PWD)/build64
 
 default: build
@@ -80,6 +102,14 @@
          CC=$(CC) $(srcdir)/configure \
                --with-curses --prefix=/usr
 
+ifneq ($(build32),)
+       rm -rf $(builddir32)
+       mkdir $(builddir32)
+       cd $(builddir32) && \
+         CC="$(CC32)" $(srcdir)/configure \
+               --host=$(HOST32) --with-curses --prefix=/usr
+endif
+
 ifneq ($(build64),)
        rm -rf $(builddir64)
        mkdir $(builddir64)
@@ -99,6 +129,15 @@
            SHOBJ_CFLAGS="-fPIC -D_REENTRANT" \
            SHLIB_LIBS="-lncurses"
 
+ifneq ($(build32),)
+       $(MAKE) -C $(builddir32) \
+           CC="$(CC32)" \
+           CFLAGS="-g -O2" \
+           SHOBJ_CFLAGS="-fPIC -D_REENTRANT" \
+           SHOBJ_LDFLAGS='-shared' \
+           SHLIB_XLDFLAGS='$(CC_LINK_FLAGS)-soname,`echo $$@ | sed 
s/\\..$$$$//`'
+endif
+
 ifneq ($(build64),)
        $(MAKE) -C $(builddir64) \
            CC="$(CC64)" \
@@ -133,6 +172,9 @@
        rm -f configure*-stamp build*-stamp install-stamp
        rm -rf autom4te.cache
        rm -rf $(builddir)
+ifneq ($(build32),)
+       rm -rf $(builddir32) $(d32)
+endif
 ifneq ($(build64),)
        rm -rf $(builddir64) $(d64)
 endif
@@ -227,6 +269,40 @@
        cp -p $(builddir)/examples/rlfe/rlfe $(d_rlfe)/usr/bin/.
        cp -p debian/rlfe.1 $(d_rlfe)/usr/share/man/man1/.
 
+ifneq ($(build32),)
+       rm -rf $(d32)
+       mkdir -p $(d32)/usr/bin
+       $(MAKE) -C $(builddir32) install \
+           CC="$(CC32)" \
+           CFLAGS="-g -O2 -D_REENTRANT" \
+           SHOBJ_LDFLAGS='-shared' \
+           SHLIB_XLDFLAGS='$(CC_LINK_FLAGS)-soname,`echo $$@ | sed 
s/\\..$$$$//`' \
+           SHLIB_LIBS=-lncurses \
+           DESTDIR=$(PWD)/$(d32) \
+           mandir=/usr/share/man \
+           infodir=/usr/share/info
+
+       dh_installdirs -p$(p_rl32) \
+           lib32 \
+           usr/share/doc
+       dh_installdirs -p$(p_rld32) \
+           usr/share/doc
+       cp -p $(d32)/usr/lib/lib{history,readline}.so.$(libversion) \
+               $(d_rl32)/lib32/
+       ln -s libhistory.so.$(libversion) \
+               $(d_rl32)/lib32/libhistory.so.$(soversion)
+       ln -s libreadline.so.$(libversion) \
+               $(d_rl32)/lib32/libreadline.so.$(soversion)
+
+       dh_installdirs -p$(p_rld32) \
+           usr/lib32 \
+           usr/share/doc
+       ln -s /lib32/libhistory.so.$(soversion) \
+               $(d_rld32)/usr/lib32/libhistory.so
+       ln -s /lib32/libreadline.so.$(soversion) \
+               $(d_rld32)/usr/lib32/libreadline.so
+       mv $(d32)/usr/lib/lib{history,readline}.a $(d_rld32)/usr/lib32/.
+endif
 ifneq ($(build64),)
        rm -rf $(d64)
        mkdir -p $(d64)/usr/bin
@@ -305,6 +381,19 @@
        dh_shlibdeps -p$(p_rl) -p$(p_rld) -p$(p_rlg) -p$(p_rlfe) \
                 -L $(p_rl) -l $(d_rl)/lib
 
+ifneq ($(build32),)
+       -ls -l $(d_rld)/usr/share/doc/$(p_rl)
+       dh_installdocs -p$(p_rl32) \
+               USAGE debian/inputrc.arrows
+       dh_installchangelogs -p$(p_rl32) CHANGES
+       ln -sf $(p_rl32) $(d_rld32)/usr/share/doc/$(p_rld32)
+       dh_compress -p$(p_rl32) -p$(p_rld32)
+       dh_makeshlibs -p$(p_rl32) -V '$(p_rl32) (>= 5.1)'
+       -dh_shlibdeps -p$(p_rl32) -p$(p_rld32) \
+                -L $(p_rl32) -l $(d_rl32)/lib
+       -ls -l $(d_rld)/usr/share/doc/$(p_rl)
+endif
+
 ifneq ($(build64),)
        -ls -l $(d_rld)/usr/share/doc/$(p_rl)
        dh_installdocs -p$(p_rl64) \

Reply via email to