3 # Original Author: Ralph Goers(rgoer@Candle.Com)
4 # Borrowed heavily from Tim Mooney's HP version.
5 # This file is distributed under the terms of the GNU General Public License
7 # find-requires is part of RPM, the RedHat Package Manager. find-requires
8 # reads a list of full pathnames (in a package) on stdin, and outputs all
9 # shared libraries the package requires to run correctly.
14 # On AIX for IA64, use the file command to find shared modules
16 # Example file output:
18 #$file /usr/lib/ia64l32/libc.so
19 #/usr/lib/ia64l32/libc.so: ELF 32-bit LSB version 1 AIX shared obj IA-64
24 # Search for shared objects - the file command on AIX for IA64 reports
26 sed -e "s/['\"]/\\\&/g" -e "s/$/\//g" | LANG=C xargs file | grep -e ":.*shared obj" | cut -d: -f1 | sed "s/\/$//g" | xargs -i basename {} | sort -u
32 # Example dump output:
34 #$dump -H /usr/bin/dump
38 # ***Loader Section***
39 # Loader Header Information
40 #VERSION# #SYMtableENT #RELOCent LENidSTR
41 #0x00000001 0x00000021 0x0000006c 0x0000002f
43 ##IMPfilID OFFidSTR LENstrTBL OFFstrTBL
44 #0x00000002 0x00000848 0x00000049 0x00000877
47 # ***Import File Strings***
48 #INDEX PATH BASE MEMBER
49 #0 /usr/lib:/lib:/usr/lpp/xlC/lib
55 # Search executables, archives, and symlinks to those types for shared
57 sed -e "s/['\"]/\\\&/g" -e "s/$/\//g" | LANG=C xargs file | grep -e ":.*executable" -e ":.*archive" | cut -d: -f1 | sed "s/\/$//g" |
59 # Use the verbose version of dump to find the sharable objects
62 LANG=C /usr/bin/dump -ov $f/ 2>/dev/null | grep -E "^Flags.*SHROBJ|:$" |
63 awk 'match($1,":$") { member=$1 }
64 !match($1,":$") {print member} '
65 done | sed -e 's/:$//' -e 's/\/\[/\(/g' -e 's/\]/)/g' | xargs -i basename {} |
71 machinetype=`uname -m`
72 if [[ $machinetype = "ia64" ]]