*** empty log message ***
[platform/upstream/rpm.git] / autodeps / linux.prov
1 #!/bin/bash
2
3 # This script reads filenames from STDIN and outputs any relevant provides
4 # information that needs to be included in the package.
5
6 filelist=$(grep "\\.so" | grep -v "^/lib/ld.so" | xargs file -L 2>/dev/null | grep "ELF.*shared object" | cut -d: -f1)
7
8 for f in $filelist; do
9     soname=$(objdump -p $f | awk '/SONAME/ {print $2}')
10
11     if [ "$soname" != "" ]; then
12         if [ ! -L $f ]; then
13             echo $soname
14             objdump -p $f | awk '
15                 BEGIN { START=0 ; }
16                 /Version definitions:/ { START=1; }
17                 /^[0-9]/ && (START==1) { print $4; }
18                 /^$/ { START=0; }
19             ' | \
20                 grep -v $soname | \
21                 while read symbol ; do
22                     echo "$soname($symbol)"
23                 done
24         fi
25     else
26         echo ${f##*/}
27     fi
28 done | sort -u