6 # Ben Maurer (bmaurer@ximian.com)
8 # (C) 2005 Novell (http://www.novell.com)
10 # Args: builddir buildroot libdir
13 filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
14 monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
16 # If monodis is in the package being installed, use that one
17 # This is to support building mono
18 build_bindir="$2/usr/bin"
21 if [ -x $build_bindir/monodis ]; then
22 monodis="$build_bindir/monodis"
23 export LD_LIBRARY_PATH=$build_libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
24 elif [ -x /usr/bin/monodis ]; then
25 monodis="/usr/bin/monodis"
30 export MONO_SHARED_DIR=$1
33 for i in "${monolist[@]}"; do
34 ($monodis --assemblyref $i | awk '
35 BEGIN { START=0; LIBNAME=""; VERSION=""; }
36 (START==0) && /^[0-9]+: Version=/ {
38 sub(/Version=/, "", $2);
42 (START==1) && /^\tName=/ {
46 print "mono(" LIBNAME ") = " VERSION
54 for i in "${monolist[@]}"; do
55 ($monodis --assembly $i | awk '
56 BEGIN { LIBNAME=""; VERSION=""; }
57 /^Version:/ { VERSION=$2 }
58 /^Name:/ { LIBNAME=$2 }
60 if (VERSION && LIBNAME)
61 print "mono(" LIBNAME ") = " VERSION
67 # This is a little magic trick to get all REQUIRES that are not
68 # in PROVIDES. While RPM functions correctly when such deps exist,
69 # they make the metadata a bit bloated.
72 # Filter out dups from both lists
73 REQUIRES=$(echo "$REQUIRES" | sort | uniq)
74 PROVIDES=$(echo "$PROVIDES" | sort | uniq)
77 # Get a list of elements that exist in exactly one of PROVIDES or REQUIRES
79 UNIQ=$(echo "$PROVIDES
80 $REQUIRES" | sort | uniq -u)
83 # Of those, only chose the ones that are in REQUIRES
86 $REQUIRES" | sort | uniq -d