3 # Original Author: Tim Mooney <mooney@golem.phys.ndsu.NoDak.edu>
4 # $Id: hpux.req,v 1.7 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 run correctly.
12 # On HP-UX, use `chatr' to find the library dependencies for an executable
14 # Example chatr output:
16 #$chatr /usr/bin/chatr
19 # shared library dynamic path search:
20 # SHLIB_PATH disabled second
21 # embedded path disabled first Not Defined
24 # shared library list:
25 # dynamic /usr/lib/libc.1
26 # shared library binding:
28 # static branch prediction disabled
29 # kernel assisted branch predictionenabled
30 # lazy swap allocationdisabled
31 # text segment lockingdisabled
32 # data segment lockingdisabled
34 # instruction page size: 4K
36 PATH=/usr/bin:/usr/sbin:/sbin:/usr/ccs/bin
40 # TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things
41 # like `file', et. al. and expect the output to be what we see in the
42 # C/POSIX locale. Make sure it is so.
50 # uncomment the next line if debugging
51 # echo "### processing $f"
54 # Only run the file command once per file:
59 # First, check to see if it's a script, and try figure out what
60 # intpreter it requires. This is more work on HP-UX, since `file'
61 # doesn't tell us what interpreter the script uses, or even if it
64 is_shell_script=`od -N 2 -t c $f 2>/dev/null | grep '0000000 # !'`
65 if test X"$is_shell_script" != X ; then
67 # it's a shell script. Now figure out what interpreter it needs
68 # Look at me! I'm good with sed. ;-)
69 interp=`head -1 $f | sed -e 's/^#! \{0,1\}\([^ ]*\).*$/\1/'`
70 if test X"$interp" != X ; then
73 # We've found what we need for this file. Skip back to the
74 # top of the loop. This saves me an `else' and another indent
81 # The `else' is implied here by the `continue' above
85 # Is it a shared library?
87 maybe_shared_lib=`echo "$file_output" | grep -E '(executable|library)'`
88 if test X"$maybe_shared_lib" != X ; then
89 chatr $f 2>/dev/null \
93 # For you non-awk-ers, no single quotes in comments -- the shell
94 # sees them and things get hosed.
103 # uncomment the next line for debugging information
104 #{ print NR, ": ", $0 }
107 in_shlib_list == 1 && /dynamic[ ]+[\/\.]/ {
109 # split the line on "/" and print out the last element
110 numfields = split($0,fields,"/")
111 print fields[numfields]
115 /^ +shared library list: *$/ {
119 /^ +shared library binding: *$/ {
123 fi # end of shared library if.
125 #comment out the previous line and uncomment the next one if debugging.