3 # Automatically generate shlibs files.
6 use Debian::Debhelper::Dh_Lib;
9 foreach my $package (@{$dh{DOPACKAGES}}) {
10 my $tmp=tmpdir($package);
13 my $need_ldconfig = 0;
15 doit("rm", "-f", "$tmp/DEBIAN/shlibs");
17 open (FIND, "find $tmp -xtype f -name '*.so*' |");
24 # The second evil regexp is for db3, whose author should
26 if (m#.*/([^/]*)\.so\.(\d*)\.?# || m#.*/([^/]*)-([^\s/]+)\.so$#) {
30 if (defined($dh{M_PARAMS}) && $dh{M_PARAMS} ne '') {
33 if (! -d "$tmp/DEBIAN") {
34 doit("install","-d","$tmp/DEBIAN");
37 if ($dh{V_FLAG_SET}) {
38 if ($dh{V_FLAG} ne '') {
42 # Call isnative becuase it sets $dh{VERSION}
45 $deps="$package (>= $dh{VERSION})";
48 if (defined($library) && defined($major) && defined($deps) &&
49 $library ne '' && $major ne '' && $deps ne '') {
50 # Prevent duplicate lines from entering the file.
51 my $line="$library $major $deps";
54 complex_doit("echo '$line' >>$tmp/DEBIAN/shlibs");
61 if (! compat(2) && ! $dh{NOSCRIPTS} && $need_ldconfig) {
62 autoscript($package,"postinst","postinst-makeshlibs");
63 autoscript($package,"postrm","postrm-makeshlibs");
66 if (-e "$tmp/DEBIAN/shlibs") {
67 doit("chmod",644,"$tmp/DEBIAN/shlibs");
68 doit("chown","0.0","$tmp/DEBIAN/shlibs");