blob: 44025730c4a9e30499a39a978b3245624d84b9ef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/bin/bash
# This script reads filenames from STDIN and outputs any relevant provides
# information that needs to be included in the package.
filelist=`sed "s/['\"]/\\\&/g"`
# fix parsing output of objdump when localized (mga#7883):
export LC_ALL=C
#
# --- Kernel modules.
[ -x @RPMVENDORDIR@/kmod.prov ] &&
echo "$filelist" | tr '[:blank:]' \\n | @RPMVENDORDIR@/kmod.prov | sort -u \
&& test ${PIPESTATUS[2]} -ne 0 && echo 'error: @RPMVENDORDIR@/kmod.prov failed' >&2 && exit 1
#
# --- .so files.
for i in `echo $filelist | tr '[:blank:]' "\n" | egrep '(/usr(/X11R6)?)?/lib(|64)(/gcc(-lib)?/.+)?/[^/]+\.so$'`; do
objd=`objdump -p ${i} | grep SONAME`
[ -h ${i} -a -n "${objd}" ] && \
lib64=`if file -L $i 2>/dev/null | grep "ELF 64-bit" >/dev/null; then echo "(64bit)"; fi` && \
echo ${objd} | perl -p -e "s/.*SONAME\s+(\S+)\.so.*/devel(\1$lib64)/g"
done | sort -u
exit 0
|