X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=dh_makeshlibs;h=20644d80e6be01d4be417da8179cc7622148dcba;hb=8b21a3c92ca26438bb925da9a5a280fc4bfd1182;hp=6b3ff411af0005d137637c1f35dea7f1879ae1e0;hpb=a7ad847cd3f23cf75aa2939c4e53c8278731f70d;p=debhelper.git diff --git a/dh_makeshlibs b/dh_makeshlibs index 6b3ff41..20644d8 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -2,32 +2,38 @@ # # Automatically generate shlibs files. +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); my %seen; + my $need_ldconfig = 0; - doit("rm", "-f", "$TMP/DEBIAN/shlibs"); + doit("rm", "-f", "$tmp/DEBIAN/shlibs"); - open (FIND, "find $TMP -xtype f -name '*.so*' |"); + open (FIND, "find $tmp -xtype f -name '*.so*' |"); while () { + my $library; + my $major; + chomp; + $need_ldconfig=1; # The second evil regexp is for db3, whose author should # be shot. - if (m#.*/(.*)\.so\.(\d*)\.?# || m#.*/(.*)-(\S+)\.so$#) { + if (m#.*/([^/]*)\.so\.(\d*)\.?# || m#.*/([^/]*)-([^\s/]+)\.so$#) { $library = $1; $major = $2; } if (defined($dh{M_PARAMS}) && $dh{M_PARAMS} ne '') { $major=$dh{M_PARAMS}; } - if (! -d "$TMP/DEBIAN") { - doit("install","-d","$TMP/DEBIAN"); + if (! -d "$tmp/DEBIAN") { + doit("install","-d","$tmp/DEBIAN"); } - $deps=$PACKAGE; + my $deps=$package; if ($dh{V_FLAG_SET}) { if ($dh{V_FLAG} ne '') { $deps=$dh{V_FLAG}; @@ -35,8 +41,8 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { else { # Call isnative becuase it sets $dh{VERSION} # as a side effect. - isnative($PACKAGE); - $deps="$PACKAGE (>= $dh{VERSION})"; + isnative($package); + $deps="$package (>= $dh{VERSION})"; } } if (defined($library) && defined($major) && defined($deps) && @@ -45,14 +51,20 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { my $line="$library $major $deps"; if (! $seen{$line}) { $seen{$line}=1; - complex_doit("echo '$line' >>$TMP/DEBIAN/shlibs"); + complex_doit("echo '$line' >>$tmp/DEBIAN/shlibs"); } } } close FIND; - if (-e "$TMP/DEBIAN/shlibs") { - doit("chmod",644,"$TMP/DEBIAN/shlibs"); - doit("chown","0.0","$TMP/DEBIAN/shlibs"); + # New as of dh_v3. + if (! compat(2) && ! $dh{NOSCRIPTS} && $need_ldconfig) { + autoscript($package,"postinst","postinst-makeshlibs"); + autoscript($package,"postrm","postrm-makeshlibs"); + } + + if (-e "$tmp/DEBIAN/shlibs") { + doit("chmod",644,"$tmp/DEBIAN/shlibs"); + doit("chown","0.0","$tmp/DEBIAN/shlibs"); } }