summaryrefslogtreecommitdiff
path: root/scripts/mono-find-provides
diff options
context:
space:
mode:
authorPaul Nasrat <pnasrat@redhat.com>2007-05-10 13:15:34 +0100
committerPaul Nasrat <pnasrat@redhat.com>2007-05-10 13:15:34 +0100
commita94e9ed5c5df62dc2f917b1a3d3bc69cd7678c9a (patch)
tree3c8852197d6dc6aa6dc00decaff79820cb3af434 /scripts/mono-find-provides
parentc3524d91c7d47088eaf05e792c766067a0550d15 (diff)
downloadlibrpm-tizen-a94e9ed5c5df62dc2f917b1a3d3bc69cd7678c9a.tar.gz
librpm-tizen-a94e9ed5c5df62dc2f917b1a3d3bc69cd7678c9a.tar.bz2
librpm-tizen-a94e9ed5c5df62dc2f917b1a3d3bc69cd7678c9a.zip
Add mono req/provides support
Alexander Larsson alexl@redhat.com
Diffstat (limited to 'scripts/mono-find-provides')
-rw-r--r--scripts/mono-find-provides42
1 files changed, 42 insertions, 0 deletions
diff --git a/scripts/mono-find-provides b/scripts/mono-find-provides
new file mode 100644
index 000000000..2c808a038
--- /dev/null
+++ b/scripts/mono-find-provides
@@ -0,0 +1,42 @@
+#!/bin/bash
+#
+# mono-find-provides
+#
+# Authors:
+# Ben Maurer (bmaurer@ximian.com)
+#
+# (C) 2005 Novell (http://www.novell.com)
+#
+# Args: builddir buildroot libdir
+
+IFS=$'\n'
+filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
+monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
+
+# If monodis is in the package being installed, use that one
+# This is to support building mono
+build_bindir="$2/usr/bin"
+build_libdir="$2$3"
+
+if [ -x $build_bindir/monodis ]; then
+ monodis="$build_bindir/monodis"
+ export LD_LIBRARY_PATH=$build_libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
+elif [ -x /usr/bin/monodis ]; then
+ monodis="/usr/bin/monodis"
+else
+ exit 0;
+fi
+
+export MONO_SHARED_DIR=$1
+
+for i in "${monolist[@]}"; do
+ ($monodis --assembly $i | awk '
+ BEGIN { LIBNAME=""; VERSION=""; }
+ /^Version:/ { VERSION=$2 }
+ /^Name:/ { LIBNAME=$2 }
+ END {
+ if (VERSION && LIBNAME)
+ print "mono(" LIBNAME ") = " VERSION
+ }
+ ') 2>/dev/null
+done