#!/bin/bash # $Id$ SCANELF="scanelf -LnyRB" BINDIR="$1" if [[ -z ${BINDIR} ]] then echo "No \$BINDIR given" exit 1 fi build_soname_list() { local sonames local i sonames="$(${SCANELF} ${BINDIR} | cut -d' ' -f2 | sed 's:,:\ :g')" # now drop all duplicates SONAME_LIST="$(for i in ${sonames}; do echo ${i}; done | sort -u)" export SONAME_LIST } build_dep_list() { local soname local deps local i local prefix # if /lib /lib64 are symlinks than add a prefix to honor usr-move if [[ -L /lib ]] || [[ -L /lib64 ]] then prefix="/usr" fi for soname in ${SONAME_LIST} do deps+=" $(magequery -e ${prefix}${soname})" done DEPNAME_LIST="$(for i in ${deps}; do echo ${i}; done | sort -u)" export DEPNAME_LIST } build_soname_list build_dep_list #echo "${SONAME_LIST}" echo "${DEPNAME_LIST}" | sed 's:\(.*\)-r.*:>= \1:'