]> git.donarmstrong.com Git - debhelper.git/blob - dh_shlibdeps
r317: * Added -X option, which makes it not examine some files. This is useful in
[debhelper.git] / dh_shlibdeps
1 #!/usr/bin/perl -w
2 #
3 # Find dependancies. Simple dpkg-shlibdeps wrapper.
4
5 BEGIN { push @INC, "debian", "/usr/share/debhelper" }
6 use Dh_Lib;
7 init();
8
9 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
10         $TMP=tmpdir($PACKAGE);
11         $EXT=pkgext($PACKAGE);
12
13         my @filelist;
14         my $ff;
15
16         # Generate a list of ELF binaries in the package, ignoring any
17         # we were told to exclude.
18         if (! defined($dh{EXCLUDE_FIND}) || $dh{EXCLUDE_FIND} eq '') {
19                 $find_options="";
20         }
21         else {
22                 $find_options="! \\( $dh{EXCLUDE_FIND} \\)";
23         }
24         foreach $file (split(/\n/,`find $TMP -type f \\( -perm +111 -or -name "*.so*" \\) $find_options`)) {
25                 # TODO: this is slow, optimize. Ie, file can run once on multiple files..
26                 $ff=`file "$file"`;
27                 if ($ff=~m/ELF/ && $ff!~/statically linked/) {
28                         push @filelist,$file;
29                 }
30         }
31
32         if ($dh{L_PARAMS}) {
33                 $ENV{'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 }