SHA256
1
0
forked from pool/suse-hpc
suse-hpc/hpc_elf.pl
Egbert Eich fe7e841696 Accepting request 525945 from home:eeich:hpc_alt
- Add a dependency generator wrapper for binaries and libraries
  to avoid adding standard dependencies for HPC libraries.

- Removed unneeded BuildRequires:

OBS-URL: https://build.opensuse.org/request/show/525945
OBS-URL: https://build.opensuse.org/package/show/science:HPC/suse-hpc?expand=0&rev=3
2017-09-13 22:51:52 +00:00

80 lines
1.5 KiB
Perl

#! /usr/bin/perl
use Cwd 'abs_path';
use File::Basename;
$dir=dirname(abs_path($0));
$command=$dir . "/elfdeps";
$dlinfo=$dir . "/dlinfo";
$arglist = "";
sub usage {
my $message = <<EOF;
Usage: $0 [-?] [-P|--provides] [-R|--requires] [--filter-private]
[--soname-only] [--no-fake-soname] [--assume-exec] [-?|--help]
[--usage]
EOF
print $message;
exit (0);
}
sub help {
my $message = <<EOF;
Usage: $0 [OPTION...]
-P, --provides
-R, --requires
--filter-private
--soname-only
--no-fake-soname
--assume-exec
Help options:
-?, --help Show this help message
--usage Display brief usage message
EOF
print $message;
exit (0);
}
while ( $a = shift @ARGV ) {
if ( $a =~ /--assume-exec/ ||
$a =~ /--provides/ ||
$a =~ /-P/ ||
$a =~ /--requires/ ||
$a =~ /-R/ ||
$a =~ /--filter-private/ ||
$a =~ /--soname-only/ ||
$a =~ /--no-fake-soname/ ||
$a =~ /--filter-private/ ) {
$arglist .= " " . $a;
} elsif ( $a =~ /--help/ || $a =~ /-?/ ) {
help;
} elsif ( $a =~ /--usage/ ) {
usage;
# } elsif ( $a = ~ / / ) {
# } else {
}
}
open HANDLE, "$command $arglist |";
while ((chop($line = <HANDLE>))) {
$line =~ /([^\(]+)(.*)/;
$libs{$1}{$2} = 1;
}
foreach $lib ( keys %libs ) {
$full=`$dlinfo $lib`;
if (!$full) {
delete $libs{$lib};
}
}
foreach $lib ( keys %libs ) {
foreach $key ( keys %{ $libs{$lib} } ) {
print "$lib$key\n";
}
}