Package: debirf
Version: 0.34
Severity: normal
Tags: patch

Dear Maintainer,

debirf may fail to configure and run man-db under some circumstances.

The symptoms : in a somewhat outdated jessie chroot

$ dpkg -l man-db
[ ... ]
ii  man-db         2.6.6-1      amd64        on-line manual pager

$ debirf make minimal
[ ... ]
$ echo $?
0
$ debirf enter minimal/
# apt-get update
# apt-get install man-db
[ ... ]
Selecting previously unselected package man-db.
Preparing to unpack .../man-db_2.6.7.1-1_amd64.deb ...
Unpacking man-db (2.6.7.1-1) ...
# echo $?
0
# apt-get install bc
[ ... ]
Processing triggers for man-db (2.6.7.1-1) ...
/usr/bin/mandb: error while loading shared libraries: libmandb-2.6.7.1.so: 
cannot open shared object file: No such file or directory

(there is no message that a configuration of man-db occurred)

The same symptoms occur if the architectures don't match - say,
we are building an i386 target on an amd64 machine.

There is no such problem as real root (and real chroot).

The cause : the versions of man-db on the build host and in the debirf 
(fake-)chroot don't match. 
/usr/bin/mandb finds its library /usr/lib/man-db/libmandb-2.6.7.1.so
 through a DT_RUNPATH tag :

$ readelf --dynamic /usr/bin/mandb
[ ... ]
0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib/man-db]

Fakechroot adds ${DEBIRF_ROOT}/usr/lib/ to LD_LIBRARY_PATH, not
${DEBIRF_ROOT}/usr/lib/man-db. As a result, /usr/lib/man-db/libmandb-2.6.7.1.so 
on 
the build host is used - not the right one !

A possible workaround : we may override the DT_RUNPATH tag with 
LD_LIBRARY_PATH (see the following patch as an example)
Then 
$ debirf enter minimal/
# apt-get update
# apt-get install man-db
[ ... ]
Setting up man-db (2.6.7.1-1) ...
Building database of manual pages ...


Regards,
JH Chatenet

diff -Naur a/usr/share/debirf/common b/usr/share/debirf/common
--- a/usr/share/debirf/common   2014-07-09 22:28:14.000000000 +0200
+++ b/usr/share/debirf/common   2014-07-15 20:08:46.000000000 +0200
@@ -55,6 +55,7 @@
     if [ "$ROOT_BUILD" = 'true' ] ; then
        TMPDIR= chroot "$DEBIRF_ROOT" "$@"
     else
+       
LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${DEBIRF_ROOT}/usr/lib/man-db"
        TMPDIR= fakechroot chroot "$DEBIRF_ROOT" "$@"
     fi
 }





-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages debirf depends on:
ii  apt          1.0.9.1
ii  cpio         2.11+dfsg-2
ii  debootstrap  1.0.62
ii  fakechroot   2.17.2-1
ii  fakeroot     1.20.1-1.1
ii  klibc-utils  2.0.4-1

Versions of packages debirf recommends:
ii  grub-common  2.00-22
ii  lsb-release  4.1+Debian13
ii  xorriso      1.3.2-1.1

debirf suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to