+ # build/runtime dependencies (just libs >= stage 3,
+ # default is 'hardcoded')
+ # still in development !!
+ if [ "$hdw_status" -ge "2" ] ; then
+ # build deps
+ rm -f $root/var/adm/deps/build/$package
+ echo -n "calculating build dependencies ... "
+ alldeps=""
+ for lib in `grep '\ -l[A-Za-z]' \
+ $root/var/adm/logs/${hdw_status}-${priority}-$package.out`; do
+ if [ -n "`echo $lib | grep '^-l'`" ] ; then
+ lib=${lib//-l/lib}
+ for dep in `grep "/$lib\." \
+ -r $root/var/adm/flists | \
+ awk -F: '{ print $2 }'`; do
+ add=1
+ for cmp in $alldeps; do
+ [ "$cmp" = "$dep" ] && add=0
+ done
+ [ "$add" = "1" ] && \
+ alldeps="$dep $alldeps"
+ done
+ fi
+ done
+ for dep in $alldeps; do
+ echo "$dep" >> $root/var/adm/deps/build/$package
+ done
+ echo "done"
+ # runtime deps
+ rm -f $root/var/adm/deps/run/$package
+ echo -n "calculating runtime dependencies ... "
+ alldeps=""
+ for binary in `grep 'bin\/' \
+ $root/var/adm/flists/${package}${append} | \
+ awk '{ print $2 }'`; do
+ for rdep in `ldd $root/$binary | awk '{ print $3 }' | \
+ sed 's$/$$'i | grep -v stage | \
+ awk -F: '{ print $2 }'`; do
+ add=1
+ for cmp in $alldeps; do
+ [ "$cmp" = "rdep" ] && add=0
+ done
+ [ "$add" = "1" ] && alldeps="$rdep $alldeps"
+ done
+ done
+ for library in `grep 'lib\/.*.so.*' \
+ $root/var/adm/flists/${package}${append} | \
+ awk '{ print $2 }'`; do
+ for rdep in `ldd $root/$binary | awk '{ print $3 }' | \
+ sed 's$/$$'i | grep -v stage | \
+ awk -F: '{ print $2 }'`; do
+ add=1
+ for cmp in $alldeps; do
+ [ "$cmp" = "rdep" ] && add=0
+ done
+ [ "$add" = "1" ] && alldeps="$rdep $alldeps"
+ done
+ done
+ for dep in $alldeps; do
+ echo "$dep" >> $root/var/adm/deps/run/$package
+ done
+ echo "done"
+ fi
+