aboutsummaryrefslogtreecommitdiffstats
path: root/find-requires.in
diff options
context:
space:
mode:
Diffstat (limited to 'find-requires.in')
-rwxr-xr-xfind-requires.in223
1 files changed, 2 insertions, 221 deletions
diff --git a/find-requires.in b/find-requires.in
index ab365a5..e15d5a6 100755
--- a/find-requires.in
+++ b/find-requires.in
@@ -38,170 +38,11 @@ fi
#
-# --- Grab the file manifest and classify files.
-#filelist=`sed "s/['\"]/\\\&/g"`
filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`
-exelist=`echo "$filelist" | xargs -r file | egrep -v ":.* (commands|script) " | \
- grep ":.*ELF.*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 | \
- grep ":.*shared object" | cut -d : -f1`
-ocamllist=`echo "$filelist" | xargs -r file | \
- grep ":.*Objective caml interface file" | cut -d : -f1`
phplist=`echo "$filelist" | grep -v /usr/doc | grep -v /usr/share/doc | egrep "\.php$"`
-mavenlist=$(echo "$filelist" |egrep '/usr/share/maven-fragments/*')
-osgilist=$(echo "$filelist" |egrep "^(.*\.jar|((/usr/lib(64)|/usr/share).*/MANIFEST.MF))")
-javadoclist=$(echo "$filelist" |egrep '/usr/share/javadoc/*')
-interplist=
-perllist=
-pythonlist=
-tcllist=
rubygemlist=`echo "$filelist"| egrep "\.gemspec$"`
-uniqdeplist=
-
-#
-# --- Alpha does not mark 64bit dependencies
-case `uname -m` in
- alpha*) mark64="" ;;
- *) mark64="()(64bit)" ;;
-esac
-
-if [ "$needed" -eq 0 ]; then
-#
-# --- Executable dependency sonames.
- for f in $exelist; do
- [ -r $f -a -x $f ] || continue
- lib64=`if file -L $f 2>/dev/null | \
- grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
- ldd $f | awk '/=>/ {
- if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/) {
- gsub(/'\''"/,"\\&",$1);
- printf "%s'$lib64'\n", $1
- }
- }'
- done | xargs -r -n 1 basename | sort -u | grep -v 'libsafe|libfakeroot'
-
-#
-# --- Library dependency sonames.
- for f in $liblist; do
- [ -r $f ] || continue
- lib64=`if file -L $f 2>/dev/null | \
- grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
- ldd $f | awk '/=>/ {
- if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/) {
- gsub(/'\''"/,"\\&",$1);
- printf "%s'$lib64'\n", $1
- }
- }'
- done | xargs -r -n 1 basename | sort -u | grep -v 'libsafe|libfakeroot'
-fi
-
-#
-# --- Script interpreters.
-for f in $scriptlist; do
- [ -r $f -a -x $f ] || continue
- interp=`head -n 1 $f | grep '^#!' | sed -e 's/^\#\![ ]*//' | cut -d" " -f1`
- if [[ "$interp" == *bin/env ]]; then
- arg=`head -n 1 $f | grep '^#!' | sed -e 's/^\#\![ ]*//' | cut -d" " -f2`
- interp="`which $arg`"
- fi
- case $interp in
- # we really don't need to add these dependencies as they're required by
- # glibc and therefore guaranteed to be satisfied
- */sh|*/bash)
- continue
- ;;
- # we already have dedicated dependency generators for these
- */python)
- pythonlist="$pythonlist $f"
- ;;
- */perl)
- perllist="$perllist $f"
- ;;
- */ruby)
- rubylist="$rubylist $f"
- ;;
- *)
- interplist="$interplist $interp"
- ;;
- esac
-done
-if [ -n "$interplist" ]; then
- tmpdeplist=
- for i in `echo "$interplist" | tr '[:blank:]' \\\n `; do
- dep=`rpm -qf $i --qf '%{name}\n'` && i=$dep
- if [[ -z `echo $uniqdeplist $tmpdeplist|grep "$i"` ]]; then
- tmpdeplist+="$i\n"
- fi
- done
- echo -n -e $tmpdeplist | sort -u | grep -v 'libsafe|libfakeroot'
- uniqdeplist="$tmpdeplist"
-fi
-
-#
-# --- Add perl module files to perllist.
-for f in $filelist; do
- [ -r $f -a "${f%.pm}" != "${f}" ] && perllist="$perllist $f"
-done
-
-#
-# --- Weak symbol versions (from glibc).
-[ -n "$mark64" ] && mark64="(64bit)"
-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`
- objdump -p $f | awk 'BEGIN { START=0; LIBNAME=""; needed='$needed'; }
- /^$/ { START=0; }
- /^Dynamic Section:$/ { START=1; }
- (START==1) && /NEEDED/ {
- if (needed) {
- if ("'$lib64'" != "") {
- sub(/$/, "()'$lib64'", $2) ;
- }
- print $2 ;
- }
- }
- /^Version References:$/ { START=2; }
- (START==2) && /required from/ {
- sub(/:/, "", $3);
- LIBNAME=$3;
- }
- (START==2) && (LIBNAME!="") && ($4!="") && (($4~/^GLIBC_*/) || ($4~/^GCC_*/)) {
- print LIBNAME "(" $4 ")'$lib64'";
- }
- '
-done | sort -u | grep -v 'libsafe|libfakeroot'
-
-# --- OCaml dependency
-if [ -x /usr/bin/ocamlc -a -n "$ocamllist" ]; then
- version=`ocamlc -v | grep version | awk '{print $6}' | sed -e 's/+/./'`
- echo "ocaml = $version"
-fi
-
-#
-# --- Perl modules.
-perlmymeta=$( echo $filelist | tr '[:blank:]' \\n | egrep 'doc/[^/]+/MYMETA.(yml|json)$' | head -1 )
-perlmeta=$( echo $filelist | tr '[:blank:]' \\n | egrep 'doc/[^/]+/META.(yml|json)$' | head -1 )
-if [ -n "$perlmymeta" ]
-then
- [ -x @RPMVENDORDIR@/perl.req-from-meta ] && \
- @RPMVENDORDIR@/perl.req-from-meta $perlmymeta \
- && test ${PIPESTATUS[0]} -ne 0 && echo 'error: @RPMVENDORDIR@/perl.req-from-meta failed' >&2 && exit 1
-elif [ -n "$perlmeta" ]
-then
- [ -x @RPMVENDORDIR@/perl.req-from-meta ] && \
- @RPMVENDORDIR@/perl.req-from-meta $perlmeta \
- && test ${PIPESTATUS[0]} -ne 0 && echo 'error: @RPMVENDORDIR@/perl.req-from-meta failed' >&2 && exit 1
-else
- [ -x @RPMVENDORDIR@/perl.req -a -n "$perllist" ] && \
- echo $perllist | tr '[:blank:]' \\n | @RPMVENDORDIR@/perl.req | grep 'perl([[:upper:]]' | egrep -v '^perl\((Be|FreeBSD|HPUX|Mac|MSDOS|MVS|OS2|Riscos|SGI|Solaris|VMS|Win32|WinNT)::' | sort -u \
- && test ${PIPESTATUS[2]} -ne 0 && echo 'error: @RPMVENDORDIR@/perl.req failed' >&2 && exit 1
-fi
-
#
# --- If libperl.so exists and if XS modules are found, depend on perlapi-<version> and libperl.so
if [ -n "$perllist" ]; then
@@ -218,17 +59,8 @@ if [ -n "$perllist" ]; then
fi
fi
-#
-# --- Python modules.
-[ -x @RPMVENDORDIR@/pythoneggs.py -a -n "$filelist" ] && \
- echo $filelist | tr '[:blank:]' \\n | @RPMVENDORDIR@/pythoneggs.py --requires | sort -u \
- && test ${PIPESTATUS[2]} -ne 0 && echo 'error: @RPMVENDORDIR@/pythoneggs.py failed' >&2 && exit 1
-
-#
-# --- Tcl modules.
-[ -x @RPMVENDORDIR@/tcl.req -a -n "$tcllist" ] && \
- echo $tcllist | tr '[:blank:]' \\n | @RPMVENDORDIR@/tcl.req | sort -u \
- && test ${PIPESTATUS[2]} -ne 0 && echo 'error: @RPMVENDORDIR@/tcl.req failed' >&2 && exit 1
+[ -x /usr/lib/rpm/rpmdeps -a -n "$filelist" ] && \
+ echo $filelist | tr '[:blank:]' \\n | /usr/lib/rpm/rpmdeps --requires
#
# --- Php modules.
@@ -237,26 +69,11 @@ fi
&& test ${PIPESTATUS[2]} -ne 0 && echo 'error: @RPMVENDORDIR@/php.req failed' >&2 && exit 1
#
-# --- Pkgconfig deps
-[ -x @RPMLIBDIR@/pkgconfigdeps.sh ] &&
- echo "$filelist" | tr '[:blank:]' \\n | @RPMLIBDIR@/pkgconfigdeps.sh -R | sort -u \
- && test ${PIPESTATUS[2]} -ne 0 && echo 'error: @RPMLIBDIR@/pkgconfigdeps.sh failed' >&2 && exit 1
-
-#
# --- typelib() gobject-introspection bindings
[ -x @RPMVENDORDIR@/gi-find-deps.sh ] &&
echo "$filelist" | tr '[:blank:]' \\n | @RPMVENDORDIR@/gi-find-deps.sh -R | sort -u \
&& test ${PIPESTATUS[2]} -ne 0 && echo 'error: @RPMVENDORDIR@/gi-find-deps.sh failed' >&2 && exit 1
-if [ -n "$LIBTOOLDEP" ]; then
-#
-# --- libtooldep deps
-[ -x @RPMLIBDIR@/libtooldeps.sh ] &&
- echo "$filelist" | tr '[:blank:]' \\n | @RPMLIBDIR@/libtooldeps.sh -R | sort -u \
- && test ${PIPESTATUS[2]} -ne 0 && echo 'error: @RPMVENDORDIR@/libtooldeps.sh failed' >&2 && exit 1
-
-fi
-
#
# --- Ruby gems
[ -x /usr/bin/ruby -a -x @RPMVENDORDIR@/rubygems.rb -a -n "$rubygemlist" ] &&
@@ -290,50 +107,14 @@ for i in `echo $filelist | tr '[:blank:]' "\n" | egrep "(/usr(/X11R6)?)?/lib(|64
done | egrep -v 'devel\(linux-gate|linux-vdso32|linux-vdso64|lib(c|pthread|rt)(\(64bit\))?\)' | sort -u
#
-# --- pkgconfig
-echo $filelist | tr '[:blank:]' '\n' | egrep -q '/usr/(share|lib(64)?)/pkgconfig/.*\.pc' && echo pkgconfig
-
-#
# --- multiarch-utils
echo $filelist | tr '[:blank:]' '\n' | grep -q '/multiarch-.*-linux/' && echo multiarch-utils
#
-# --- mono requires
-if [ -x /usr/bin/mono-find-requires ]; then
-echo $filelist | tr '[:blank:]' '\n' | /usr/bin/mono-find-requires \
- && test ${PIPESTATUS[2]} -ne 0 && echo 'error: /usr/bin/mono-find-requires failed' >&2 && exit 1
-fi
-
-#
# haskell requires
if [ -x /usr/bin/haskell-find-requires ]; then
echo $filelist | tr '[:blank:]' '\n' | /usr/bin/haskell-find-requires \
&& test ${PIPESTATUS[2]} -ne 0 && echo 'error: /usr/bin/haskell-find-requires failed' >&2 && exit 1
fi
-# --- osgi requires
-if [ -x @RPMLIBDIR@/osgi.req ];then
- if [ ! -z "$osgilist" ]; then
- echo "$osgilist" | tr '[:blank:]' '\n' | @RPMLIBDIR@/osgi.req \
- && test ${PIPESTATUS[2]} -ne 0 && echo 'error: @RPMLIBDIR@/osgi.req failed' >&2 && exit 1
- fi
-fi
-
-#
-# --- maven requires
-if [ -x @RPMLIBDIR@/maven.req ];then
- if [ ! -z "$mavenlist" ]; then
- echo "$mavenlist" | tr '[:blank:]' '\n' | @RPMLIBDIR@/maven.req \
- && test ${PIPESTATUS[2]} -ne 0 && echo 'error: @RPMLIBDIR@/maven.req failed' >&2 && exit 1
- fi
-fi
-
-# --- javadoc requires
-if [ -x @RPMLIBDIR@/javadoc.req ];then
- if [ ! -z "$javadoclist" ]; then
- echo "$javadoclist" | tr '[:blank:]' '\n' | @RPMLIBDIR@/javadoc.req \
- && test ${PIPESTATUS[2]} -ne 0 && echo 'error: @RPMLIBDIR@/javadoc.req failed' >&2 && exit 1
- fi
-fi
-
exit 0