Blame SOURCES/find-requires

7689d7
#!/bin/bash
7689d7
7689d7
#
7689d7
# Auto-generate requirements for executables (both ELF and a.out) and library
7689d7
# sonames, script interpreters, and perl modules.
7689d7
#
7689d7
7689d7
ulimit -c 0
7689d7
7689d7
filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`
7689d7
7689d7
[ -x /usr/lib/rpm/rpmdeps -a -n "$filelist" ] && \
7689d7
    echo $filelist | tr '[:blank:]' \\n | /usr/lib/rpm/rpmdeps --requires
7689d7
7689d7
#
7689d7
# --- Kernel module imported symbols
7689d7
#
7689d7
# Since we don't (yet) get passed the name of the package being built, we
7689d7
# cheat a little here by looking first for a kernel, then for a kmod.
7689d7
#
7689d7
7689d7
unset is_kmod
7689d7
7689d7
for f in $filelist; do
7689d7
    if [ $(echo "$f" | sed -r -ne 's:^.*/lib/modules/(.*)/(.*)\.ko(\.gz|\.bz2|\.xz)?$:\2:p') ]
7689d7
    then
7689d7
        is_kmod=1;
7689d7
    elif [ $(echo "$f" | sed -r -ne 's:^.*/boot/(.*):\1:p') ]
7689d7
    then
7689d7
	unset is_kmod;
7689d7
	break;
7689d7
    fi
7689d7
done
7689d7
7689d7
[ -x /usr/lib/rpm/redhat/find-requires.ksyms ] && [ "$is_kmod" ] &&
7689d7
    printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/redhat/find-requires.ksyms
7689d7
7689d7
exit 0