3 # Automatically generate shlibs files.
5 use Debian::Debhelper::Dh_Lib;
8 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
12 my $need_ldconfig = 0;
14 doit("rm", "-f", "$TMP/DEBIAN/shlibs");
16 open (FIND, "find $TMP -xtype f -name '*.so*' |");
20 # The second evil regexp is for db3, whose author should
22 if (m#.*/([^/]*)\.so\.(\d*)\.?# || m#.*/([^/]*)-([^\s/]+)\.so$#) {
26 if (defined($dh{M_PARAMS}) && $dh{M_PARAMS} ne '') {
29 if (! -d "$TMP/DEBIAN") {
30 doit("install","-d","$TMP/DEBIAN");
33 if ($dh{V_FLAG_SET}) {
34 if ($dh{V_FLAG} ne '') {
38 # Call isnative becuase it sets $dh{VERSION}
41 $deps="$PACKAGE (>= $dh{VERSION})";
44 if (defined($library) && defined($major) && defined($deps) &&
45 $library ne '' && $major ne '' && $deps ne '') {
46 # Prevent duplicate lines from entering the file.
47 my $line="$library $major $deps";
50 complex_doit("echo '$line' >>$TMP/DEBIAN/shlibs");
57 if (! Debian::Debhelper::Dh_Lib::compat(2) &&
58 ! $dh{NOSCRIPTS} && $need_ldconfig) {
59 autoscript($PACKAGE,"postinst","postinst-makeshlibs");
60 autoscript($PACKAGE,"postrm","postrm-makeshlibs");
63 if (-e "$TMP/DEBIAN/shlibs") {
64 doit("chmod",644,"$TMP/DEBIAN/shlibs");
65 doit("chown","0.0","$TMP/DEBIAN/shlibs");