3 # Automatically generate shlibs files.
5 use Debian::Debhelper::Dh_Lib;
8 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
13 doit("rm", "-f", "$TMP/DEBIAN/shlibs");
15 open (FIND, "find $TMP -xtype f -name '*.so.*' |");
18 ($library, $major)=m#.*/(.*)\.so\.(\d*)\.?#;
19 if (defined($dh{M_PARAMS}) && $dh{M_PARAMS} ne '') {
22 if (! -d "$TMP/DEBIAN") {
23 doit("install","-d","$TMP/DEBIAN");
26 if ($dh{V_FLAG_SET}) {
27 if ($dh{V_FLAG} ne '') {
31 # Call isnative becuase it sets $dh{VERSION}
34 $deps="$PACKAGE (>= $dh{VERSION})";
37 if (defined($library) && defined($major) && defined($deps) &&
38 $library ne '' && $major ne '' && $deps ne '') {
39 # Prevent duplicate lines from entering the file.
40 my $line="$library $major $deps";
43 complex_doit("echo '$line' >>$TMP/DEBIAN/shlibs");
49 if (-e "$TMP/DEBIAN/shlibs") {
50 doit("chmod",644,"$TMP/DEBIAN/shlibs");
51 doit("chown","0.0","$TMP/DEBIAN/shlibs");