[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ next ]
This section describes the additions to the
Debian Policy that
are required for CLI packages.
For packages that consist of 100% managed code, "Architecture: all" must be chosen in debian/control.
Packages containing a mix of managed and native code must be "Architecure: any" or depending on the specific package a more restricted set of architectures is valid.
The package's applications, libraries and meta-data must be installed
Libraries that will be installed into the GAC must be installed into
(for more details about the X.Y version see GAC versioning). assembly_name
is the assembly name without the file extension (.dll). The commonly seen
path should only be used for Mono project packages.
Example path for the
Never install native "glue" libraries into
instead install them at
When moving libraries update the references to the new location using a DLL
Map. See the Mono DLL maps section
for an example.
The only exception here is for native libraries that are of wider use; can be
used other packages. Native libraries should be packaged according to the
Packaging Guide in a Debain Policy conformant way.
You must not install application files (
/usr/bin. Instead create a wrapper script into
/usr/bin to allow them to be run without path and the
Source code files (
etc.) should be non-executable.
Library files (
*.dll) should be non-executable.
Debug symbol files (
*.mdb) should be non-executable.
Assembly config files (
*.config) should be non-executable.
Application files (
*.exe) must have the executable flag
(+x) set to enable compatiblity with direct invokation as
./foo.exe using Linux's BINFMT support.
To ensure that all files have correct permissions, you should use
/usr/bin/dh combined with
Otherwise you should add
dh_fixperms in the binary-* targets of
At a minimum, CLI packages should Build-Depends on
cli-common-dev (>= 0.7) and the appropriate CLI compiler or CLI
Current CLI compilers in Debian:
mono-mcs (>= 1.0) | c-sharp-compiler
mono-gmcs (>= 1.1.8) | c-sharp-2.0-compiler
mono-gmcs (>= 1.2.5) | c-sharp-3.0-compiler
nemerle (>= 0.9)
boo (>= 0.5.6)
Current CLI SDKs in Debian:
mono-devel (>= 220.127.116.11)
Software that uses Mono via the C interface library (
or requires the
/usr/lib/pkgconfig/mono.pc file must
Build-Depends on libmono-dev (>= 1.0)
Note that there are architectures for which no CLR is available and thus you may have to restrict the Build-Depends for your package to the architectures available.
If your package is
Architecture: all, you should specify this as
Build-Depends-Indep. Never put
quilt into Build-Depends-Indep. See the
Policy Manual for more information on this.
Libraries that are installed into the GAC should provide decent ABI stability and be useful for other packages. Otherwise, they should remain private to the package.
Libraries that are installed into the GAC must be strong-named, i.e. signed.
Libraries must to be installed into the GAC at package install time
(postinst) which is provided by the dh_installcligac tool of the
Each of the libraries in the GAC has an assembly version number that consists of 4 parts (major, minor, build and revision number). When loading libraries from the GAC all 4 parts and the public signing key fingerprint must match.
It is general practice and
by Microsoft that a library is ABI compatible when only the build
and revision number change and the major and minor number stay the same.
The library package name must be prefixed with
To reflect the ABI stability and prevent breakages when a ABI-incompatible
version is released, a similar solution for
library packages is used. The major and minor number must
mirror the SONAME version and the resulting package name should be
libfooX.Y-cil, where X is the major and Y the minor number of the
One notable exception for this naming are assemblies that end on a number
(Mono.C5 for example). In this case the package should be named
improve the readability.
-cil suffix is chosen to prevent confusion with native library
package names. Never use "sharp" in the package name as it does not
represent the language, and a CLI library can
be used with all CLI implemented / enabled
languages such as C#, IronPython, IronRuby, Boo, Nemerle, J#, VB.NET (
Unnecessary package renames should be avoided. Existing package names that do not follow this policy should not be renamed until the next incompatible ABI change, at which point the new naming scheme should be used.
If the upstream software does not use major and minor number to reflect ABI
stability or breaks ABI with a change in build or revision, the package
must be renamed to either
libfooA.B.C.D-cil (where A, B, C, D are the complete assembly
version numbers), depending at which point (major or minor) the breakage
occurred. All Policy Files must be
dropped at this stage until a new major or minor version is released.
The upstream software may use wildcards in the assembly versions (1.2.* for example) which are filled by the compiler with a random value. You must replace these wildcards with 0 (18.104.22.168 in the example) to make it possible to use Policy Files and make predictable version numbers.
More than one library can be installed in one package but it is required that they must all have the same assembly version and belong together.
As explained above a exact match of the version number is required to load a
library from the GAC. To override this
behaviour and make different versions of ABI-compatible library packages really
ABI-compatible you have to use
Files. These files have to be named
(where X and Y are the major and minor number of the assembly it should be
compatible with), it must be signed with the same signing key as the
original assembly and it must be installed into the GAC. For information on how to create policy
files look at the previous Policy Files link or at the example below.
Overriding the GAC policy should only be done
when the different library versions are really ABI-compatible. This can be
checked using mono-api-check of the
mono-devel package. You must also raise the version in
the clilibs control file to the minimum
version when new interfaces/classes/methods were added.
clilibs control file MUST be present in all GAC library packages. It can be created with
the dh_makeclilibs helper
script and has a format similar to the
shlibs file created by
dh_makeshlibs(1) and also has a similar use: it is used by dh_clideps helper script to find the
You should always set the minimum required version of the library in
Many libraries deliver a
.pc file for use by the
pkg-config helper utility, which aids other libraries and
applications to link against libraries.
All GAC library packages should have a pkg-config
.pc file located
/usr/lib/pkgconfig. The filename must be named:
package-X.Y.pc including the versioning. The version
must reflect the same X.Y version as the package name. There
must also be a symlink without the version to the latest version, as
When installing libraries into the GAC
signing is required. The signing key should be supplied by upstream. If
upstream is not supplying the key then you must use the
mono.snk key from the
cli-common-dev package. This
key must be used for all following versions of the library to maintain
Unnecessary ABI breakages should be avoided. Existing keys shipped by the source package should not be replaced (with mono.snk) until the next incompatible ABI change.
This includes libraries that are not ABI-stable, may be not strong-named and are usually in an early stage of development. They must not include a clilibs control file.
The package should be named
libfoo-cil (without a version in the
package name) and libraries should not be installed into the GAC but only into
Applications using non-GAC libraries must copy the libraries they need into their own application directory. You can compare this with static linking of native libraries.
[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ next ]
Debian CLI PolicyVersion 0.7