aboutsummaryrefslogtreecommitdiffstats
path: root/find-requires.in
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-09-25 10:37:48 +0000
committerOlivier Blin <oblin@mandriva.com>2009-09-25 10:37:48 +0000
commit192c9711daa841458fd0900d0de2f9d66ac74ce5 (patch)
tree6a700a3cf8d1c9057f740ff6517833c92f2efffc /find-requires.in
parentf3ed619d46ca559d07a8893aef26911bd63a42d2 (diff)
downloadrpm-setup-192c9711daa841458fd0900d0de2f9d66ac74ce5.tar
rpm-setup-192c9711daa841458fd0900d0de2f9d66ac74ce5.tar.gz
rpm-setup-192c9711daa841458fd0900d0de2f9d66ac74ce5.tar.bz2
rpm-setup-192c9711daa841458fd0900d0de2f9d66ac74ce5.tar.xz
rpm-setup-192c9711daa841458fd0900d0de2f9d66ac74ce5.zip
add support for MIPS n32 binaries in find-requires and find-provides
(from Arnaud Patard)
Diffstat (limited to 'find-requires.in')
-rwxr-xr-xfind-requires.in38
1 files changed, 31 insertions, 7 deletions
diff --git a/find-requires.in b/find-requires.in
index 17ca82d..25f6314 100755
--- a/find-requires.in
+++ b/find-requires.in
@@ -29,7 +29,8 @@ 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
+ lib_path_n32=$RPM_BUILD_ROOT/usr/lib32:$RPM_BUILD_ROOT/lib32
+ LD_LIBRARY_PATH=$lib_path_64:$lib_path_32:$lib_path_n32
export LD_LIBRARY_PATH
fi
@@ -42,7 +43,7 @@ exelist=`echo "$filelist" | xargs -r file | egrep -v ":.* (commands|script) " |
grep ":.*executable" | cut -d: -f1`
scriptlist=`echo "$filelist" | grep -v /usr/doc | grep -v /usr/share/doc | xargs -r file | \
egrep ":.* (commands|script) " | cut -d: -f1`
-liblist=`echo "$filelist" | egrep -v "/usr/lib(64)?/gcj/" | xargs -r file | \
+liblist=`echo "$filelist" | egrep -v "/usr/lib(32|64)?/gcj/" | xargs -r file | \
grep ":.*shared object" | cut -d : -f1`
ocamllist=`echo "$filelist" | xargs -r file | \
grep ":.*Objective caml interface file" | cut -d : -f1`
@@ -61,6 +62,7 @@ case `uname -m` in
alpha*) mark64="" ;;
*) mark64="()(64bit)" ;;
esac
+mark32="()(n32)"
if [ "$needed" -eq 0 ]; then
#
@@ -69,6 +71,10 @@ if [ "$needed" -eq 0 ]; then
[ -r $f -a -x $f ] || continue
lib64=`if file -L $f 2>/dev/null | \
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
+ if [ "$lib64" != "$mark64" ]; then
+ lib64=`if file -L $f 2>/dev/null | \
+ grep "MIPS, N32" >/dev/null; then echo "$mark32"; fi`
+ fi
ldd $f | awk '/=>/ {
if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/) {
gsub(/'\''"/,"\\&",$1);
@@ -83,6 +89,10 @@ if [ "$needed" -eq 0 ]; then
[ -r $f ] || continue
lib64=`if file -L $f 2>/dev/null | \
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
+ if [ "$lib64" != "$mark64" ]; then
+ lib64=`if file -L $f 2>/dev/null | \
+ grep "MIPS, N32" >/dev/null; then echo "$mark32"; fi`
+ fi
ldd $f | awk '/=>/ {
if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/) {
gsub(/'\''"/,"\\&",$1);
@@ -101,7 +111,7 @@ fi
tmpdeplist=
for f in $filelist; do
- dep="`echo $f | sed -n -e "s@.*/usr/lib/perl5/\(vendor_perl/\|site_perl/\|\)\([.0-9]\{1,\}\).*\\$@perl-base >= $perlepoch\2@p" -e "s@.*/usr/\(lib\|lib64\)/python\([.0-9]\{1,\}\).*\\$@python-base >= \2@p"`"
+ dep="`echo $f | sed -n -e "s@.*/usr/lib/perl5/\(vendor_perl/\|site_perl/\|\)\([.0-9]\{1,\}\).*\\$@perl-base >= $perlepoch\2@p" -e "s@.*/usr/\(lib\|lib64|lib32\)/python\([.0-9]\{1,\}\).*\\$@python-base >= \2@p"`"
if [[ -n $dep && -z `echo $uniqdeplist $tmpdeplist|grep "$dep"` ]]; then
tmpdeplist+="$dep\n"
fi
@@ -141,10 +151,16 @@ done
#
# --- Weak symbol versions (from glibc).
[ -n "$mark64" ] && mark64="(64bit)"
+[ -n "$mark32" ] && mark32="(n32)"
+
for f in $liblist $exelist ; do
[ -r $f ] || continue
lib64=`if file -L $f 2>/dev/null | \
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
+ if [ "$lib64" != "$mark64" ]; then
+ lib64=`if file -L $f 2>/dev/null | \
+ grep "MIPS, N32" >/dev/null; then echo "$mark32"; fi`
+ fi
objdump -p $f | awk 'BEGIN { START=0; LIBNAME=""; needed='$needed'; }
/^$/ { START=0; }
/^Dynamic Section:$/ { START=1; }
@@ -192,6 +208,10 @@ if [ -n "$perllist" ]; then
f=`perl -MConfig -e 'print $Config{archlib}'`/CORE/libperl.so
lib64=`if file -L $f 2>/dev/null | \
grep "ELF 64-bit" >/dev/null; then echo "()$mark64"; fi`
+ if [ "$lib64" != "$mark64" ]; then
+ lib64=`if file -L $f 2>/dev/null | \
+ grep "MIPS, N32" >/dev/null; then echo "()$mark32"; fi`
+ fi
echo libperl.so$lib64
fi
fi
@@ -228,14 +248,18 @@ fi
#
# --- .so files.
-for i in `echo $filelist | tr '[:blank:]' "\n" | egrep "(/usr(/X11R6)?)?/lib(|64)/[^/]+\.so$"`; do
+for i in `echo $filelist | tr '[:blank:]' "\n" | egrep "(/usr(/X11R6)?)?/lib(|64|32)/[^/]+\.so$"`; do
objd=`objdump -p ${i} | grep SONAME`
lib64=`if file -L $i 2>/dev/null | grep "ELF 64-bit" >/dev/null; then echo "(64bit)"; fi` && \
+ if [ "$lib64" != "(64bit)" ]; then
+ lib64=`if file -L $i 2>/dev/null | \
+ grep "MIPS, N32" >/dev/null; then echo "(n32)"; fi`
+ fi && \
if [ -h ${i} -a -n "${objd}" ]; then
if [ "$needed" -eq 0 ]; then
ldd ${i} \
| grep -v "statically linked" \
- | grep -v "/\(lib\|lib64\)/\(ld\|ld64\|ld-linux.*\)\.so" \
+ | grep -v "/\(lib\|lib64\|lib32\)/\(ld\|ld64\|ld-linux.*\)\.so" \
| perl -p -e "s/\s+(\S+)\.so.*/devel(\1$lib64)/g"
else
objdump -p $i | grep -v "\(ld\|ld64\|ld-linux.*\)\.so" \
@@ -250,11 +274,11 @@ for i in `echo $filelist | tr '[:blank:]' "\n" | egrep "(/usr(/X11R6)?)?/lib(|64
'
fi
fi
-done | egrep -v 'devel\(linux-gate|linux-vdso32|linux-vdso64|lib(c|pthread|rt)(\(64bit\))?\)' | sort -u
+done | egrep -v 'devel\(linux-gate|linux-vdso32|linux-vdso64|lib(c|pthread|rt)(\((64bit|n32)\))?\)' | sort -u
#
# --- pkgconfig
-echo $filelist | tr '[:blank:]' '\n' | egrep -q '/usr/(share|lib(64)?)/pkgconfig/.*\.pc' && echo pkgconfig
+echo $filelist | tr '[:blank:]' '\n' | egrep -q '/usr/(share|lib(32|64)?)/pkgconfig/.*\.pc' && echo pkgconfig
#
# --- multiarch-utils