2002-06-12 12:59:50 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# This script reads filenames from STDIN and outputs any relevant provides
|
|
|
|
# information that needs to be included in the package.
|
|
|
|
|
2006-10-12 03:33:42 +00:00
|
|
|
if [ "$1" ]
|
|
|
|
then
|
2008-04-03 06:46:05 +00:00
|
|
|
package_name="$1"
|
2006-10-12 03:33:42 +00:00
|
|
|
fi
|
|
|
|
|
2002-06-12 12:59:50 +00:00
|
|
|
filelist=`sed "s/['\"]/\\\&/g"`
|
|
|
|
|
2005-06-10 17:19:17 +00:00
|
|
|
#
|
|
|
|
# --- libtool
|
2014-04-10 12:20:54 +00:00
|
|
|
[ -x /usr/lib/rpm/rpmdeps -a -n "$filelist" ] &&
|
|
|
|
echo $filelist | tr '[:blank:]' \\n | /usr/lib/rpm/rpmdeps --provides
|
2005-06-10 17:19:17 +00:00
|
|
|
|
2007-06-19 15:23:29 +00:00
|
|
|
#
|
|
|
|
# --- any other extra find-provides scripts
|
|
|
|
for i in /usr/lib/rpm/redhat/find-provides.d/*.prov
|
|
|
|
do
|
|
|
|
[ -x $i ] &&
|
|
|
|
(echo $filelist | tr '[:blank:]' \\n | $i | sort -u)
|
|
|
|
done
|
|
|
|
|
2006-10-12 03:33:42 +00:00
|
|
|
#
|
|
|
|
# --- Kernel module imported symbols
|
|
|
|
#
|
|
|
|
# Since we don't (yet) get passed the name of the package being built, we
|
|
|
|
# cheat a little here by looking first for a kernel, then for a kmod.
|
|
|
|
#
|
|
|
|
|
|
|
|
is_kmod=1
|
|
|
|
for f in $filelist; do
|
|
|
|
if [ $(echo "$f" | sed -r -ne 's:^.*/lib/modules/(.*)/(.*).ko$:\2:p') ]
|
|
|
|
then
|
|
|
|
is_kernel=1;
|
|
|
|
fi
|
|
|
|
if [ $(echo "$f" | sed -r -ne 's:^.*/boot/(.*):\1:p') ]
|
|
|
|
then
|
|
|
|
unset is_kmod;
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ ! "$is_kernel" ] || [ "$package_name" == "kernel" ]
|
|
|
|
then
|
|
|
|
unset is_kmod
|
|
|
|
fi
|
|
|
|
|
|
|
|
[ -x /usr/lib/rpm/redhat/find-provides.ksyms ] && [ "$is_kmod" ] &&
|
|
|
|
printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/redhat/find-provides.ksyms
|
|
|
|
|
2002-06-12 12:59:50 +00:00
|
|
|
exit 0
|