3 # note this works for both a.out and ELF executables
4 # it also auto-generates requirment lines for shell scripts
8 filelist=`sed "s/['\"]/\\\&/g"`
9 for i in /examples/ /doc/; do
10 filelist=`echo $filelist | sed "s!\<[^[:space:]]*$i[^[:space:]]*[[:space:]]*!!g"`
12 exelist=`echo $filelist | xargs -r file | grep ":.*executable" | cut -d: -f1 `
13 elfexelist=`echo $exelist | xargs -r file | egrep ":.* ELF" | cut -d: -f1 `
14 aoutexelist=`echo $exelist | xargs -r file | egrep -v ":.* ELF" | cut -d: -f1 `
15 scriptlist=`echo $filelist | xargs -r file | egrep ":.* (commands|script) " | cut -d: -f1 `
16 liblist=`echo $filelist | xargs -r file | grep ":.*shared object" | cut -d : -f1 `
17 elfliblist=`echo $liblist | xargs -r file | egrep ":.* ELF" | cut -d: -f1 `
18 aoutliblist=`echo $liblist | xargs -r file | egrep -v ":.* ELF" | cut -d: -f1 `
20 aoutexerequires=`for f in $aoutexelist; do
22 ldd $f | awk '/=>/ { print $1 }'
24 done | sort -u | sed "s/['\"]/\\\&/g" | xargs -r -n 1 basename | grep -v 'libNoVersion.so' | sort -u
27 elfexerequires=`for f in $elfexelist; do
29 objdump -p $f|awk '/NEEDED/ {print $2}'
31 done | sed "s/['\"]/\\\&/g" | grep -v 'libNoVersion.so' | sort -u
34 aoutlibrequires=`for f in $aoutliblist; do
35 ldd $f | awk '/=>/ { print $1 }'
36 done | sort -u | sed "s/['\"]/\\\&/g" | xargs -r -n 1 basename | grep -v 'libNoVersion.so' | sort -u
39 elflibrequires=`for f in $elfliblist; do
40 objdump -p $f|awk '/NEEDED/ {print $2}'
41 done | sed "s/['\"]/\\\&/g" | grep -v 'libNoVersion.so' | sort -u
44 for f in $scriptlist; do
46 head -1 $f | sed -ne '/^\#\!/p' | sed -e 's/^\#\![ ]*//' | cut -d" " -f1
50 for f in $liblist $exelist ; do
52 BEGIN { START=0; LIBNAME=""; }
53 /Version References:/ { START=1; }
54 /required from/ && (START==1) {
58 (START==1) && (LIBNAME!="") && ($4~/^GLIBC_*/) { print LIBNAME "(" $4 ")"; }
62 # Generate name of rpm package provides library
65 echo "$aoutexerequires
71 echo "$aoutexerequires
75 | xargs -r -- rpm -q --whatprovides --qf "%{NAME}\n" 2>/dev/null \