4 # Auto-generate requirements for executables (both ELF and a.out) and library
5 # sonames, script interpreters, and perl modules.
10 filelist=`sed "s/['\"]/\\\&/g"`
11 exelist=`echo $filelist | xargs -r file | egrep -v ":.* (commands|script) " | \
12 grep ":.*executable" | cut -d: -f1`
13 scriptlist=`echo $filelist | xargs -r file | \
14 egrep ":.* (commands|script) " | cut -d: -f1`
15 liblist=`echo $filelist | xargs -r file | \
16 grep ":.*shared object" | cut -d : -f1`
24 # --- Alpha does not mark 64bit dependencies
27 *) mark64="()(64bit)" ;;
31 # --- Executable sonames.
33 [ -r $f -a -x $f ] || continue
34 lib64=`if file -L $f 2>/dev/null | \
35 grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
37 if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/) {
38 gsub(/'\''"/,"\\&",$1);
39 printf "%s'$lib64'\n", $1
42 done | xargs -r -n 1 basename | sort -u
45 # --- Library sonames.
48 lib64=`if file -L $f 2>/dev/null | \
49 grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
51 if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/) {
52 gsub(/'\''"/,"\\&",$1);
53 printf "%s'$lib64'\n", $1
56 done | xargs -r -n 1 basename | sort -u
59 # --- Script interpreters.
60 for f in $scriptlist; do
61 [ -r $f -a -x $f ] || continue
62 interp=`head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1`
63 interplist="$interplist $interp"
65 */perl) perllist="$perllist $f" ;;
66 *) [ "${f%.pm}" != "${f}" ] && perllist="$perllist $f" ;;
69 [ -n "$interplist" ] && { echo "$interplist" | tr '[:blank:]' \\n | sort -u ; }
73 # --- Weak symbol versions (from glibc).
74 [ -n "$mark64" ] && mark64="(64bit)"
75 for f in $liblist $exelist ; do
77 lib64=`if file -L $f 2>/dev/null | \
78 grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
80 BEGIN { START=0; LIBNAME=""; }
81 /Version References:/ { START=1; }
82 /required from/ && (START==1) {
86 (START==1) && (LIBNAME!="") && ($4!="") && ($4~/^GLIBC_*/) {
87 print LIBNAME "(" $4 ")'$lib64'";
95 [ -x /usr/lib/rpm/perl.req -a -n "$perllist" ] && \
96 echo $perllist | tr '[:blank:]' \\n | /usr/lib/rpm/perl.req | sort -u
100 [ -x /usr/lib/rpm/python.req -a -n "$pythonlist" ] && \
101 echo $pythonlist | tr '[:blank:]' \\n | /usr/lib/rpm/python.req | sort -u
105 [ -x /usr/lib/rpm/tcl.req -a -n "$tcllist" ] && \
106 echo $tcllist | tr '[:blank:]' \\n | /usr/lib/rpm/tcl.req | sort -u