mono 1.2.5.1: added mono.bbclass, many changes required for packaging
authorHenryk Ploetz <henryk@openmoko.org>
Tue, 2 Oct 2007 18:51:53 +0000 (18:51 +0000)
committerCliff Brake <cbrake@bec-systems.com>
Tue, 2 Oct 2007 18:51:53 +0000 (18:51 +0000)
New file: packages/mono/mono-mcs-intermediate_1.2.5.1.bb
Compiles mono in native mode with standard prefix, then tars up the
resulting tree and puts the tarfile into staging
New file: packages/mono/mono_files.py
Automatically generated using collect-path.py (attached to this mail)
and contains a list that maps file patterns to package names (and
contained assemblies, see below).
New file: classes/mono.bbclass
Has a helper function for the list that maps file patterns to package
names and assemblies (see below). Also has a function mono_do_clilibs
and inserts that function into PACKAGEFUNCS. This function calls
mono_find_provides_and_requires which finds out (through calls to
monodis --assembly and monodis --assemblyref) which assemblies are
provided and required by a particular package. mono_do_clilibs then
puts the information about provided assemblies into
${STAGING_DIR}/clilibs/${packagename}.list and information about the
required packages into ${PKGDEST}/{packagename}.clilibdeps where it
will later be picked up by the modified read_shlibdeps.
Originally I had dependency resolution through the partial list in
mono_files.py but obviously this doens't scale, so I implemented the
new method with mono_do_clilibs. The benefit is now that I don't really
need the extra information in mono_files.py anymore and can in
principle get rid of mono_get_file_table and related code. Instead it
should be possible to modify collect-paths.py to output bitbake .inc
code (e.g. PACKAGES = "..." and a whole lot of FILES_... = "...")
instead of python code. There's still the minor problem of how to
handle the .mdb files, that's why I didn't implement it yet but instead
opted for an approach that I knew would work. (Debian just puts
the .mdb files into the individual packages, while I would argue that
they do belong into corresponding -dbg packages.)
Modified file: classes/package.bbclass
In read_shlibdeps I folded the two identical code blocks dealing with
*.shlibdeps and *.pcdeps into one and added *.clilibdeps (generated by
mono_do_clilibs above).
Modified file: packages/mono/mono_1.2.5.1.bb
Add the mono-mcs-intermediate workaround. Add a whole lot of python
code in populate_packages_prepend in order to split up the packages
based on information from mono_files.py (via mono.bbclass'
mono_get_file_table). As I said above a lot of this code can hopefully
be replaced in the future.

classes/mono.bbclass [new file with mode: 0644]
classes/package.bbclass
packages/mono/README
packages/mono/collect-paths.py [new file with mode: 0644]
packages/mono/mono-mcs-intermediate_1.2.5.1.bb [new file with mode: 0644]
packages/mono/mono_1.2.5.1.bb
packages/mono/mono_files.py [new file with mode: 0644]

