Elliot Lee 03bb29
#!/bin/bash
Elliot Lee 03bb29
Elliot Lee 03bb29
#
Elliot Lee 03bb29
# Auto-generate requirements for executables (both ELF and a.out) and library
Elliot Lee 03bb29
# sonames, script interpreters, and perl modules.
Elliot Lee 03bb29
#
Elliot Lee 03bb29
Elliot Lee 03bb29
ulimit -c 0
Elliot Lee 03bb29
Elliot Lee f3e011
filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`
Elliot Lee 03bb29
2cbbbb
[ -x /usr/lib/rpm/rpmdeps -a -n "$filelist" ] && \
2cbbbb
    echo $filelist | tr '[:blank:]' \\n | /usr/lib/rpm/rpmdeps --requires
Elliot Lee 03bb29
Jon Masters 97a328
#
Jon Masters 97a328
# --- Kernel module imported symbols
Jon Masters 97a328
#
Jon Masters 97a328
# Since we don't (yet) get passed the name of the package being built, we
Jon Masters 97a328
# cheat a little here by looking first for a kernel, then for a kmod.
Jon Masters 97a328
#
Jon Masters 97a328
Jeremy Katz 48c39c
unset is_kmod
Jeremy Katz 48c39c
Jon Masters 97a328
for f in $filelist; do
Jon Masters 97a328
    if [ $(echo "$f" | sed -r -ne 's:^.*/lib/modules/(.*)/(.*).ko$:\2:p') ]
Jon Masters 97a328
    then
Jeremy Katz 48c39c
        is_kmod=1;
Jeremy Katz 48c39c
    elif [ $(echo "$f" | sed -r -ne 's:^.*/boot/(.*):\1:p') ]
Jon Masters 97a328
    then
Jeremy Katz 48c39c
	unset is_kmod;
Jeremy Katz 48c39c
	break;
Jon Masters 97a328
    fi
Jon Masters 97a328
done
Jon Masters 97a328
Jon Masters 83405d
# Disabling for now while the Fedora kernel doesn't produce kABI deps.
Jon Masters 83405d
#[ -x /usr/lib/rpm/redhat/find-requires.ksyms ] && [ "$is_kmod" ] &&
Jon Masters 83405d
#    printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/redhat/find-requires.ksyms
Jon Masters 97a328
Elliot Lee 03bb29
exit 0