X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=scripts%2Fmono-find-requires.in;h=420275d7a6d7cd434012ab5d5236256a6f0b85eb;hb=83569e1ef07325ec30b00d3e2b955718f210e608;hp=c2b8832f95674a575135d95cc768ae4528ebcacf;hpb=c39d7ce9985a7067c1cbf44188007c9433901940;p=mono.git diff --git a/scripts/mono-find-requires.in b/scripts/mono-find-requires.in index c2b8832f956..420275d7a6d 100644 --- a/scripts/mono-find-requires.in +++ b/scripts/mono-find-requires.in @@ -12,19 +12,36 @@ IFS=$'\n' filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/')) monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$")) -a=`which "$0"` -d=`dirname "$a"` +# 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=$d/..} +: ${prefix=@prefix@} -exec_prefix=$d/.. libdir=$prefix/@reloc_libdir@ -bindir=$d +bindir=$prefix/bin -[ -x $bindir/monodis ] || exit 0; -[ -f $libdir/libmono.so ] || exit 0; +# 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 +# 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} @@ -52,8 +69,59 @@ REQUIRES=$( } ') 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 '