[Pkg-mono-devel] dh_mono or something

Eduard Bloch edi@gmx.de
Fri, 11 Jun 2004 11:56:27 +0200


#include <hallo.h>
* Jackson Harper [Thu, Jun 10 2004, 08:46:47PM]:
> 
> This actually on the mono todo list
> (http://www.go-mono.com/mono-todo.html) scroll to Linker Tool. Post 1.0
> this might be one of my tasks, unless anyone from the community decides
> to start working on it.
> 
> Jackson

dh_mono on
http://svn.debian.org/viewcvs/pkg-mono/mono/trunk/debian/dh_mono does
thatr already but is not complete and was written when there was no
reliable way deal with different versions (GAC now) and required shared
libraries (custom .config files now). I am going to extend it in the
next days to scan for *.exe files, *.dll and *.config (for shared lib
references), then resolve shlib dependencies using dpkg-shlibdeps
algorithms. See below for an example.

The dependency strings for the each lib package should be declared the
same way as done by dpkg-shlibs method... read: each lib...-cli package
provides a lib...-cli.monolibs file (stored in /var/lib/dpkg/) and the
scan program in the customer packages resolves the required list of
.monolibs files and inserts the dependency data into some variable.
Planed anologs to shlibs system:

libPKG.shlibs <-> libPKG-cil.shlibs
dh_shlibdeps <-> dh_monolibdeps
dh_makeshlibs <-> dh_makemonolibs (which may generate "monolibs" data)
dpkg-builddeb <-> dh_installmonolibs (installation, merge with ....override)

The key package name is either 

 - changed with every incompatible major release of the lib (to keep
   multiple versions of a certain library) and also changed in the
   .monolibs file (= method A)

or, in the case of very few packages depending on this assembly so there is
no problem to stop providing the previous compatibility level, 

 - is kept as is and the compatibility is ensured by setting a
   "provides" entry with a detailful name (= method B)

I decided to go the second way for the Gtk# libs, but this may change in
future. 

EXAMPLE:
========

a frontend package using Gtk# libs needs this in debian/control:

  Depends: $(monolibs:Depends), foo, bar, other-stuff

and it needs to add one dh_monolibdeps call to debian/rules.

The library package (gtk-sharp) has this in debian/control:

Package: libgtk-cil
...
Provides: libgtk-cil-1.0

This would be set for a package with stable ABI. For a alpha status
package like it currently is, maintainer would use:
...
Provides: libgtk-cil-${mono:upVersion}

so only the package with compatibility data of this level is "provided"
(assuming that it breaks with every major upstream version).

The variable to substitute is set in debian/rules:
VERSION = $(shell dpkg-parsechangelog | grep ^Vers | cut -d\  -f2)
UPVERSION = $(shell echo $(VERSION) | sed 's,-.*,,')
...
        dh_gencontrol -i -- -Vmono:upVersion=$(UPVERSION)
        dh_installmonolibs

As said above, dh_monolibdeps is supposed to have following
functionality:

 - scan for .exe/.dll/.config files
 - extract the dependencies with monodis and shared-lib dependencies by
   looking at custom .config files; then caculate dependency strings for
   shared libs using .shlibs files (dpkg-like method) and for .NET
   assemblies using .monolibs files
 - write the calculated data to debian/substvars

dh_makemonolibs is to be used when maintainer does not want to maintain
debian/PKG.monolibs manually, and is supposed to have the following
functionality:

 - if DLLs as additional arguments found, install them with gacutil and
   continue
 - scans .dll/.config files
 - resolves the compatibility data, first
   looking in .config files (following the description on
   http://www.gotdotnet.com/team/changeinfo/default.aspx), then reading
   the version info with monodis, assuming a stable ABI 
 - write the data to debian/PKG.monolibs

And finaly, dh_installmonolibs has an easy task:

 - read data from debian/package.monolibs, then override with strings
   from debian/package.monolibs.override (if found), t installs the
   final .monolibs file to debian/package/DEBIAN/package.monolibs (to be
   picked up by dpkg-builddeb while cooking the package file).

So. And now about the format of .monolibs files... I think it should
contain enough data to distinguish between incompatible libs and that is
exactly what GAC does. So it would be something like:

Allegro.Drawing 4.0.2600.0__b03f5f7f11d50a3a liballegro-cil (>= 1.0.2)

Regards,
Eduard.
-- 
Zur Resignation gehört Charakter.
		-- Johann Wolfgang von Goethe