home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1999 May / pcp151c.iso / misc / src / rpm / autodeps / linux.prov < prev    next >
Encoding:
Text File  |  1997-09-17  |  482 b   |  19 lines

  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.     fi
  15.     else
  16.     echo ${f##*/}
  17.     fi
  18. done | sort -u
  19.