6 # Ben Maurer (bmaurer@ximian.com)
8 # (C) 2005 Novell (http://www.novell.com)
12 filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
13 monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
18 # Set the prefix, unless it is overriden (used when building mono rpms)
22 libdir=$prefix/@reloc_libdir@
25 # Bail out if monodis or libmono is missing
26 if [ ! -x $bindir/monodis ] || [ ! -f $libdir/libmono.so ] ; then
27 echo "monodis missing or unusable, exiting..."
32 # set LD_LIBRARY_PATH to ensure that libmono.so is found
33 export LD_LIBRARY_PATH=$libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
36 for i in "${monolist[@]}"; do
37 ($bindir/monodis --assemblyref $i | awk '
38 BEGIN { START=0; LIBNAME=""; VERSION=""; }
39 (START==0) && /^[0-9]+: Version=/ {
41 sub(/Version=/, "", $2);
45 (START==1) && /^\tName=/ {
48 # Allow rpm deps to be resolved for 1.0 profile version
49 if (VERSION=="1.0.3300.0")
53 print "mono(" LIBNAME ") " OP " " VERSION
61 for i in "${monolist[@]}"; do
62 ($bindir/monodis --assembly $i | awk '
63 BEGIN { LIBNAME=""; VERSION=""; }
64 /^Version:/ { VERSION=$2 }
65 /^Name:/ { LIBNAME=$2 }
67 if (VERSION && LIBNAME)
68 print "mono(" LIBNAME ") = " VERSION
74 # This is a little magic trick to get all REQUIRES that are not
75 # in PROVIDES. While RPM functions correctly when such deps exist,
76 # they make the metadata a bit bloated.
79 # Filter out dups from both lists
80 REQUIRES=$(echo "$REQUIRES" | sort | uniq)
81 PROVIDES=$(echo "$PROVIDES" | sort | uniq)
84 # Get a list of elements that exist in exactly one of PROVIDES or REQUIRES
86 UNIQ=$(echo "$PROVIDES
87 $REQUIRES" | sort | uniq -u)
90 # Of those, only choose the ones that are in REQUIRES
93 $REQUIRES" | sort | uniq -d