diff --git a/classes/mono.bbclass b/classes/mono.bbclass
new file mode 100644 (file)
index 0000000..dcf5f72
--- /dev/null
@@ -0,0 +1,214 @@
+def mono_get_file_table(packageversion, d):
+       # The packageversion is currently ignored, but might be used in the future
+       # if more than one mono version is available and different versions
+       # need to use different tables
+
+       import bb, sys, os, glob, commands
+       curdir = os.path.dirname( bb.data.getVar('FILE', d, 1)  )
+       if curdir not in sys.path: sys.path.append( curdir )
+       from mono_files import debian_mono_file_table
+       
+       # mono-jay is not being built (for all platforms at least)
+       IGNORE = ("mono-jay", )
+       file_table = [
+           # Standard package
+           {"name": "mono-doc"},
+           
+           # Virtual packages
+           {"name": "mono"},
+           {"name": "mono-runtime"},
+           
+           # Not provided by Debian:
+           {"name": "libnunit2.2-cil",
+            "patterns": [
+              "/usr/lib/mono/gac/nunit.*/2.2.*",
+              "/usr/lib/mono/1.0/nunit.*.dll",
+              "/usr/lib/pkgconfig/mono-nunit.pc",
+             ],
+             "assemblies": [
+              ("nunit.core", "2.2.0.0"),
+              ("nunit.framework", "2.2.0.0"),
+              ("nunit.util", "2.2.0.0"),
+              ("nunit.mocks", "2.2.8.0"),
+             ],
+           },
+           {"name": "libmono-cecil0.5-cil",
+            "patterns": [
+             "/usr/lib/mono/gac/Mono.Cecil/0.5.*",
+            ],
+            "assemblies": [
+             ("Mono.Cecil", "0.5.*"),
+            ],
+           },
+           {"name": "libmono-db2-1.0-cil",
+            "patterns": [
+             "/usr/lib/mono/gac/IBM.Data.DB2/1.0*",
+             "/usr/lib/mono/1.0/IBM.Data.DB2.dll",
+            ],
+            "assemblies": [
+             ("IBM.Data.DB2", "1.0*"),
+            ],
+           },
+       ] + debian_mono_file_table
+       
+       file_table = [e for e in file_table
+               if not (e.has_key("name") and e["name"] in IGNORE)]
+       
+       return file_table
+
+def mono_find_provides_and_requires(files, d):
+       provides = []
+       requires = []
+       
+       import bb, os, commands
+       
+       pathprefix = "export PATH=%s; export LANG=; export LC_ALL=; " % bb.data.getVar('PATH', d, 1)
+       for filename in files:
+               if not filename.endswith(".dll") and not filename.endswith(".exe"):
+                       continue
+               if not os.path.isfile(filename) or os.path.islink(filename):
+                       continue
+               
+               ## Provides
+               name, version = None, None
+               
+               ret, result = commands.getstatusoutput("%smonodis --assembly '%s'" % (pathprefix, filename))
+               if ret:
+                       bb.error("raw_provides_and_requires: monodis --assembly '%s' failed, dependency information will be inaccurate" % filename)
+                       continue
+               for line in result.splitlines():
+                       if not ":" in line: continue
+                       key, value = line.split(":", 1)
+                       if key.strip() == "Name":
+                               name = value.strip()
+                       elif key.strip() == "Version":
+                               version = value.strip()
+               if name is not None and version is not None:
+                       if (name, version) not in provides:
+                               provides.append( (name, version) )
+       
+               ## Requires
+               name, version = None, None
+               ret, result = commands.getstatusoutput("%smonodis --assemblyref '%s'" % (pathprefix, filename))
+               if ret:
+                       bb.error("raw_provides_and_requires: monodis --assemblyref '%s' failed, dependency information will be inaccurate" % filename)
+                       continue
+               for line in result.splitlines():
+                       if not "=" in line: continue
+                       key, value = line.split("=", 1)
+                       if ":" in key and key.split(":",1)[1].strip() == "Version":
+                               version = value.strip()
+                       elif key.strip() == "Name":
+                               name = value.strip()
+                       if name is not None and version is not None:
+                               if (name, version) not in requires:
+                                       requires.append( (name, version) )
+                               name, version = None, None
+       
+       # Remove everything from requires that's already in provides as it's not actually required
+       # to be provided externally
+       requires = [e for e in requires if not e in provides]
+       return provides, requires
+
+python mono_do_clilibs() {
+       import bb, os, re, os.path
+
+       exclude_clilibs = bb.data.getVar('EXCLUDE_FROM_CLILIBS', d, 0)
+       if exclude_clilibs:
+               bb.note("not generating clilibs")
+               return
+               
+       lib_re = re.compile("^lib.*\.so")
+       libdir_re = re.compile(".*/lib$")
+
+       packages = bb.data.getVar('PACKAGES', d, 1)
+
+       workdir = bb.data.getVar('WORKDIR', d, 1)
+       if not workdir:
+               bb.error("WORKDIR not defined")
+               return
+
+       staging = bb.data.getVar('STAGING_DIR', d, 1)
+       if not staging:
+               bb.error("STAGING_DIR not defined")
+               return
+
+       pkgdest = bb.data.getVar('PKGDEST', d, 1)
+
+       clilibs_dir = os.path.join(staging, "clilibs")
+       bb.mkdirhier(clilibs_dir)
+
+       provides, requires = {}, {}
+       private_libs = bb.data.getVar('PRIVATE_CLILIBS', d, 1)
+       for pkg in packages.split():
+               bb.debug(2, "calculating clilib provides for %s" % pkg)
+
+               files_to_check = []
+               top = os.path.join(pkgdest, pkg)
+               for root, dirs, files in os.walk(top):
+                       for file in files:
+                               path = os.path.join(root, file)
+                               if file.endswith(".exe") or file.endswith(".dll"):
+                                       files_to_check.append( path )
+               provides[pkg], requires[pkg] = mono_find_provides_and_requires(files_to_check, d)
+               clilibs_file = os.path.join(clilibs_dir, pkg + ".list")
+               if os.path.exists(clilibs_file):
+                       os.remove(clilibs_file)
+               if len(provides[pkg]) > 0:
+                       fd = open(clilibs_file, 'w')
+                       for s in provides[pkg]:
+                               fd.write(" ".join(s) + '\n')
+                       fd.close()
+
+       clilib_provider = {}
+       list_re = re.compile('^(.*)\.list$')
+       for file in os.listdir(clilibs_dir):
+               m = list_re.match(file)
+               if m:
+                       dep_pkg = m.group(1)
+                       fd = open(os.path.join(clilibs_dir, file))
+                       lines = fd.readlines()
+                       fd.close()
+                       for l in lines:
+                               clilib_provider[tuple(l.rstrip().split())] = dep_pkg
+
+       for pkg in packages.split():
+               bb.debug(2, "calculating clilib requirements for %s" % pkg)
+
+               deps = []
+               for n in requires[pkg]:
+                       if n in clilib_provider.keys():
+                               dep_pkg = clilib_provider[n]
+
+                               if dep_pkg == pkg:
+                                       continue
+                               
+                               if not dep_pkg in deps:
+                                       deps.append(dep_pkg)
+                       else:
+                               bb.note("Couldn't find CLI library provider for %s" % n)
+
+               deps_file = os.path.join(pkgdest, pkg + ".clilibdeps")
+               if os.path.exists(deps_file):
+                       os.remove(deps_file)
+               if len(deps) > 0:
+                       fd = open(deps_file, 'w')
+                       for dep in deps:
+                               fd.write(dep + '\n')
+                       fd.close()
+}
+
+python() {
+       # Insert mono_do_clilibs into PACKAGEFUNCS
+       # Needs to be called after populate_packages, but before read_shlibdeps
+       PACKAGEFUNCS = bb.data.getVar("PACKAGEFUNCS", d, 1)
+       if PACKAGEFUNCS:
+               PACKAGEFUNCS = PACKAGEFUNCS.split()
+               if "read_shlibdeps" in PACKAGEFUNCS:
+                       i = PACKAGEFUNCS.index("read_shlibdeps")
+                       PACKAGEFUNCS.insert(i, "mono_do_clilibs")
+               elif "populate_packages" in PACKAGEFUNCS:
+                       i = PACKAGEFUNCS.index("populate_packages")
+                       PACKAGEFUNCS.insert(i+1, "mono_do_clilibs")
+               bb.data.setVar("PACKAGEFUNCS", " ".join(PACKAGEFUNCS), d)
+}
index 516cae8..b114049 100644 (file)
@@ -793,20 +793,14 @@ python read_shlibdeps () {
        packages = bb.data.getVar('PACKAGES', d, 1).split()
        for pkg in packages:
                rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "")
