]> git.donarmstrong.com Git - debhelper.git/blob - dh_shlibdeps
r383: * dh_movefiles: no longer does the symlink ordering hack, as
[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 (@filelist) {
32                 doit("dpkg-shlibdeps","-Tdebian/${EXT}substvars",@{$dh{U_PARAMS}},'-dDepends',@filelist);
33         }
34 }