aboutsummaryrefslogtreecommitdiffstats
path: root/find-requires.in
blob: b15c42c85e02b2c375435fbca41ab95c39e8a8ab (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash

#
# Auto-generate requirements for ELF executables and library
# sonames, script interpreters, and perl modules.
#

ulimit -c 0

# fix parsing output of objdump when localized (mga#7883):
export LC_ALL=C

#
# --- Set needed to 0 for traditional find-requires behavior.
needed=1
if [ X"$3" = Xldd ]; then
    needed=0
elif [ X"$3" = Xobjdump ]; then
    needed=1
fi

# --- Mageia specific part
case "$LD_PRELOAD" in
    *libfakeroot*)
	unset LD_PRELOAD
	;;
esac

RPM_BUILD_ROOT=$1
RPM_ARCH=$2

if [ -n "$RPM_BUILD_ROOT" ]; then
    lib_path_64=$RPM_BUILD_ROOT/usr/X11R6/lib64:$RPM_BUILD_ROOT/usr/lib64:$RPM_BUILD_ROOT/lib64
    lib_path_32=$RPM_BUILD_ROOT/usr/X11R6/lib:$RPM_BUILD_ROOT/usr/lib:$RPM_BUILD_ROOT/lib
    LD_LIBRARY_PATH=$lib_path_64:$lib_path_32
    export LD_LIBRARY_PATH
fi


#
filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`

[ -x /usr/lib/rpm/rpmdeps -a -n "$filelist" ] && \
	echo $filelist | tr '[:blank:]' \\n | /usr/lib/rpm/rpmdeps --requires

exit 0