3 # Original Author: Tim Mooney <mooney@golem.phys.ndsu.NoDak.edu>
4 # $Id: osf.req,v 1.9 2001/09/15 13:49:11 jbj Exp $
6 # This file is distributed under the terms of the GNU Public License
8 # find-requires is part of RPM, the Red Hat Package Manager. find-requires
9 # reads a list of full pathnames (in a package) on stdin, and outputs all
10 # shared libraries the package requires to execute.
12 # On Digital/Tru64 Unix (OSF1), use `odump -Dl' to find the library
13 # dependencies for an executable. `odump -D' does most of what we need,
14 # but it doesn't give us library version information, so you must use
15 # `odump -Dl'. Note that Tru64 5.x and on have `ldd', but this works just
16 # as well, and works on older versions of the OS.
18 # Example `odump -Dl' output:
20 #$odump -Dl /usr/bin/X11/xterm
25 # ***LIBRARY LIST SECTION***
26 # Name Time-Stamp CheckSum Flags Version
28 # libXaw.so Dec 9 00:15:35 1997 0x285006d0 0 6.0
29 # libXmu.so Dec 9 00:13:36 1997 0x3bf3a33d 0
30 # libXt.so Dec 9 00:12:18 1997 0x10dd9a17 0
31 # libSM.so Dec 9 00:08:11 1997 0xb64c7082 0
32 # libICE.so Dec 9 00:07:52 1997 0x1199be32 0
33 # libXext.so Dec 9 00:08:51 1997 0xafcb84d5 0
34 # libX11.so Dec 9 00:06:05 1997 0xaa1bf091 0
35 # libc.so Dec 8 18:41:11 1997 0x5e955f9b 0 osf.1
37 PATH=/usr/bin:/usr/sbin:/sbin:/usr/ccs/bin
41 # TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things
42 # like `file', et. al. and expect the output to be what we see in the
43 # C/POSIX locale. Make sure it is so.
49 # TVM: switch to using `while read ...' instead of `for f in ...', because
50 # packages with a large number of files could be too big for one shell variable
58 # Uncomment the next line for addtional debugging:
62 # Only run file once per file:
67 # handle shell scripts first
69 is_shell_script=`echo "$file_output" | grep 'shell script' | \
70 cut -d: -f 2 | awk '{ print $1 }'`
75 if test X"$is_shell_script" != X ; then
76 echo "$is_shell_script"
78 # use `continue' to skip back up to the top of the loop.
79 # We have already done as much as we need to for this
80 # file, and this saves me from having to have an else,
81 # and another indent level... ;-)
87 # The `else' here is implied by the `continue' above...
91 # it might be a shared library.
94 maybe_shared_lib=`echo "$file_output" | grep 'executable'`
95 if test X"$maybe_shared_lib" != X ; then
97 odump -Dl $f 2>/dev/null \
101 # Since this entire awk script is enclosed in single quotes,
102 # you need to be careful to not use single quotes, even in awk
103 # comments, if you modify this script.
107 found_program_name = 0;
113 # uncomment the next line for debugging information
114 #{ print "Saw input:", $0 }
116 found_program_name == 1 && $0 !~ /^$/ {
118 # uncomment for debugging information
119 #print "found shared library: $0"
121 # get the library name (field 1) and the library version
122 # (field 8) if present.
123 numfields = split($0,fields)
124 if (numfields == 7) {
126 } else if (numfields == 8) {
127 print fields[1], "(", fields[8], ")"
132 found_program_name = 1
134 # uncomment the next line for debugging information
135 #print "found the program name: ", $1
141 # comment out the previous line and uncomment the next when debugging