2 # ----------------------------------------------------------
3 # find-provides for Darwin/MacOSX
4 # ----------------------------------------------------------
5 # This script reads filenames from STDIN and outputs any relevant provides
6 # information that needs to be included in the package.
8 filelist=$(sed -n -e '/\.dylib/p' -e '/\.so/p' -e '/\.bundle/p' | sort | uniq | xargs file -L 2>/dev/null | grep "Mach-O.*\(ppc\|i386\)" | cut -d: -f1)
10 for f in $filelist; do
11 libname=$(basename $f | sed -e 's;\..*;;')
12 soname=$(otool -l $f | grep $libname | awk '/ name/ {print $2}')
14 if [ "$soname" != "" ]; then