X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=scripts%2Fmono-find-requires.in;h=420275d7a6d7cd434012ab5d5236256a6f0b85eb;hb=83569e1ef07325ec30b00d3e2b955718f210e608;hp=b602afd63391975c7764e53b39d77c80807508a0;hpb=b3a8a22c4c1f06da5f9fe1c7f3028374262e8e4b;p=mono.git diff --git a/scripts/mono-find-requires.in b/scripts/mono-find-requires.in index b602afd6339..420275d7a6d 100644 --- a/scripts/mono-find-requires.in +++ b/scripts/mono-find-requires.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # mono-find-requires # @@ -12,16 +12,36 @@ IFS=$'\n' filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/')) monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$")) +# parse .config files to find which native libraries to depend on +# (target attribute must have double quotes for this to work, ie: target="file" ) +# Add /etc/mono/config ? +configlist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.config\$")) + # Set the prefix, unless it is overriden (used when building mono rpms) : ${prefix=@prefix@} -exec_prefix=@exec_prefix@ -libdir=@libdir@ -bindir=@bindir@ +libdir=$prefix/@reloc_libdir@ +bindir=$prefix/bin + +# Bail out if monodis or libmono is missing +if [ ! -x $bindir/monodis ] || [ ! -f $libdir/libmono.so ] ; then + echo "monodis missing or unusable, exiting..." 1>&2 + exit 1 +fi -[ -x $bindir/monodis ] || exit 0; -[ -f $libdir/libmono.so ] || exit 0; +# special case for 64bit archs +if test "x@reloc_libdir@" = "xlib64" ; then + libext="()(64bit)" +else + # (note, this works on ppc64 since we only have 32bit mono) + libext="" +fi +# Exceptions: +case `uname -m` in + # ia64 doesn't use lib64 for 'libdir' (sles 9 rpm used to provide both... no longer) + ia64) libext="()(64bit)" ;; +esac # set LD_LIBRARY_PATH to ensure that libmono.so is found export LD_LIBRARY_PATH=$libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} @@ -35,18 +55,73 @@ REQUIRES=$( sub(/Version=/, "", $2); VERSION=$2 } - + (START==1) && /^\tName=/ { sub(/Name=/, "", $1); LIBNAME=$1 - - print "mono(" LIBNAME ") = " VERSION + # Allow rpm deps to be resolved for 1.0 profile version + if (VERSION=="1.0.3300.0") + OP=">=" + else + OP="=" + print "mono(" LIBNAME ") " OP " " VERSION START=0 } ') 2> /dev/null done + # Parse the xml .config files to see what native binaries we call into + # TODO: also check monodis --moduleref + for i in "${configlist[@]}"; do + awk 'match($_, //dev/null + done ) +# Note about above: +# Use to do: system("rpm -q --whatprovides --queryformat \"%{NAME}\n\" ""\""req"'$libext'""\"") +# rpmlint prefers to have lib names instead of package names. There was a reason I was using package names but it slips me now... +# Ah... now I remember... it's for noarch packs. The noarch packages can be built on either 32 or 64 bit... so we have to depend +# on the package name instead. + PROVIDES=$( for i in "${monolist[@]}"; do ($bindir/monodis --assembly $i | awk ' @@ -77,7 +152,7 @@ UNIQ=$(echo "$PROVIDES $REQUIRES" | sort | uniq -u) # -# Of those, only chose the ones that are in REQUIRES +# Of those, only choose the ones that are in REQUIRES # echo "$UNIQ $REQUIRES" | sort | uniq -d