5 dh_shlibdeps - calculate shared library dependancies
11 use Debian::Debhelper::Dh_Lib;
15 B<dh_shlibdeps> [S<I<debhelper options>>] [B<-l>I<directory>] [B<-X>I<item>] [S<B<--> I<params>>]
19 dh_shlibdeps is a debhelper program that is responsible for calculating
20 shared library dependancies for packages.
22 This program is merely a wrapper around L<dpkg-shlibdeps(1)> that calls it
23 once for each package listed in the control file, passing it
24 a list of ELF executables and shared libraries it has found.
30 =item B<-u>I<params>, B<--dpkg-shlibdeps-params=>I<params>
34 Pass "params" to L<dpkg-shlibdeps(1)>.
36 =item B<-X>I<item>, B<--exclude=>I<item>
38 Exclude files that contain "item" anywhere in their filename from being
39 passed to dpkg-shlibdeps. This will make their dependancies be ignored.
40 This may be useful in some situations, but use it with caution. This option
41 may be used more than once to exclude more than one thing.
43 =item B<-l>I<directory>[:directory:directory:..]
45 Before dpkg-shlibdeps is run, LD_LIBRARY_PATH will have added to it the
46 specified directory (or directories -- separate with colons). This is
47 useful for multi-binary packages where a library is built in one
48 package and another package contains binaries linked against said
49 library. Relative paths will be made absolute for the benefit of
58 # Add directory to library search path.
61 # Add to existing paths, if set.
62 push @paths, $ENV{'LD_LIBRARY_PATH'}
63 if exists $ENV{'LD_LIBRARY_PATH'};
64 foreach (split(/:/, $dh{L_PARAMS})) {
65 # Force the path absolute.
70 push @paths, getcwd()."/$_";
73 $dh{L_PARAMS}=join(':', @paths);
74 $ENV{'LD_LIBRARY_PATH'}=$dh{L_PARAMS};
75 verbose_print("LD_LIBRARY_PATH=$dh{L_PARAMS}");
78 foreach my $package (@{$dh{DOPACKAGES}}) {
79 my $tmp=tmpdir($package);
80 my $ext=pkgext($package);
85 # Generate a list of ELF binaries in the package, ignoring any
86 # we were told to exclude.
88 if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
89 $find_options="! \\( $dh{EXCLUDE_FIND} \\)";
91 foreach my $file (split(/\n/,`find $tmp -type f \\( -perm +111 -or -name "*.so*" \\) $find_options`)) {
92 # TODO: this is slow, optimize. Ie, file can run once on multiple files..
94 if ($ff=~m/ELF/ && $ff!~/statically linked/) {
100 doit("dpkg-shlibdeps","-Tdebian/${ext}substvars",@{$dh{U_PARAMS}},'-dDepends',@filelist);
108 This program is a part of debhelper.
112 Joey Hess <joeyh@debian.org>