]> git.donarmstrong.com Git - debhelper.git/blob - dh_shlibdeps
r364: * Whoops, I forgot to add v3 to cvs, so it was missing from a few
[debhelper.git] / dh_shlibdeps
1 #!/usr/bin/perl -w
2 #
3 # Find dependancies. Simple dpkg-shlibdeps wrapper.
4
5 use Debian::Debhelper::Dh_Lib;
6 init();
7
8 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
9         $TMP=tmpdir($PACKAGE);
10         $EXT=pkgext($PACKAGE);
11
12         my @filelist;
13         my $ff;
14
15         # Generate a list of ELF binaries in the package, ignoring any
16         # we were told to exclude.
17         if (! defined($dh{EXCLUDE_FIND}) || $dh{EXCLUDE_FIND} eq '') {
18                 $find_options="";
19         }
20         else {
21                 $find_options="! \\( $dh{EXCLUDE_FIND} \\)";
22         }
23         foreach $file (split(/\n/,`find $TMP -type f \\( -perm +111 -or -name "*.so*" \\) $find_options`)) {
24                 # TODO: this is slow, optimize. Ie, file can run once on multiple files..
25                 $ff=`file "$file"`;
26                 if ($ff=~m/ELF/ && $ff!~/statically linked/) {
27                         push @filelist,$file;
28                 }
29         }
30
31         if ($dh{L_PARAMS}) {
32                 $ENV{'LD_LIBRARY_PATH'}=$dh{L_PARAMS};
33                 verbose_print("LD_LIBRARY_PATH=$dh{L_PARAMS} \\");
34         }
35
36         if (@filelist) {
37                 doit("dpkg-shlibdeps","-Tdebian/${EXT}substvars",@{$dh{U_PARAMS}},'-dDepends',@filelist);
38         }
39 }