#!/bin/sh # # pkgdeps - check library dependencies for all executable files # in a tgz file # # Written by Stefano Ghirlanda # # libraries are looked for in thes dirs: LIBPATH="`cat /etc/ld.so.conf` /lib/ /usr/lib" for TGZ; do # loop over all arguments echo "* Inspecting $TGZ" # grabs fields 1 (permissions) and 6 (filename) # from the tar listing of all package files tar ztvf $TGZ | awk '{print $1 " " $6}' | grep -v ^d |\ while read MODE FILE; do # if the file is executable if test `echo $MODE | awk '/x/'`; then echo " Checking $FILE:" # for all shared libs the file depends on, # check whether we find(1) them in $LIBPATH for LIB in `ldd /$FILE | awk '{print $1}'`; do LIB=`basename $LIB` # some libs are listed with full path echo -n " $LIB => " OK=`find $LIBPATH -name $LIB 2>/dev/null` if [ "$OK" ]; then echo $OK else echo "*** NOT FOUND ***" fi done fi done done