diff options
author | joey <joey> | 1999-09-11 20:26:37 +0000 |
---|---|---|
committer | joey <joey> | 1999-09-11 20:26:37 +0000 |
commit | ea9cd2904a9d7a1c677c2f37486750c803f0e16c (patch) | |
tree | 99e2d35443492d4928aed260a09c459238d6cd91 /dh_makeshlibs | |
parent | 9d3fce399b4344e7a0453abcc90c1bf74bd6d10d (diff) |
r273: * dh_installdocs.1: clarified how the doc-id is determined. Closes: #44864
* dh_makeshlibs: will now overwrite existing debian/tmp/DEBIAN/shlibs
files, instead of erroring out. (Closes: #44828)
Diffstat (limited to 'dh_makeshlibs')
-rwxr-xr-x | dh_makeshlibs | 63 |
1 files changed, 40 insertions, 23 deletions
diff --git a/dh_makeshlibs b/dh_makeshlibs index a09e26f6..c3742267 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -1,30 +1,47 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Automatically generate shlibs files. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/share/debhelper" } +use Dh_Lib; +init(); -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); - if [ -e "debian/$TMP/DEBIAN/shlibs" ]; then - error "debian/$TMP/DEBIAN/shlibs already exists." - fi + doit("rm", "-f", "$TMP/DEBIAN/shlibs"); - for file in `find debian/$TMP -type f -name "*.so*" | tr "\n" " "` ; do - LIBRARY=`expr $file : ".*/\(.*\)\.so\..*"` || true - VERSION=`expr $file : ".*/.*\.so\.\(.*\)"` || true - MAJOR=`expr $VERSION : "\([0-9]*\)\."` || true - LIBSTUB=`expr $file : "\(.*\/.*\.so\)\..*"` || true - if [ ! -d "debian/$TMP/DEBIAN" ] ; then - doit "install -d debian/$TMP/DEBIAN" - fi - verbose_echo "echo \"$LIBRARY $MAJOR $PACKAGE\" >>debian/$TMP/DEBIAN/shlibs" - echo "$LIBRARY $MAJOR $PACKAGE" >>debian/$TMP/DEBIAN/shlibs - done + open (FIND, "find $TMP -type f -name '*.so.*' |"); + while (<FIND>) { + chomp; + ($library, $major)=m#.*/(.*)\.so\.(\d*)\.?#; + if (defined($dh{M_PARAMS}) && $dh{M_PARAMS} ne '') { + $major=$dh{M_PARAMS}; + } + if (! -d "$TMP/DEBIAN") { + doit("install","-d","$TMP/DEBIAN"); + } + $deps=$PACKAGE; + if ($dh{V_FLAG_SET}) { + if ($dh{V_FLAG} ne '') { + $deps=$dh{V_FLAG}; + } + else { + # Call isnative becuase it sets $dh{VERSION} + # as a side effect. + isnative($PACKAGE); + $deps="$PACKAGE (>= $dh{VERSION})"; + } + } + if (defined($library) && defined($major) && defined($deps) && + $library ne '' && $major ne '' && $deps ne '') { + complex_doit("echo '$library $major $deps' >>$TMP/DEBIAN/shlibs"); + } + } + close FIND; - if [ -e "debian/$TMP/DEBIAN/shlibs" ]; then - doit "chown root.root debian/$TMP/DEBIAN/shlibs" - fi -done + if (-e "$TMP/DEBIAN/shlibs") { + doit("chmod",644,"$TMP/DEBIAN/shlibs"); + doit("chown","root.root","$TMP/DEBIAN/shlibs"); + } +} |