3 # Original Author: Tim Mooney (mooney@plains.nodak.edu)
4 # $Id: osf.prov,v 1.2 1998/05/29 16:34:27 mooney Exp $
6 # This file is distributed under the terms of the GNU Public License
8 # find-provides is part of RPM, the Red Hat Package Manager. find-provides
9 # reads a list of full pathnames (in a package) on stdin, and outputs all
10 # shared libraries provided by (contained in) the package.
13 # On Digital Unix (OSF1), use `odump -D' to find what libraries a package
16 # Example `odump -D' output:
18 #$odump -D /usr/shlib/libc.so
23 # ***DYNAMIC SECTION***
33 # TIME_STAMP: (0x34a82daa) Mon Dec 29 17:09:30 1997
35 # ICHECKSUM: 0x5e955f9b
39 # HASH: 0x000003ff800a82e0
40 # STRTAB: 0x000003ff8008aad0
41 # SYMTAB: 0x000003ff80094ab0
42 # MSYM: 0x000003ff800842c0
45 # PLTGOT: 0x000003ffc008f240
47 # BASE_ADDRESS: 0x000003ff80080000
51 # REL: 0x000003ff80080700
53 # INIT: 0x000003ff8019c520
54 # FINI: 0x000003ff8019c570
58 PATH=/usr/bin:/usr/sbin:/sbin:/usr/ccs/bin
63 odump -D $f 2>/dev/null | awk '
74 # what character should be used to separate the soname from any
75 # version info? Using a . is actually a bad idea, since some
76 # free/3rd party libraries may be built so that the library
77 # soname may have version info in it too. If we use . as the
78 # separator, it may not be possible to tell where the soname
79 # ends and the internal version info begins. It might be
80 # better to use a - or a : here. If you do so, be sure to
81 # change this setting in find-requires, too.
83 soname_version_delimiter=".";
86 # Uncomment the next line for some debugging info.
87 #{ print NR , ":", $0 }
89 /^[ ]+SONAME: .*[ ]*$/ {
91 numfields = split($0, internal_name)
95 # we should probably check to see if the soname ends with
96 # a number (indicating that it contains versioning info,
97 # possibly in addition to the versioning info in the versions
98 # field) and generate a warning here. Shared libraries should
99 # not be built with version info in the soname on Digital Unix.
103 # Should never be here.
105 print "Really odd looking soname:", $0 | "cat 1>&2"
110 /^[ ]+IVERSION: .*[ ]*$/ {
111 if (found_soname == 1) {
112 numfields = split($0, iversion)
113 if (numfields == 2) {
116 # handle libraries with multiple versions, like
117 # 1.1:1.2. Since they really provide both versions,
118 # we need to generate output for each version.
120 numfields = split(version, versions, ":")
122 for (i = 1; i < numfields; i++) {
123 print soname, soname_version_delimiter, versions[i]
126 # let our END routine print out the *last* version
129 version = versions[numfields]
132 # stick a fork in us.
138 # Should never be here.
140 print "Odd looking library version:", $0 | "cat 1>&2"
145 # found an iversion without an soname. Is that possible?
147 print "Found version but no soname:", $0 | "cat 1>&2"
153 # we could probably watch for some other token (like RLD_VERSION)
154 # that *generally* occurs later in the input than the stuff we watch
155 # for, and exit if we see it, but it is just as easy to read all
156 # the output, even after we have seen what we are looking for.
160 # Uncomment the next line for debugging info
161 #{ print "END: NR: ", NR }
162 if ( (found_soname == 1) && (found_iversion == 1) ) {
163 print soname, soname_version_delimiter, version
165 } else if (found_soname == 1) {
167 # no library version information
175 #comment out the previous line and uncomment the next line when debugging