-               shlibsfile = bb.data.expand("${PKGDEST}/" + pkg + ".shlibdeps", d)
-               if os.access(shlibsfile, os.R_OK):
-                       fd = file(shlibsfile)
-                       lines = fd.readlines()
-                       fd.close()
-                       for l in lines:
-                               rdepends.append(l.rstrip())
-               pcfile = bb.data.expand("${PKGDEST}/" + pkg + ".pcdeps", d)
-               if os.access(pcfile, os.R_OK):
-                       fd = file(pcfile)
-                       lines = fd.readlines()
-                       fd.close()
-                       for l in lines:
-                               rdepends.append(l.rstrip())
+               for extension in ".shlibdeps", ".pcdeps", ".clilibdeps":
+                       depsfile = bb.data.expand("${PKGDEST}/" + pkg + extension, d)
+                       if os.access(depsfile, os.R_OK):
+                               fd = file(depsfile)
+                               lines = fd.readlines()
+                               fd.close()
+                               for l in lines:
+                                       rdepends.append(l.rstrip())
                bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d)
 }
 
index 3947930..c3043fa 100644 (file)
@@ -1,10 +1,39 @@
-Mono in OE is still very much a work in progress.
-1.2.4 
-  - is reported to work on MIPS.  
-  - has floating point problems on ARM
+Notes on Mono support in OE.
+
+===============================
+Cross Compiling Mono
+
+Cross compiling mono requires a two stage build because the mono mcs directory
+cannot be built while cross compiling (http://www.mono-project.com/Mono:ARM).
+The recommended way to cross compile mono is to 
+
+ 1. do a complete build on the host system, and install.  
+ 2. cross compile mono which will only build the native target code and 
+    overlay the target binaries on the host install.  
+
+The MCS build (step 1) is implemented by the mono-mcs-intermediate* recipe.
+This recipe is very similiar to the native build, except it uses standard
+install prefixes and the install directory is tar'd up, and placed in staging
+for use by the cross build.
+
+During the mono cross build, the first step during the install is to untar
+the install results of the mcs-intermediate build.  The cross build install
+then proceeds to overlay the native binaries in the install directory.
+
+================================
+mono.bbclass
+
+Has a helper function for the list that maps file patterns to package
+names and assemblies (see below). Also has a function mono_do_clilibs
+and inserts that function into PACKAGEFUNCS. This function calls
+mono_find_provides_and_requires which finds out (through calls to
+monodis --assembly and monodis --assemblyref) which assemblies are
+provided and required by a particular package. mono_do_clilibs then
+puts the information about provided assemblies into
+${STAGING_DIR}/clilibs/${packagename}.list and information about the
+required packages into ${PKGDEST}/{packagename}.clilibdeps where it
+will later be picked up by the modified read_shlibdeps.
+
 
-1.2.5
-  - tested on ARM EABI.  Floating point issues have been worked around.
 
-There is still a lot of packaging work that needs done to package the mono dll's for installation.
 
diff --git a/packages/mono/collect-paths.py b/packages/mono/collect-paths.py
new file mode 100644 (file)
index 0000000..a49b76e
--- /dev/null
@@ -0,0 +1,135 @@
+#!/usr/bin/env python
+
+## This utility takes the debian directory from an unpacked debian mono source tree
+## (e.g. apt-get source mono), parses the *.install files and generates python source
+## for a list of dictionaries that describe the individual packages and their contents
+## The output will look like
+##debian_mono_file_table = [
+##        {       'name': 'libmono-peapi1.0-cil',
+##                'patterns': [
+##                                '/usr/lib/mono/gac/PEAPI/1.0.*/',
+##                                '/usr/lib/mono/1.0/PEAPI.dll'
+##                        ],
+##                'assemblies': [
+##                                ('PEAPI', '1.0.*')
+##                        ]
+##        },
+##        {       'name': 'mono-mjs',
+##                'patterns': [
+##                                '/usr/bin/mjs',
+##                                '/usr/lib/mono/1.0/mjs.exe*'
+##                        ]
+##        },
+##....
+
+
+import os, sys, re
+
+def collect_paths(dir):
+    paths = {}
+    
+    os.chdir(dir)
+    for filename in os.listdir("."):
+        if filename.endswith(".install"):
+            fp = file(filename, "r")
+            lines = fp.readlines()
+            fp.close()
+            
+            contents = []
+            for line in lines:
+                lineparts = line.strip().split()
+                if lineparts[0].startswith("debian/tmp"):
+                    pattern = lineparts[0][ len("debian/tmp"): ]
+                    if len(lineparts) == 2:
+                        if not pattern.startswith(lineparts[1]):
+                            print >>sys.stderr, "Warning: Apparently I don't fully understand the format in file %s" % filename
+                    elif len(lineparts) > 2:
+                        print >>sys.stderr, "Warning: Apparently I don't fully understand the format in file %s" % filename
+                    
+                    contents.append( pattern )
+                else:
+                    print >>sys.stderr, "Note: Ignoring %s in %s" % (lineparts, filename)
+                
+            paths[ filename[ :-len(".install") ] ] = contents
+    
+    return paths
+
+def collect_packages(paths):
+    gac_re = re.compile(r'/usr/lib/mono/gac/(?P<assembly>[^/]+)/(?P<version>[^/]+)/?')
+    
+    # These packages should be populated first (e.g. because their files will otherwise end up
+    # in other packages)
+    PACKAGES_FIRST = ("mono-jit", "mono-gac", "mono-mjs", "mono-gmcs", "mono-utils", "mono-doc")
+    # These should be populated last (because their spec is very broad)
+    PACKAGES_LAST = ("mono-mcs", "libmono-system1.0-cil", "libmono-system2.0-cil", "libmono1.0-cil", "libmono2.0-cil")
+    first = []
+    last = []
+    packages = paths.keys()
+    for packagename in PACKAGES_FIRST + PACKAGES_LAST:
+        if packagename in packages:
+            packages.remove(packagename)
+            if packagename in PACKAGES_FIRST:
+                first.append(packagename)
+            else:
+                last.append(packagename)
+    packagenames = first + packages + last
+    
+    packages = []
+    for name in packagenames:
+        patterns = paths[ name ]
+        package = { "name": name,
+            "patterns": patterns}
+        
+        provided_assemblies = []
+        for pattern in patterns:
+            match = gac_re.match(pattern)
+            if match:
+                provided_assemblies.append( (match.group("assembly"), match.group("version")) )
+            if pattern == "/usr/lib/mono/1.0/mscorlib.dll*":
+                provided_assemblies.append( ("mscorlib", "1.0.*" ) )
+            elif pattern == "/usr/lib/mono/2.0/mscorlib.dll*":
+                provided_assemblies.append( ("mscorlib", "2.0.*" ) )
+        
+        if len(provided_assemblies) > 0:
+            package["assemblies"] = provided_assemblies
+        
+        packages.append(package)
+    
+    return packages
+
+if __name__ == "__main__":
+    packages = collect_packages( collect_paths(".") )
+    
+    if False: # Human-friendly
+        for package in packages:
+            print "Package: %s" % package["name"]
+            if package.has_key("provided_assemblies"):
+                print "Provides: \t%s" % ( "\n\t\t".join( [" ".join(e) for e in package["assemblies"] ] ) )
+            print "Patterns: \t\t%s" % ( "\n\t\t\t".join(package["patterns"]) )
+            print
+    else:
+        print "# This is a generated file, please do not edit directly"
+        print "# Use collect-paths.py instead. -- Henryk <henryk@openmoko.org>"
+        print "debian_mono_file_table = ["
+        print ",\n".join( 
+            [ 
+                "\t{\t%s\n\t}" % ",\n\t\t".join( 
+                    [
+                        "%r: %r" % (key, value)
+                        for key, value in package.items()
+                        if not isinstance(value, (list,tuple))
+                    ] + [
+                        "%r: [\n\t\t\t\t%s\n\t\t\t]" % (key, ",\n\t\t\t\t".join( [
+                                "%r"%(e,) for e in value
+                            ])
+                        )
+                        for key, value in package.items()
+                        if isinstance(value, (list,tuple))
+                    ]
+
+                )
+                for package in packages 
+            ]
+        )
+        print "]"
+    
diff --git a/packages/mono/mono-mcs-intermediate_1.2.5.1.bb b/packages/mono/mono-mcs-intermediate_1.2.5.1.bb
new file mode 100644 (file)
index 0000000..07f9387
--- /dev/null
@@ -0,0 +1,59 @@
+# This is a straw-man recipe for step 1 in the two-step build of
+# mono. Because it's impossible to build the mcs directory
+# in cross-compile mode, this recipe will do a native build,
+# then tar the resulting install tree for usage by the mono
+# package in step 2.
+# See http://www.mono-project.com/Mono:ARM
+
+require mono_1.2.5.inc
+PR = "r0"
+DEPENDS = "mono-native glib-2.0-native"
+
+SRC_URI += "file://mono-fix-libdir-path.patch;patch=1"
+
+# Inherit native to set up compiler and paths ...
+inherit native
+# ... but override the target prefix
+prefix = "/usr"
+exec_prefix = "/usr"
+sysconfdir = "/etc"
+# TODO: Where does the mono package get
+# these paths from? Use the same source.
+
+do_fix_libtool_name() {
+       # inherit native will make that all native tools that are being
+       # built are prefixed with something like "i686-linux-",
+       # including libtool. Fix up some hardcoded libtool names:
+       for i in "${S}"/runtime/*-wrapper.in; do
+               sed -e "s/libtool/${BUILD_SYS}-libtool/" -i "${i}"
+       done
+}
+addtask fix_libtool_name after do_patch before do_configure
+
+do_stage() {
+       true
+}
+
+do_install() {
+       oe_runmake 'DESTDIR=${D}' install
+}
+
+do_package() {
+       true
+}
+
+do_populate_staging() {
+       cd ${D}
+       rm -f ${WORKDIR}/mono-mcs-${PV}.tar.gz
+       tar -cvzf ${WORKDIR}/mono-mcs-${PV}.tar.gz .
+       install -d ${STAGING_DIR}/share/mono-mcs
+       cp ${WORKDIR}/mono-mcs-${PV}.tar.gz ${STAGING_DIR}/share/mono-mcs/
+}
+
+do_package_write_ipk() {
+       true
+}
+
+do_package_write() {
+       true
+}
index e1f3f1b..53a671c 100644 (file)
 require mono_1.2.5.inc
 
-DEPENDS = "mono-native glib-2.0"
+DEPENDS = "mono-native mono-mcs-intermediate glib-2.0"
 
-PR = "r1"
+PR = "r2"
 
 SRC_URI += "file://configure.patch;patch=1"
 
+# Per http://www.mono-project.com/Mono:ARM
+EXTRA_OECONF += " --disable-mcs-build "
+# Instead, get the mcs tree from a different build (see mono-mcs-intermediate)
+
+do_install_prepend() {
+       install -d ${D}
+       pushd ${D}
+       tar -xzf ${STAGING_DIR}/share/mono-mcs/mono-mcs-${PV}.tar.gz
+       popd
+}
+
 do_install_append() {
-       install -d ${D}${libdir}/mono/1.0/
-       cp ${S}/mcs/class/lib/monolite/* ${D}${libdir}/mono/1.0/
+       # mono-mcs-intermediate builds and installs jay (a Yacc for Java and C#),
+       # however, jay is not being cross-compiled and thus only
+       # available for the buildhost architecture, so remove it
+       # entirely
+       pushd ${D}
+       rm -rf ./usr/share/man/man1/jay.1 ./usr/share/jay \
+           ./usr/share/jay/README.jay \
+           ./usr/bin/jay
+       popd
+
+       # Not packaged with the default rules and apparently
+       # not used for anything
+       rm -rf ${D}${datadir}/mono-1.0/mono/cil/cil-opcodes.xml
 }
 
-EXTRA_OECONF += " --disable-mcs-build "
+inherit mono
+PACKAGES = "${@" ".join([e["name"] for e in mono_get_file_table(bb.data.getVar('PV', d, 1), d) if e.has_key("name")])}"
 
-PACKAGES =+ "mono-dll"
-FILES_mono-dll = "${libdir}/mono/1.0/"
+FILES_mono-doc_append = " /usr/share/libgc-mono/ "
 
+FILES_mono = "" # Apparently this gets ignored, so I'm setting it again below
+ALLOW_EMPTY_mono = "1"
+RDEPENDS_mono = "mono-common mono-jit"
 
+FILES_mono-runtime = ""
+ALLOW_EMPTY_mono-runtime = "1"
+RDEPENDS_mono-runtime = "mono-jit mono-gac"
+
+RDEPENDS_mono-jit = "mono-common"
+
+FILES_libmono-dev = "/usr/lib/libmono.la /usr/lib/libmono-profiler-cov.la /usr/lib/libmono-profiler-aot.la \
+       /usr/lib/libMonoPosixHelper.la /usr/lib/libMonoSupportW.la"
+FILES_libmono-dbg = "/usr/lib/.debug/libmono*.so.* /usr/lib/.debug/libikvm-native.so \
+       /usr/lib/.debug/libMonoPosixHelper.so /usr/lib/.debug/libMonoSupportW.so"
+
+python populate_packages_prepend () {
+       def fillin_packages():
+               # A lot of this code can probably be replaced with less code and some
+               # calls to do_split_packages
+               import bb, sys, os, glob, commands
+               
+               PV = bb.data.getVar('PV', d, 1)
+               
+               file_table = mono_get_file_table(PV, d)
+               packages_to_add = []
+               
+               D = bb.data.getVar('D', d, 1)
+               if not D: return
+               D = D + "/"
+               
+               def classify_files(files):
+                       normal, dev, dbg, doc = [], [], [], []
+                       for filename in files:
+                               if filename.endswith(".mdb"):
+                                       dbg.append(filename)
+                               elif os.path.basename( os.path.dirname( filename ) ) == ".debug":
+                                       dbg.append(filename)
+                               elif filename.endswith(".pc"):
+                                       dev.append(filename)
+                               else:
+                                       normal.append(filename)
+                       return normal, dev, dbg, doc
+               
+               def will_strip(filename):
+                       # From package.bbclass function runstrip
+                       pathprefix = "export PATH=%s; " % bb.data.getVar('PATH', d, 1)
+                       ret, result = commands.getstatusoutput("%sfile '%s'" % (pathprefix, filename))
+                       if "not stripped" in result:
+                               return True
+                       else:
+                               return False
+
+               def append(name, value):
+                       oldvalue = bb.data.getVar(name, d, 1) or ""
+                       newvalue = " ".join([oldvalue, value])
+                       bb.data.setVar(name, newvalue, d)
+               
+               already_covered = []
+               for package in file_table:
+                       pn = package["name"]
+                       if package.has_key("patterns"):
+                               files = []
+                               for pattern in package["patterns"]:
+                                       matching = glob.glob( D + pattern )
+                                       for filename in matching:
+                                               if os.path.isdir(filename):
+                                                       for dirpath, dirnames, filenames in os.walk(filename):
+                                                               for f in filenames:
+                                                                       debugname = os.path.join(dirpath, ".debug", f)
+                                                                       fullname =  os.path.join(dirpath, f)
+                                                                       files.append(fullname)
+                                                                       if will_strip(fullname):
+                                                                               files.append(debugname)
+                                               else:
+                                                   files.append(filename)
+                               
+                               # Remove the D prefix
+                               files = [ e[len(D):] for e in files ]
+                               
+                               # Remove files that have already been placed in other packages
+                               files = [ e for e in files if not e in already_covered ]
+                               already_covered.extend( files )
+                               
+                               if pn.endswith("-dev") or pn.endswith("-dbg") or pn.endswith("-doc"):
+                                       normal, dev, dbg, doc = files, [], [], []
+                               else:
+                                       normal, dev, dbg, doc = classify_files(files)
+                               
+                               for extension, filelist in [ ("",normal), ("-dev", dev), ("-dbg", dbg), ("-doc", doc)]:
+                                       if len(filelist) > 0:
+                                               packagename = pn + extension
+                                               append("FILES_%s" % packagename, " ".join(filelist))
+                                               bb.debug(2, "%s\n\t%s" %( packagename, "\n\t".join( filelist ) ))
+                                               if not packagename in packages_to_add:
+                                                       packages_to_add.append(packagename)
+                               
+                       else:
+                               packages_to_add.append(pn)
+               
+               # mono is just a stub package
+               bb.data.setVar("FILES_mono", "", d)
+               
+               bb.data.setVar("PACKAGES", " ".join(packages_to_add), d)
+       fillin_packages()
+}
diff --git a/packages/mono/mono_files.py b/packages/mono/mono_files.py
new file mode 100644 (file)
index 0000000..6e67374
--- /dev/null
@@ -0,0 +1,605 @@
+# This is a generated file, please do not edit directly
+# Use collect-paths.py instead. -- Henryk <henryk@openmoko.org>
+debian_mono_file_table = [
+       {       'name': 'mono-jit',
+               'patterns': [
+                               '/usr/bin/mono'
+                       ]
+       },
+       {       'name': 'mono-gac',
+               'patterns': [
+                               '/usr/bin/gacutil',
+                               '/usr/lib/mono/1.0/gacutil.exe'
+                       ]
+       },
+       {       'name': 'mono-mjs',
+               'patterns': [
+                               '/usr/bin/mjs',
+                               '/usr/lib/mono/1.0/mjs.exe*'
+                       ]
+       },
+       {       'name': 'mono-gmcs',
+               'patterns': [
+                               '/usr/bin/gmcs',
+                               '/usr/bin/wsdl2',
+                               '/usr/bin/monop2',
+                               '/usr/bin/ilasm2',
+                               '/usr/bin/resgen2',
+                               '/usr/bin/mono-api-info2',
+                               '/usr/bin/mono-service2',
+                               '/usr/bin/mkbundle2',
+                               '/usr/bin/xbuild',
+                               '/usr/bin/sgen',
+                               '/usr/bin/al2',
+                               '/usr/bin/httpcfg',
+                               '/usr/lib/mono/2.0/*.exe*',
+                               '/usr/lib/mono/2.0/xbuild.rsp',
+                               '/usr/lib/mono/2.0/MSBuild/',
+                               '/usr/lib/mono/2.0/Microsoft.Build.xsd',
+                               '/usr/lib/mono/2.0/Microsoft.CSharp.targets',
+                               '/usr/lib/mono/2.0/Microsoft.Common.tasks',
+                               '/usr/lib/mono/2.0/Microsoft.Common.targets',
+                               '/usr/lib/mono/2.0/Microsoft.VisualBasic.targets'
+                       ]
+       },
+       {       'name': 'mono-utils',
+               'patterns': [
+                               '/usr/bin/pedump',
+                               '/usr/bin/monodis',
+                               '/usr/bin/monograph',
+                               '/usr/bin/mono-find-provides',
+                               '/usr/bin/mono-find-requires'
+                       ]
+       },
+       {       'name': 'libmono-peapi1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/PEAPI/1.0.*/',
+                               '/usr/lib/mono/1.0/PEAPI.dll'
+                       ],
+               'assemblies': [
+                               ('PEAPI', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-cairo1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Mono.Cairo/1.0.*/',
+                               '/usr/lib/mono/1.0/Mono.Cairo.dll',
+                               '/usr/lib/pkgconfig/mono-cairo.pc'
+                       ],
+               'assemblies': [
+                               ('Mono.Cairo', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-system-web2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/System.Web/2.0.*/',
+                               '/usr/lib/mono/gac/System.Web.Services/2.0.*/',
+                               '/usr/lib/mono/2.0/System.Web.dll',
+                               '/usr/lib/mono/2.0/System.Web.Services.dll'
+                       ],
+               'assemblies': [
+                               ('System.Web', '2.0.*'),
+                               ('System.Web.Services', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono-accessibility2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Accessibility/2.0.*/',
+                               '/usr/lib/mono/2.0/Accessibility.dll'
+                       ],
+               'assemblies': [
+                               ('Accessibility', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono-microsoft7.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Microsoft.JScript/7.0.*/',
+                               '/usr/lib/mono/gac/Microsoft.VisualC/7.0.*/',
+                               '/usr/lib/mono/gac/Microsoft.Vsa/7.0.*/',
+                               '/usr/lib/mono/1.0/Microsoft.JScript.dll',
+                               '/usr/lib/mono/1.0/Microsoft.VisualC.dll',
+                               '/usr/lib/mono/1.0/Microsoft.Vsa.dll'
+                       ],
+               'assemblies': [
+                               ('Microsoft.JScript', '7.0.*'),
+                               ('Microsoft.VisualC', '7.0.*'),
+                               ('Microsoft.Vsa', '7.0.*')
+                       ]
+       },
+       {       'name': 'libmono-winforms2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/System.Windows.Forms/2.0.*/',
+                               '/usr/lib/mono/gac/System.Drawing.Design/2.0.*/',
+                               '/usr/lib/mono/gac/System.Design/2.0.*/',
+                               '/usr/lib/mono/2.0/System.Windows.Forms.dll',
+                               '/usr/lib/mono/2.0/System.Drawing.Design.dll',
+                               '/usr/lib/mono/2.0/System.Design.dll'
+                       ],
+               'assemblies': [
+                               ('System.Windows.Forms', '2.0.*'),
+                               ('System.Drawing.Design', '2.0.*'),
+                               ('System.Design', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono-ldap1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Novell.Directory.Ldap/1.0.*/',
+                               '/usr/lib/mono/1.0/Novell.Directory.Ldap.dll'
+                       ],
+               'assemblies': [
+                               ('Novell.Directory.Ldap', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-sharpzip2.84-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.84.*/',
+                               '/usr/lib/mono/2.0/ICSharpCode.SharpZipLib.dll'
+                       ],
+               'assemblies': [
+                               ('ICSharpCode.SharpZipLib', '2.84.*')
+                       ]
+       },
+       {       'name': 'libmono-system-data2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/System.Data/2.0.*/',
+                               '/usr/lib/mono/2.0/System.Data.dll'
+                       ],
+               'assemblies': [
+                               ('System.Data', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono-corlib2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/I18N*/2.0.*/',
+                               '/usr/lib/mono/2.0/I18N*.dll',
+                               '/usr/lib/mono/2.0/mscorlib.dll*'
+                       ],
+               'assemblies': [
+                               ('I18N*', '2.0.*'),
+                               ('mscorlib', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono-winforms1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/System.Windows.Forms/1.0.*/',
+                               '/usr/lib/mono/gac/System.Drawing.Design/1.0.*/',
+                               '/usr/lib/mono/gac/System.Design/1.0.*/',
+                               '/usr/lib/mono/1.0/System.Windows.Forms.dll',
+                               '/usr/lib/mono/1.0/System.Drawing.Design.dll',
+                               '/usr/lib/mono/1.0/System.Design.dll'
+                       ],
+               'assemblies': [
+                               ('System.Windows.Forms', '1.0.*'),
+                               ('System.Drawing.Design', '1.0.*'),
+                               ('System.Design', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-microsoft8.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Microsoft.JScript/8.0.*/',
+                               '/usr/lib/mono/gac/Microsoft.VisualC/8.0.*/',
+                               '/usr/lib/mono/gac/Microsoft.Vsa/8.0.*/',
+                               '/usr/lib/mono/2.0/Microsoft.JScript.dll',
+                               '/usr/lib/mono/2.0/Microsoft.VisualC.dll',
+                               '/usr/lib/mono/2.0/Microsoft.Vsa.dll'
+                       ],
+               'assemblies': [
+                               ('Microsoft.JScript', '8.0.*'),
+                               ('Microsoft.VisualC', '8.0.*'),
+                               ('Microsoft.Vsa', '8.0.*')
+                       ]
+       },
+       {       'name': 'libmono-corlib1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/I18N*/1.0.*/',
+                               '/usr/lib/mono/1.0/I18N*.dll',
+                               '/usr/lib/mono/1.0/mscorlib.dll*'
+                       ],
+               'assemblies': [
+                               ('I18N*', '1.0.*'),
+                               ('mscorlib', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-system-web1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/System.Web/1.0.*/',
+                               '/usr/lib/mono/gac/System.Web.Services/1.0.*/',
+                               '/usr/lib/mono/1.0/System.Web.dll',
+                               '/usr/lib/mono/1.0/System.Web.Services.dll'
+                       ],
+               'assemblies': [
+                               ('System.Web', '1.0.*'),
+                               ('System.Web.Services', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-system-runtime2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/System.Runtime.*/2.0.*/',
+                               '/usr/lib/mono/2.0/System.Runtime.*.dll'
+                       ],
+               'assemblies': [
+                               ('System.Runtime.*', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono-cscompmgd8.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/cscompmgd/8.0.*/',
+                               '/usr/lib/mono/2.0/cscompmgd.dll'
+                       ],
+               'assemblies': [
+                               ('cscompmgd', '8.0.*')
+                       ]
+       },
+       {       'name': 'libmono-cscompmgd7.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/cscompmgd/7.0.*/',
+                               '/usr/lib/mono/1.0/cscompmgd.dll'
+                       ],
+               'assemblies': [
+                               ('cscompmgd', '7.0.*')
+                       ]
+       },
+       {       'name': 'libmono-firebirdsql1.7-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/FirebirdSql.Data.Firebird/1.7.*/',
+                               '/usr/lib/mono/1.0/FirebirdSql.Data.Firebird.dll'
+                       ],
+               'assemblies': [
+                               ('FirebirdSql.Data.Firebird', '1.7.*')
+                       ]
+       },
+       {       'name': 'mono-jay',
+               'patterns': [
+                               '/usr/bin/jay'
+                       ]
+       },
+       {       'name': 'libmono-data-tds1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Mono.Data.Tds/1.0.*/',
+                               '/usr/lib/mono/1.0/Mono.Data.Tds.dll'
+                       ],
+               'assemblies': [
+                               ('Mono.Data.Tds', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-sqlite1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Mono.Data.Sqlite/1.0.*/',
+                               '/usr/lib/mono/gac/Mono.Data.SqliteClient/1.0.*/',
+                               '/usr/lib/mono/1.0/Mono.Data.Sqlite.dll',
+                               '/usr/lib/mono/1.0/Mono.Data.SqliteClient.dll'
+                       ],
+               'assemblies': [
+                               ('Mono.Data.Sqlite', '1.0.*'),
+                               ('Mono.Data.SqliteClient', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-relaxng1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Commons.Xml.Relaxng/1.0.*/',
+                               '/usr/lib/mono/1.0/Commons.Xml.Relaxng.dll'
+                       ],
+               'assemblies': [
+                               ('Commons.Xml.Relaxng', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-dev',
+               'patterns': [
+                               '/usr/lib/libmono*.a',
+                               '/usr/lib/libMono*.a',
+                               '/usr/lib/libmono*.so',
+                               '/usr/lib/libMonoSupportW.a',
+                               '/usr/lib/pkgconfig/mono.pc',
+                               '/usr/lib/pkgconfig/dotnet.pc',
+                               '/usr/include/'
+                       ]
+       },
+       {       'name': 'libmono-accessibility1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Accessibility/1.0.*/',
+                               '/usr/lib/mono/1.0/Accessibility.dll'
+                       ],
+               'assemblies': [
+                               ('Accessibility', '1.0.*')
+                       ]
+       },
+       {       'name': 'mono-common',
+               'patterns': [
+                               '/etc/mono',
+                               '/usr/share/mono-1.0/mono/cil/cil-opcodes.xml'
+                       ]
+       },
+       {       'name': 'libmono-oracle1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/System.Data.OracleClient/1.0.*/',
+                               '/usr/lib/mono/1.0/System.Data.OracleClient.dll'
+                       ],
+               'assemblies': [
+                               ('System.Data.OracleClient', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-system-data1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/System.Data/1.0.*/',
+                               '/usr/lib/mono/1.0/System.Data.dll'
+                       ],
+               'assemblies': [
+                               ('System.Data', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-bytefx0.7.6.2-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/ByteFX.Data/0.7.6.2*/',
+                               '/usr/lib/mono/2.0/ByteFX.Data.dll'
+                       ],
+               'assemblies': [
+                               ('ByteFX.Data', '0.7.6.2*')
+                       ]
+       },
+       {       'name': 'libmono0',
+               'patterns': [
+                               '/usr/lib/libmono*.so.*',
+                               '/usr/lib/libMonoPosixHelper.so',
+                               '/usr/lib/libMonoSupportW.so'
+                       ]
+       },
+       {       'name': 'libmono-sharpzip0.6-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.6.*/',
+                               '/usr/lib/mono/compat-1.0/ICSharpCode.SharpZipLib.dll'
+                       ],
+               'assemblies': [
+                               ('ICSharpCode.SharpZipLib', '0.6.*')
+                       ]
+       },
+       {       'name': 'libmono-data-tds2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Mono.Data.Tds/2.0.*/',
+                               '/usr/lib/mono/2.0/Mono.Data.Tds.dll'
+                       ],
+               'assemblies': [
+                               ('Mono.Data.Tds', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono-system-messaging1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/System.Messaging/1.0.*/',
+                               '/usr/lib/mono/1.0/System.Messaging.dll'
+                       ],
+               'assemblies': [
+                               ('System.Messaging', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-npgsql1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Npgsql/1.0.*/',
+                               '/usr/lib/mono/1.0/Npgsql.dll'
+                       ],
+               'assemblies': [
+                               ('Npgsql', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-security2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Mono.Security/2.0.*/',
+                               '/usr/lib/mono/2.0/Mono.Security.dll'
+                       ],
+               'assemblies': [
+                               ('Mono.Security', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono-security1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Mono.Security/1.0.*/',
+                               '/usr/lib/mono/1.0/Mono.Security.dll'
+                       ],
+               'assemblies': [
+                               ('Mono.Security', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-bytefx0.7.6.1-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/ByteFX.Data/0.7.6.1*/',
+                               '/usr/lib/mono/1.0/ByteFX.Data.dll'
+                       ],
+               'assemblies': [
+                               ('ByteFX.Data', '0.7.6.1*')
+                       ]
+       },
+       {       'name': 'libmono-microsoft-build2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Microsoft.Build.*/2.0.*/',
+                               '/usr/lib/mono/2.0/Microsoft.Build.*.dll'
+                       ],
+               'assemblies': [
+                               ('Microsoft.Build.*', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono-system-ldap1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/System.DirectoryServices/1.0.*/',
+                               '/usr/lib/mono/1.0/System.DirectoryServices.dll'
+                       ],
+               'assemblies': [
+                               ('System.DirectoryServices', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-relaxng2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Commons.Xml.Relaxng/2.0.*/',
+                               '/usr/lib/mono/2.0/Commons.Xml.Relaxng.dll'
+                       ],
+               'assemblies': [
+                               ('Commons.Xml.Relaxng', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono-system-ldap2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/System.DirectoryServices/2.0.*/',
+                               '/usr/lib/mono/2.0/System.DirectoryServices.dll'
+                       ],
+               'assemblies': [
+                               ('System.DirectoryServices', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono-system-messaging2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/System.Messaging/2.0.*/',
+                               '/usr/lib/mono/2.0/System.Messaging.dll'
+                       ],
+               'assemblies': [
+                               ('System.Messaging', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono-sharpzip0.84-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.84.*/',
+                               '/usr/lib/mono/1.0/ICSharpCode.SharpZipLib.dll'
+                       ],
+               'assemblies': [
+                               ('ICSharpCode.SharpZipLib', '0.84.*')
+                       ]
+       },
+       {       'name': 'libmono-sqlite2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Mono.Data.Sqlite/2.0.*/',
+                               '/usr/lib/mono/gac/Mono.Data.SqliteClient/2.0.*/',
+                               '/usr/lib/mono/2.0/Mono.Data.Sqlite.dll',
+                               '/usr/lib/mono/2.0/Mono.Data.SqliteClient.dll'
+                       ],
+               'assemblies': [
+                               ('Mono.Data.Sqlite', '2.0.*'),
+                               ('Mono.Data.SqliteClient', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono-ldap2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Novell.Directory.Ldap/2.0.*/',
+                               '/usr/lib/mono/2.0/Novell.Directory.Ldap.dll'
+                       ],
+               'assemblies': [
+                               ('Novell.Directory.Ldap', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono-npgsql2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Npgsql/2.0.*/',
+                               '/usr/lib/mono/2.0/Npgsql.dll'
+                       ],
+               'assemblies': [
+                               ('Npgsql', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono-system-runtime1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/System.Runtime.*/1.0.*/',
+                               '/usr/lib/mono/1.0/System.Runtime.*.dll'
+                       ],
+               'assemblies': [
+                               ('System.Runtime.*', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-oracle2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/System.Data.OracleClient/2.0.*/',
+                               '/usr/lib/mono/2.0/System.Data.OracleClient.dll'
+                       ],
+               'assemblies': [
+                               ('System.Data.OracleClient', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono-c5-1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Mono.C5/1.0.*/',
+                               '/usr/lib/mono/2.0/Mono.C5.dll'
+                       ],
+               'assemblies': [
+                               ('Mono.C5', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-sharpzip2.6-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.6.*/',
+                               '/usr/lib/mono/compat-2.0/ICSharpCode.SharpZipLib.dll'
+                       ],
+               'assemblies': [
+                               ('ICSharpCode.SharpZipLib', '2.6.*')
+                       ]
+       },
+       {       'name': 'libmono-cairo2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Mono.Cairo/2.0.*/',
+                               '/usr/lib/mono/2.0/Mono.Cairo.dll'
+                       ],
+               'assemblies': [
+                               ('Mono.Cairo', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono-peapi2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/PEAPI/2.0.*/',
+                               '/usr/lib/mono/2.0/PEAPI.dll'
+                       ],
+               'assemblies': [
+                               ('PEAPI', '2.0.*')
+                       ]
+       },
+       {       'name': 'mono-mcs',
+               'patterns': [
+                               '/usr/bin/',
+                               '/usr/lib/mono/1.0/*.exe*'
+                       ]
+       },
+       {       'name': 'libmono-system1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/System*/1.0.*/',
+                               '/usr/lib/mono/gac/CustomMarshalers/1.0.*/',
+                               '/usr/lib/mono/1.0/System*.dll',
+                               '/usr/lib/mono/1.0/CustomMarshalers.dll*'
+                       ],
+               'assemblies': [
+                               ('System*', '1.0.*'),
+                               ('CustomMarshalers', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono-system2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/System*/2.0.*/',
+                               '/usr/lib/mono/gac/CustomMarshalers/2.0.*/',
+                               '/usr/lib/mono/2.0/System*.dll',
+                               '/usr/lib/mono/2.0/CustomMarshalers.dll*'
+                       ],
+               'assemblies': [
+                               ('System*', '2.0.*'),
+                               ('CustomMarshalers', '2.0.*')
+                       ]
+       },
+       {       'name': 'libmono1.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Mono.*/1.0.*/',
+                               '/usr/lib/mono/gac/OpenSystem.C/1.0.*',
+                               '/usr/lib/mono/gac/mono-service/1.0.*/',
+                               '/usr/lib/mono/1.0/Mono.*.dll',
+                               '/usr/lib/mono/1.0/OpenSystem.C.dll'
+                       ],
+               'assemblies': [
+                               ('Mono.*', '1.0.*'),
+                               ('OpenSystem.C', '1.0.*'),
+                               ('mono-service', '1.0.*')
+                       ]
+       },
+       {       'name': 'libmono2.0-cil',
+               'patterns': [
+                               '/usr/lib/mono/gac/Mono.*/2.0.*/',
+                               '/usr/lib/mono/gac/OpenSystem.C/2.0.*',
+                               '/usr/lib/mono/gac/mono-service/2.0.*/',
+                               '/usr/lib/mono/2.0/Mono.*.dll',
+                               '/usr/lib/mono/2.0/OpenSystem.C.dll'
+                       ],
+               'assemblies': [
+                               ('Mono.*', '2.0.*'),
+                               ('OpenSystem.C', '2.0.*'),
+                               ('mono-service', '2.0.*')
+                       ]
+       }
+]