This manual is free software; you may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.
This is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.
A copy of the GNU General Public License is available as /usr/share/common-licenses/GPL in the Debian GNU/Linux distribution or on the World Wide Web at the GNU General Public Licence. You can also obtain it by writing to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Here are the changes to the Debian CLI Policy document.
Changes from 0.5.1 to 0.7:
Changes from 0.5.0 to 0.5.1:
Changes from 0.4.4 to 0.5.0:
Changes from 0.4.2 to 0.4.3:
Changes from 0.4.1 to 0.4.2:
Changes from 0.4.0 to 0.4.1:
Changes from 0.3.0 to 0.4.0:
Changes from 0.2.1 to 0.3.0:
Changes from 0.2.0 to 0.2.1:
Changes from 0.1.1 to 0.2.0:
The ".NET" area uses its own set of abbreviations, which can look confusing to other people. This chapter lists some of the terms along with their explanations:
This is what most people mean when they say ".NET".
The CLI defines mainly the virtual machine, the bytecode and how everything
works together. It is both an
The CLR is an implementation of the
The CIL is the format of the bytecode for binaries and libraries
used by the
The ".NET" word is a Microsoft marketing phrase and mostly is a CLR with added Microsoft technologies like: ASP.NET, VB.NET, System.Windows.Forms, Passport plus a lot of other things.
We highly discourage from using any form of the word ".NET", it is
burdened by copyright and marketing. We advice to use the correct
term instead, which is usually
If you really want to use the ".NET" term in a correct form please refer to the
The GAC contains and manages the libraries for the
Mono stores the GAC at
DotGNU Portable.NET stores the GAC at
There are different set of package names we refer in this policy to.
Here a list of examples for the different names:
This section describes the additions to the
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 into
Libraries that will be installed into the GAC must be installed into
Example path for the
Never install native "glue" libraries into
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
You must not install application files (
Source code files (
Library files (
Debug symbol files (
Assembly config files (
Application files (
To ensure that all files have correct permissions, you should use Debhelper's
At a minimum, CLI packages should Build-Depends on
Current CLI compilers in Debian:
Current CLI SDKs in Debian:
Software that uses Mono via the C interface library
(
Note that there are architectures for which no
If your package is
Libraries that are installed into the
Libraries that are installed into the
Libraries must to be installed into the GAC at package install
time (postinst) which is provided by the
Each of the libraries in the
It is general practice and
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
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
The
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
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 (1.2.0.0 in the example) to make it possible to use
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
Overriding the
The
You should always set the minimum required version of the library in the
Many libraries deliver a
All GAC library packages should have a pkg-config
When installing libraries into the
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
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.
This section offers help with common problems encountered when packaging Mono-specific applications for Debian.
The official name of the Mono Project is: Mono, mono:: or mono. To keep this consistent for users, it should always be called "Mono" (not MONO, mono, mono:: or mixed with the .NET name). The explanation of what Mono is, should be in the package long description.
Often times, upstream software developers are not packagers, and vice versa. Developers do not necessarily test their software with packaging issues in mind. The most common problem we see from this are missing DLL exceptions.
When Mono code invokes an external library, it usually calls something like [DllImport("foo")] which expands "foo" to a shared library name such as "libfoo.so" which is then searched for in the library search path.
In Debian and some other binary Linux distributions, packages are split into runtime and developer (-dev) packages. Since the versioned library libfoo.so.X is usually used at runtime, and libfoo.so is a symlink only used when building against the library, the libfoo.so symlink is in the libfoo-dev package.
When packaging an application which uses libfoo.so normal users should not need the -dev packages installed just to run the application. However, Mono defaults to looking for the unversioned libfoo.so, which is unavailable in the runtime package.
When the DLL map is missing or upstream forgets to install
the DLL map, it will result in a
This can be fixed by creating a DLL map for the application exe or for the library DLL that is trying to invoke libfoo.so. If libfoo.so is invoked by the DLL bar.dll, create an xml file, bar.dll.config to tell Mono which .so should be loaded at runtime. bar.dll.config should be installed to the same directory as bar.dll.
A config file can contain as many dllmap directives as are needed. If the upstream developer already ships a config file, but it is incomplete, you should create a patch against it in your package.
Most Mono software developers are very helpful people, and will readily accept patches to solve this type of bug if you bring it to their attention. Please be sure to inform them of all these changes.
The Mono runtime uses a shared directory, by default
There are 2 problems with this:
In these cases, the package building will fail, applications will hang, die with strange Mono runtime errors or segfault. This includes dh_clideps or dh_makeclilibs, since they run monodis.
The solution is to include
This section offers help to common problems encountered when packaging DotGNU Portable.NET-specific applications for Debian.
The official name of the DotGNU Portable.NET project is exactly that. To keep this consistent for users, it should be always called "DotGNU Portable.NET" (not pnet or Portable.NET). The explanation of what DotGNU Portable.NET is, should be in the package long description.
When using cli-common-dev and the included dh_* scripts packages must
Build-Depends on
dh_makeclilibs is used to create the
It has the same use (and very similar parameters) to
This program must be called before
See
See
To identify which assemblies need to be installed into the
GAC,
The file format of the
For binary-arch packages:
With debhelper's 7
You need to install following packages for this example: mono-devel libmono-sharpzip0.6-cil libmono-sharpzip0.84-cil
Keep in mind that the filenames must be policy.X.Y.foo.config and policy.X.Y.foo.dll where foo is the assembly name and X.Y is the major and minor version number you want to be compatible with.
Many CLI packages already exist in Debian, or are in ITP, and conform to
the deprecated
Any
Also, be sure to replace references to dh_netdepends, dh_makenetlibs, and ${net:Depends} with the newer names described in the policy above.
Please remove any build-deps on
NF^úÙÕ—.öžŸm6pª—/³ ±‰MŒñH‹Ö±/·F_I÷ ûµ.dËÄ/^d%F+øŠŠ¥±øŒ=Q¡Ð¢YåÚ_êz³®œÏ{ õ i¬sÿ9~À \¿@9Oñ©Ï cli-common-0.9+nmu1/gac-install 0000755 0000000 0000000 00000000617 12473430700 013311 0 ustar #!/bin/bash # Make sure the GAC file exists if [ ! -x /usr/share/cli-common/runtimes.d/$1 ]; then echo ! Cannot install GAC $1 exit 1 fi # Make some useful noise #echo "Installing packages in $1" for file in /usr/share/cli-common/packages.d/*.installcligac do if [ -f $file ]; then /usr/share/cli-common/gac-package-install \ $(basename $file .installcligac) \ $1 fi done cli-common-0.9+nmu1/dh_auto_build_nant 0000755 0000000 0000000 00000001502 12473430700 014727 0 ustar #!/usr/bin/perl -w =head1 NAME dh_auto_build_nant - automatically builds a package that is based on nant =cut use strict; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B[S>] [S I >] =head1 DESCRIPTION dh_auto_build_nant is a debhelper program that tries to automatically build a package that is based on ant. =head1 OPTIONS =over 4 =item B<--> I Pass "params" to the program that is run. These can be used to supplement or override any standard parameters that dh_auto_build_nant passes. =back =cut init(); doit("nant", @{$dh{U_PARAMS}}); =head1 SEE ALSO L This program is a part of cli-common-dev. =head1 AUTHOR Mirco Bauer This program is partly based on dh_auto_build developed by Joey Hess =cut cli-common-0.9+nmu1/mono.pub 0000644 0000000 0000000 00000000240 12473430700 012635 0 ustar $ € ” $ RSA1 y™wÒÐ:Žkêz.tèѯ̓è…t•+´€¡,‘4GM$GÃ~hÀ€SoϾ/ùÉyΙ„uåè΂Ý[5 Á“¿.îχK$wPÛêtGýÚú'{"ÞGÖÿêD–t¤ùüÏ„ÑPi“€(M½Ó_FÍÿ¡½xäï eÐß cli-common-0.9+nmu1/prerm-cligac 0000644 0000000 0000000 00000000237 12473430700 013453 0 ustar if [ "$1" = "remove" ] || [ "$1" = "upgrade" ] && [ -x /usr/share/cli-common/gac-package-remove ]; then /usr/share/cli-common/gac-package-remove #PACKAGE# fi cli-common-0.9+nmu1/postinst-cligac 0000644 0000000 0000000 00000000214 12473430700 014204 0 ustar if [ "$1" = "configure" ] && [ -x /usr/share/cli-common/gac-package-install ]; then /usr/share/cli-common/gac-package-install #PACKAGE# fi cli-common-0.9+nmu1/debian/ 0000755 0000000 0000000 00000000000 12473433502 012406 5 ustar cli-common-0.9+nmu1/debian/changelog 0000644 0000000 0000000 00000046135 12473433502 014271 0 ustar cli-common (0.9+nmu1) unstable; urgency=medium * Non-maintainer upload fixing a bug blocking serious bug #777597 -- perl-modules: upgrade regression: dpkg: dependency problems prevent configuration of perl-modules * replace dependencies on 'perl-modules' with just 'perl' as per Perl policy existence of perl-modules package is an implementation detail (Closes: #779113) -- Damyan Ivanov Wed, 25 Feb 2015 20:56:32 +0000 cli-common (0.9) unstable; urgency=medium * The "Hello Mono 3 and F#" release [ Mirco Bauer ] * Mono 3.0 no longer ships 4.0/sn.exe but 4.5/sn.exe * Added .NET 4.5 support of Mono 3.0 * Fixed failing pod2man * Fixed syntax screwup of dh_cligacpolicy's manpage [ Christopher James Halse Rogers ] * Add missing need_dot_net_4_5 variable declaration to dh_clideps * Add dh_installcliframework -- Mirco Bauer Wed, 15 Jan 2014 07:08:16 +0100 cli-common (0.8.2) unstable; urgency=low * Don't quote the regexp. Perl doesn't allow quoted (compiled) regexps to subsequently have modifiers added. Broke case insensitive "i:" excludes. -- Iain Lane Tue, 17 Jan 2012 20:25:28 +0000 cli-common (0.8.1) unstable; urgency=low * Brown paper bag upload * dh_clideps: Fix perl syntax errors which prevented interpretation of file (Closes: #656188) -- Iain Lane Tue, 17 Jan 2012 10:53:43 +0000 cli-common (0.8) unstable; urgency=low * Upload to unstable * Fixed matching excluded modulerefs * Added deprecation warning to cli.make -- Mirco Bauer Mon, 16 Jan 2012 07:10:31 +0100 cli-common (0.8~xamarin2) experimental; urgency=low [ Julian Taylor ] * try to resolve all module references before failing [ Christopher James Halse Rogers ] * dh_clideps: Search all binary packages to resolve private libraries, not just the currently active ones. -- Mirco Bauer Thu, 29 Sep 2011 22:59:53 +0200 cli-common (0.8~xamarin1) experimental; urgency=low [ Iain Lane ] * Support case-insensitive excludes and search foo and foo.dll * Automatically exclude some common windows libraries * cli-policy: We now use the upstream name for pcfiles [ Julian Taylor ] * auto exclude more windows libs * fix syntax error, missing commas [ Iain Lane ] * Fix case insensitive ignore -- Mirco Bauer Wed, 18 May 2011 01:21:58 +0200 cli-common (0.8~exp2) experimental; urgency=low [ Christopher James Halse Rogers ] * Add --exclude-moduleref option to dh_clideps [ Mirco Bauer ] * Fixed minor typos in pod -- Mirco Bauer Sat, 09 Apr 2011 14:32:20 +0200 cli-common (0.8~exp1) experimental; urgency=low [ Mirco Bauer ] * Cleaned up Uploaders * Added .NET 4.0 support (requires mono-runtime >= 2.10.1) * Fixed minimum build-dep version check in dh_clideps and dh_makeclilibs (closes: #597440) * Enhanced error handling for signature parsing and ignore delay-signed assemblies in dh_makeclilibs * Bumped minimum cli-common-dev version to 0.8~ [ Christopher James Halse Rogers ] * dh_clideps: (closes: #568970) + Also resolve references to private native libraries. + Now that we can cover all dllmap cases, fail the build when unable to resolve a native library dependency. + Add -X/--exclude option to remove libraries from dependency resolution -- Mirco Bauer Tue, 05 Apr 2011 22:05:49 +0200 cli-common (0.7.1) unstable; urgency=low * debian/control: + Updated Vcs-* fields pointing to the git repository now. + Changed Section to cli-mono. * dh_clifixperms: + Only operate on files (not symlinks). -- Mirco Bauer Thu, 07 Jan 2010 11:45:29 +0100 cli-common (0.7) unstable; urgency=low [ Mirco Bauer ] * cli-policy.sgml: + Updated to version 0.7, containing important changes which can be found in the History section of the policy. * gac-package-install: + Cascade error condition when calling runtime scripts. (Closes: #517198) (thanks to Loïc Minier for the investigation and providing the patch) * dh_cligacpolicy: + Fixed syntax error causing the description of Keyfile to be omitted. (Closes: #487464) * dh_clideps dh_makeclilibs: + Fix cli-common-dev build-dep(-indep) detection logic. (Closes: #500329) (thanks to Chow Loong Jin for the patch) * dh_makeclilibs: + Pass by default MONO_GAC_PREFIX=debian/tmp/usr so monodis can find libraries divided into multi-binary packages. (Closes: #498868) * mono.pub mono.snk: + Added the public and private key of Mono so libraries that don't have a key shipped by upstream can use this one, as defined in Debian CLI Policy v0.7 §3.2.5 * debian/control: + Added ghostscript to build-deps-indep. [ Sam Hocevar ] * dh_clideps: + Add support for the "os" attribute in entries (http://www.mono-project.com/Config_DllMap). -- Mirco Bauer Wed, 05 Aug 2009 16:03:59 +0200 cli-common (0.6.2) unstable; urgency=low * cli-nant.make cli_nant.pm debian/dh_auto_build_nant debian/dh_auto_clean_nant: + Initial implementation of nant integration with debhelper's "dh" tool. Just include /usr/share/cli-common/cli-nant.make in your debian/rules file and you are done! -- Mirco Bauer Fri, 13 Mar 2009 00:55:01 +0100 cli-common (0.6.1) unstable; urgency=low * Upload to unstable. -- Mirco Bauer Fri, 06 Mar 2009 01:38:39 +0100 cli-common (0.6.0) experimental; urgency=low [ David Paleino ] * debian/control: + Updated mono-1.0-devel build-dependency to mono-devel, as "sn" is now part of mono-devel. [ Mirco Bauer ] * debian/dh_clideps debian/dh_makeclilibs: + Pass parameters we use to init() of debhelper (as required by dh 7.1). * debian/control: + Versioned mono-devel and mono-utils dependency for cli-common-dev to ensure we get an experimental buildd friendly version. + Bumped Standards-Version to 3.8.0 (no changes needed) -- Mirco Bauer Sat, 31 Jan 2009 18:19:41 +0100 cli-common (0.5.7) unstable; urgency=low * The "debhelper 7 integration" release * cli.make: + Makefile to be included by source packages in debian/rules. * cli.pm: + Sequence file to support our dh_*cli* scripts with debhelper's dh tool. * postrm-cligacpolicy: + Remove GAC policy files also in "upgrade" stage, else upgrades and downgrades will leave policy files around. * debian/control: + Updated debhelper dependency to >= 7.0.8 for cli-common-dev, as cli.make hooks into debhelper's dh sequence support. + Changed Maintainer to Debian CLI Common Team. + Added Homepage, Vcs-Svn and Vcs-Browser fields. * debian/cli-common-dev.install: + Added cli.make + Added cli.pm -- Mirco Bauer Sun, 11 May 2008 13:13:41 +0200 cli-common (0.5.6) unstable; urgency=low * postrm-cligacpolicy: + Only remove the GAC policy file in "remove" stage, else we try to remove the file it again in "purge" stage, which fails of course. (Closes: #460039, thanks to Varun Hiremath for the investigation) * prerm-cligac: + Only remove GAC assemblies in "remove" and "upgrade" stage, we don't support error unwind here. * dh_clideps: + Require cli-common >= 0.5.6 for packages that use dh_cligacpolicy. * debian/cli-common-dev.manpages: + Added dh_clistrip.1 * debian/control: + Updated Standards-Version to 3.7.3 (no changes needed). -- Mirco Bauer Thu, 10 Jan 2008 22:52:38 +0100 cli-common (0.5.5) unstable; urgency=low * debian/control: + Depend on mono-1.0-devel for sn, it was moved from mono-mcs. -- Sebastian Dröge Wed, 09 Jan 2008 06:53:45 +0100 cli-common (0.5.4) unstable; urgency=low * debian/cli-common-dev.install: + Added dh_clistrip, which all CLI packages should use to handle .mdb files automatically. * policy-remove: + New script which is used to removes GAC policy files from all GACs. * gac-package-install + Removed the misleading "ignoring" from the error message if an assembly could not be found. * postrm-cligacpolicy: + Don't abuse the policy-install script to remove policies when the package is removed, instead we are using policy-remove now. * dh_clideps: + Require higher cli-common version for packages that use dh_cligacpolicy. -- Mirco Bauer Tue, 01 Jan 2008 14:06:55 +0100 cli-common (0.5.3) unstable; urgency=low * dh_clideps: + Added CLI 2.1 runtime support (Moonlight/Silverlight). + Raised required cli-common version to >= 0.5.1 for packages that use the late-GAC install feature (dh_installcligac), as older versions silently missed installing policy files. -- Mirco Bauer Thu, 20 Dec 2007 22:58:27 +0100 cli-common (0.5.2) unstable; urgency=low * Mirco 'meebey' Bauer: + Replaces: cli-common-dev (= 0.5.0) is not enough, the policy-install file is also in older versions present, << 0.5.1 allows upgrades from etch and lenny. -- Mirco Bauer Mon, 03 Dec 2007 23:08:17 +0100 cli-common (0.5.1) unstable; urgency=low * Mirco 'meebey' Bauer: + Moved policy-install script from cli-common-dev to cli-common package, and added needed Replaces field to cli-common in debian/control. (Closes: #454136) -- Mirco Bauer Mon, 03 Dec 2007 20:52:44 +0100 cli-common (0.5.0) unstable; urgency=low * Mirco 'meebey' Bauer: + Includes CLI policy version 0.5.0. + Removed ".NET" from package descriptions. * Dylan R. E. Moonfire + dh_cligacpolicy: - Cleaned up the code to simplify the file. - Corrected some typos in the man page. - Removed some of the variables. - Renamed from dh_createclipolicy -- Mirco Bauer Sun, 02 Dec 2007 16:29:03 +0100 cli-common (0.4.9) unstable; urgency=low * Mirco 'meebey' Bauer': + debian/control: - Added dh_installcligac, dh_createclipolicy, dh_clifixperms and dh_clistrip to cli-common-dev package description. - Added perl-modules to cli-common and cli-common-dev dependencies. (Closes: #431586) - Using my Debian email address now. + dh_clistrip: - New debhelper tool similar to dh_strip to strip (delete) or move debugging symbols of CLI applications and libraries. -- Mirco Bauer Wed, 04 Jul 2007 20:44:13 +0200 cli-common (0.4.8) unstable; urgency=low * Upload to unstable * Sebastian 'slomo' Dröge: + Depend on texlive packages instead of old tetex-extra * Mirco 'meebey' Bauer': + Includes CLI policy version 0.4.3. -- Sebastian Dröge Sun, 15 Apr 2007 22:26:55 +0200 cli-common (0.4.7) experimental; urgency=low * Sebastian 'slomo' Dröge: + debian/rules: - Add binary-arch target (Closes: #395583) + debian/control, debian/cli-policy.sgml: - Update to use my debian.org mail address + debian/control: - Move debhelper to Build-Depends from Build-Depends-Indep * Mirco 'meebey' Bauer': + dh_clideps: - Add support for kfreebsd-i386 and kfreebsd-amd64 + dh_clideps: - Added support for overriding assembly references using debian/$package.clideps-override. -- Sebastian Dröge Tue, 27 Feb 2007 14:37:02 +0100 cli-common (0.4.6) unstable; urgency=low * Mirco 'meebey' Bauer + dh_clideps: - Don't parse symlinks that point to CLI assemblies. - Added support for MONO_PATH using -l parameter. - Only use the basename of DLL map targets. (else the shlibs lookup will fail) -- Debian Mono Group Sun, 1 Oct 2006 12:51:20 +0200 cli-common (0.4.5) unstable; urgency=low * Mirco 'meebey' Bauer + debian/control: - Really added libxml-dom-perl dependency to cli-common-dev. -- Debian Mono Group Sun, 24 Sep 2006 20:06:14 +0200 cli-common (0.4.4) unstable; urgency=low * Dylan R. E. Moonfire + Created dh_clifixperms to easily correct file permissions. * Mirco 'meebey Bauer + Updated link in the CLI Policy for MS .NET term usage. + dh_{makeclilibs,clideps}: - Bumped cli-common-dev build-depends check to >= 0.4.4 + dh_clideps: - Rewrote many parts. - Assembly ModuleRefs are now parsed. - Using /etc/mono/config now for resolving DLL maps. - Added override feature for detected dependencies, to support Suggests and Recommends fields. (debian/$package.clideps-override) - Using libxml-dom-perl now instead of hackish regex. - Added special handling of libc6 dependency, the package is not called libc6 on all architectures. + debian/control: - Removed transition dependency for cli-common on cli-common-dev. (7 month for a package rename transition should be more than enough) - Added libxml-dom-perl dependency to cli-common. - Updated to Standards Version 3.7.2 (no changes). -- Debian Mono Group Sun, 24 Sep 2006 00:58:36 +0200 cli-common (0.4.3) unstable; urgency=low * Sebastian 'slomo' Dröge: + Fix file naming of the policy files in the CLI policy + dh_installcligac: - Do some sanity checking whether the files listed in the installcligac files really exist. Otherwise fail. + gac-package-install: - Fail at install time if a file listed in the installcligac file does not exist. (Closes: #366451) -- Debian Mono Group Wed, 28 Jun 2006 12:33:24 +0200 cli-common (0.4.2) unstable; urgency=low * Mirco 'meebey' Bauer + Renamed debian/cli-common-dev.manapges to debian/cli-common-dev.manpages (caused missing manpages, Closes: #368212) -- Debian Mono Group Sun, 21 May 2006 13:29:13 +0200 cli-common (0.4.1) unstable; urgency=low * Mirco 'meebey' Bauer + debian/control: - Fixed replaces of cli-common-dev. -- Debian Mono Group Sat, 29 Apr 2006 22:29:38 +0200 cli-common (0.4.0) unstable; urgency=low * Mirco 'meebey' Bauer + Includes CLI policy version 0.4.0. + Added LD_LIBRARY_PATH to "mono" call for internal-mono mode. + Fixed dllmap parser regex in dh_clideps and dh_makeclideps, to not use the full filename but the SONAME. + Fixed shlibs parser regex and cat call to use fullpath. + New package cli-common-dev, which is for building CLI libraries/application packages. cli-common is now used for base package for runtime, it includes a framework for GAC integration across CRLs. For transition cli-common depends on cli-common-dev till all source packages have updated their build-deps. + Bumped debhelper compat to 5 and updated the build-dep to >= 5.0.0 + dh_clideps will now create dependencies for applications on mono-runtime instead of mono-jit, required for libraries that are installed via GAC. * Dylan R. E. Moonfire + Added a late GAC installer framework. -- Debian Mono Group Mon, 20 Feb 2006 00:59:07 +0100 cli-common (0.2.3) unstable; urgency=low * Mirco 'meebey' Bauer + Added LD_LIBRARY_PATH to dh_makeclilibs and dh_clideps for the internal-mono mode, this fixes full bootstrapping of Mono. -- Debian Mono Group Sun, 2 Oct 2005 17:45:28 +0200 cli-common (0.2.2) unstable; urgency=low * Mirco 'meebey' Bauer + Fixed manpage of dh_makeclilibs, "internal-mono" not "--internal-mono". + dh_clideps knows now 2.0.0.0 version of mscorlib. + Fixed bug in dh_clideps, when .NET 1.0 and 2.0 were used in the same package, the generated dependency was only for .NET 1.0 then. -- Debian Mono Group Sat, 24 Sep 2005 15:46:42 +0200 cli-common (0.2.1) unstable; urgency=low * Mirco 'meebey' Bauer + Added mono/2.0 to MONO_PATH in dh_clideps and dh_makeclilibs for internal-mono mode, this caused FTBFS. (thanks to Sebastian Dröge for investigating) + Using debian/tmp/usr/bin/monodis in dh_makeclilibs again. + Updated to Standards Version 3.6.2.1 (no changes). -- Debian Mono Group Fri, 2 Sep 2005 18:35:20 +0200 cli-common (0.2.0) unstable; urgency=low * Mirco 'meebey' Bauer + Ported the CLI policy in SGML. + /usr/share/doc/cli-common contains now the CLI policy. + Includes CLI policy version 0.2.0. + debian/control: - Added debiandoc-sgml and tetex-extra to build-deps-indep. - Changed Build-Depends to Build-Depends-Indep. + debian/rules: - Added calls to generate the CLI policy from SGML. - Moved pod2man calls to build target. + debian/cli-common.docs: - Added generated CLI policy documents. + dh_clideps: - Added error handling/messages when monodis fails for some reason. - Fixed bug, it was not generating required dependencies when run in internal-mono mode, caused wrong CLI deps for mono packages. - Packages with no .exe files will no longer have a mono-jit dependency. - The versioned dependency of mono-jit for applications will be >= 1.0 when using .NET 1.0 and >= 1.1.8.1-1 when using .NET 2.0 now. -- Debian Mono Group Sun, 28 Aug 2005 15:53:48 +0200 cli-common (0.1.4) unstable; urgency=low * Mirco 'meebey' Bauer + Changed title of generated manpages. (Closes: #288198) + Applied patch by Ingo Saitz that allows to use a built mono in debian/ (using internal-mono switch). + Added debian/compat. -- Debian Mono Group Sun, 10 Jul 2005 19:46:23 +0200 cli-common (0.1.3.0) unstable; urgency=low * upload to unstable -- Debian Mono Group Sun, 29 May 2005 19:52:32 +0200 cli-common (0.1.3) experimental; urgency=low * Mirco 'meebey' Bauer + fixed bug in dh_clideps, when no "-r" was passed it didn't generate a dependency on the virtual machine. -- Debian Mono Group Sat, 14 May 2005 16:47:37 +0200 cli-common (0.1.2) experimental; urgency=low * Mirco 'meebey' Bauer + build-dep check for cli-common applies also now to buil-dep-indep. -- Debian Mono Group Sat, 23 Apr 2005 12:44:14 +0200 cli-common (0.1.1) experimental; urgency=low * Mirco 'meebey' Bauer + added mono-mcs and virtual packages to dependencies. -- Debian Mono Group Mon, 4 Apr 2005 18:31:27 +0200 cli-common (0.1) experimental; urgency=low * Mirco 'meebey' Bauer + Initial release. -- Debian Mono Group Mon, 4 Apr 2005 18:31:27 +0200 cli-common-0.9+nmu1/debian/rules 0000755 0000000 0000000 00000002374 12473430700 013471 0 ustar #!/usr/bin/make -f #export DH_VERBOSE=1 export MONO_SHARED_DIR=$(CURDIR) VERSION = $(shell dpkg-parsechangelog | grep ^Vers | cut -d\ -f2) build: build-stamp build-stamp: dh_testdir debiandoc2text cli-policy.sgml debiandoc2html cli-policy.sgml debiandoc2pdf cli-policy.sgml for x in dh_clideps dh_makeclilibs dh_installcligac dh_clifixperms dh_clistrip dh_cligacpolicy dh_installcliframework; \ do chmod +x $$x; pod2man -c "Debhelper for CLI (Common Language Infrastructure)" $$x > $$x.1; done touch build-stamp clean: dh_testdir dh_testroot rm -f dh_clideps.1 dh_makeclilibs.1 dh_installcligac.1 dh_clifixperms.1 dh_clistrip.1 dh_cligacpolicy.1 rm -fr cli-policy.html cli-policy.txt cli-policy.pdf cli-policy.tpt rm -f build-stamp rm -rf $(MONO_SHARED_DIR)/.wapi dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Build architecture-independent files here. binary-indep: build install dh_testdir -i dh_testroot -i dh_install -i dh_link -i dh_installchangelogs -i dh_installexamples -i dh_installdocs -i dh_installman -i dh_compress -i dh_fixperms -i dh_installdeb -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i binary-arch: binary: binary-indep .PHONY: clean build install binary-indep binary-arch binary cli-common-0.9+nmu1/debian/control 0000644 0000000 0000000 00000004233 12473430745 014021 0 ustar Source: cli-common Section: cli-mono Priority: optional Maintainer: Debian CLI Common Team Uploaders: Mirco Bauer Build-Depends: debhelper (>= 5) Build-Depends-Indep: debiandoc-sgml, texlive-base-bin, texlive-base, texlive-latex-base, texlive-latex-extra, texlive-fonts-recommended, texlive-latex-recommended, ghostscript Standards-Version: 3.8.0 Homepage: http://alioth.debian.org/projects/pkg-cli-common/ Vcs-Git: git://git.debian.org/git/pkg-cli-common/packages/cli-common.git Vcs-Browser: http://git.debian.org/?p=pkg-cli-common/packages/cli-common.git Package: cli-common Architecture: all Replaces: cli-common-dev (<< 0.5.1) Depends: perl Description: common files between all CLI packages This package must be installed if a CLI (Common Language Infrastructure) runtime environment is desired. . It covers useful integration and information for CLI implementations in Debian GNU/Linux, including: * The CLI policy describes how CLI packages should behave and integrate. * A FAQ for package maintainers of CLI/.NET applications. * Integration for CLRs (Common Language Runtime): + Installing libraries into existing GACs (Global Assembly Cache) Package: cli-common-dev Architecture: all Replaces: cli-common (<< 0.4.0) Depends: debhelper (>= 7.0.8), perl, mono-utils (>= 3.0~) | cil-disassembler, mono-devel (>= 3.0~) | strong-name-tool, libxml-dom-perl Description: common files for building CLI packages This package must be installed if a CLI (Common Language Infrastructure) packaging environment is desired. . It includes debhelper scripts for managing automatic dependency tracking between native libraries, CLI libraries and CLI applications: * dh_clideps to generate cli:Depends information for debian/control * dh_makeclilibs to create clilibs files that are needed/used by dh_clideps * dh_installcligac to register assemblies to be late installed into a GAC * dh_cligacpolicy to create and install the policy files into a GAC * dh_clifixperms to fix permissions of files in CLI package build directories * dh_clistrip to strip CLI debug symbols from package build directories cli-common-0.9+nmu1/debian/NEWS 0000644 0000000 0000000 00000001274 12473430700 013106 0 ustar cli-common (0.4.0) unstable; urgency=low With this upload of cli-common 0.4.0, there is now a new version of the CLI Policy DRAFT. You can either find the new version at /usr/share/doc/cli-common/ or at: http://pkg-mono.alioth.debian.org/cli-common/ For package maintainers: You should read the updated CLI Policy DRAFT and update your packages. The "cli-common (>= 0.2.0)" build-dependency must be changed to "cli-common-dev (>= 0.4.0)", because cli-common includes now scripts which are required for the runtime. With that the debhelper scripts were moved to be more correct place in cli-common-dev. -- Debian Mono Group Sun, 9 Apr 2006 21:28:05 +0200 cli-common-0.9+nmu1/debian/cli-common-dev.install 0000644 0000000 0000000 00000001541 12473430700 016605 0 ustar ildasm-monodis /usr/share/cli-common/ cli.make /usr/share/cli-common/ cli.pm /usr/share/perl5/Debian/Debhelper/Sequence/ cli-nant.make /usr/share/cli-common/ cli_nant.pm /usr/share/perl5/Debian/Debhelper/Sequence/ dh_makeclilibs /usr/bin/ dh_clideps /usr/bin/ dh_clifixperms /usr/bin/ dh_clistrip /usr/bin/ dh_auto_build_nant /usr/bin/ dh_auto_clean_nant /usr/bin/ dh_installcligac /usr/bin/ postinst-cligac /usr/share/debhelper/autoscripts/ prerm-cligac /usr/share/debhelper/autoscripts/ dh_installcliframework /usr/bin/ postinst-cliframework /usr/share/debhelper/autoscripts/ prerm-cliframework /usr/share/debhelper/autoscripts/ dh_cligacpolicy /usr/bin/ postinst-cligacpolicy /usr/share/debhelper/autoscripts/ postrm-cligacpolicy /usr/share/debhelper/autoscripts/ mono.pub /usr/share/cli-common/keys/ mono.snk /usr/share/cli-common/keys/ cli-common-0.9+nmu1/debian/cli-common.install 0000644 0000000 0000000 00000000654 12473430700 016035 0 ustar gac-install /usr/share/cli-common/ gac-remove /usr/share/cli-common/ gac-package-install /usr/share/cli-common/ gac-package-remove /usr/share/cli-common/ policy-install /usr/share/cli-common/ policy-remove /usr/share/cli-common/ framework-install /usr/share/cli-common/ framework-remove /usr/share/cli-common/ framework-package-install /usr/share/cli-common/ framework-package-remove /usr/share/cli-common/ cli-common-0.9+nmu1/debian/compat 0000644 0000000 0000000 00000000001 12473430700 013600 0 ustar 5 cli-common-0.9+nmu1/debian/cli-common-dev.manpages 0000644 0000000 0000000 00000000142 12473430700 016726 0 ustar dh_clideps.1 dh_clifixperms.1 dh_cligacpolicy.1 dh_clistrip.1 dh_installcligac.1 dh_makeclilibs.1 cli-common-0.9+nmu1/debian/dirs 0000644 0000000 0000000 00000000140 12473430700 013262 0 ustar usr/share/cli-common/runtimes.d usr/share/cli-common/packages.d usr/share/cli-common/policies.d cli-common-0.9+nmu1/debian/cli-common.docs 0000644 0000000 0000000 00000000077 12473430700 015316 0 ustar cli-policy.sgml cli-policy.txt cli-policy.pdf cli-policy.html/ cli-common-0.9+nmu1/debian/copyright 0000644 0000000 0000000 00000000477 12473430700 014346 0 ustar This package was debianized by Mirco Bauer using the keyboard. Upstream Authors: Mirco Bauer Eduard Bloch Copyright: Distributed on the terms of the GNU General Public License which can be found in the file /usr/share/common-licenses/GPL on Debian systems. cli-common-0.9+nmu1/prerm-cliframework 0000644 0000000 0000000 00000000253 12473430700 014714 0 ustar if [ "$1" = "remove" ] || [ "$1" = "upgrade" ] && [ -x /usr/share/cli-common/framework-package-remove ]; then /usr/share/cli-common/framework-package-remove #PACKAGE# fi cli-common-0.9+nmu1/gac-remove 0000755 0000000 0000000 00000000517 12473430700 013137 0 ustar #!/bin/bash if [ ! -x /usr/share/cli-common/runtimes.d/$1 ]; then echo ! Cannot remove GAC $1 exit 1 fi echo "* Removing packages from $1" for file in /usr/share/cli-common/packages.d/*.installcligac do if [ -f $file ]; then /usr/share/cli-common/runtimes.d/$1 remove \ $(basename $file .installcligac) fi done cli-common-0.9+nmu1/dh_installcligac 0000755 0000000 0000000 00000003656 12473430700 014405 0 ustar #!/usr/bin/perl -w =head1 NAME dh_installcligac - register assemblies to be late installed into a GAC =cut use strict; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B [S>] [B<-n>] =head1 DESCRIPTION dh_installcligac is a debhelper program that is responsible for installing assemblies and related files used by the Debian cli-common package into GAC of all installed runtimes. It also automatically generates the postinst and prerm commands needed to late install the assemblies. See L for an explanation of how this works. This is based on L in the emacsen-common package. =head1 OPTIONS =over 4 =item B<-n>, B<--noscripts> Do not modify postinst/prerm scripts. =back =head1 NOTES Note that this command is not idempotent. "dh_clean -k" should be called between invocations of this command. Otherwise, it may cause multiple instances of the same text to be added to maintainer scripts. =cut init(); foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp = tmpdir($package); my $cligac = pkgfile($package, "installcligac"); if ($cligac ne '') { # sanity check: do all files listed in the installcligac file exist? open CLIGAC, "<$cligac" or die "E: Can't open $cligac\n"; while ( ) { chomp; if (! -f "$tmp$_") { die "E: Can't find file $tmp$_!\n"; } } close CLIGAC; if (! -d "$tmp/usr/share/cli-common/packages.d") { doit("install","-d","$tmp/usr/share/cli-common/packages.d"); } doit("install", "-m0644", $cligac, "$tmp/usr/share/cli-common/packages.d/$package.installcligac"); if (! $dh{NOSCRIPTS}) { autoscript($package, "postinst", "postinst-cligac", "s/#PACKAGE#/$package/"); autoscript($package, "prerm", "prerm-cligac", "s/#PACKAGE#/$package/"); } } } =head1 SEE ALSO L This program is a part of cli-common-dev. =head1 AUTHOR Dylan R. E. Moonfire =cut cli-common-0.9+nmu1/dh_cligacpolicy 0000755 0000000 0000000 00000017115 12473430700 014231 0 ustar #!/usr/bin/perl -w =head1 NAME dh_cligacpolicy - creates and installs a CLI policy file for a package =cut use strict; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B [S>] [B<-n>] =head1 DESCRIPTION dh_cligacpolicy is a debhelper program that is responsible for creating, compiling, and installing policy files for a Debian package. This automatically includes postinst and prerm commands needed to install these policies into the system. =head1 OPTIONS =over 4 =item B<-n>, B<--noscripts> Do not modify postinst/prerm scripts. =back =head1 FILE FORMAT This file uses the I files (either I or I ) to generate the policy file. It supports multiple versions of the policy, including mapping multiple versions to a single file. The file format of the I file consists of five properties per line, each one separated by whitespace. =over 4 =item B is a path, from the package root, to the .snk file used to sign the assembly. =item B is the name of the assembly, without the .dll extension. For example, for log4net.dll, use I . =item B can be a single four-part version, such as 1.2.3.4, or a full range, such as 1.2.3.4-1.2.6.7. For a single line, the first two numbers must be identical. To have an assembly apply to multiple versions, such as 1.2.0.0 to 2.4.0.0, there needs to be one line for each version range. =item B is the version of the assembly being =built. =item B defines the priority of the policy files. Typically, each version will increase the priority and contains all the policy controls for prior versions. =back The fields can be separated with spaces or tabs. Comments start the line with I<#> characters and blank lines are ignored. =head1 NOTES Note that this command is not idempotent. "dh_clean -k" should be called between invocations of this command. Otherwise, it may cause multiple instances of the same text to be added to maintainer scripts. =head1 EXAMPLE For the log4net 1.2.10.0 version, a policy file is used to map all versions from 1.2.8.0 to 1.2.9.99 into the current version. debian/log4net.snk log4net 1.2.8.0-1.2.9.99 1.2.10.0 10 =cut # Set up debhelper init(); { local $/=""; open(FILE, 'debian/control'); my @filedata = ; close(FILE); if (!($filedata[0] =~ /Build-Depends(-Indep)?: .*cli-common-dev \(>= 0\.5\.7\)/)) { warning("Warning! No Build-Depends(-Indep) on cli-common-dev (>= 0.5.7)!"); } } # Go through each of the packages being built my $errors = 0; foreach my $package (@{$dh{DOPACKAGES}}) { # Set up our internal variables my $tmp = tmpdir($package); my $policy = pkgfile($package, "cligacpolicy"); my %policies = (); # If $policy is blank, then there is no file next if $policy eq ""; # Load the policy file into memory. my ($keyfile, $pkg_tmp, $cli_dir, $token, $priority); open POLICY, "<$policy" or die "E: Can't open $policy ($!)"; while ( ) { # Clean up the line and ignore blanks and comments chomp; s/^\s+//; s/\s+$//; next if /^\#/; next if /^$/; # Each line consists of six parts: # 1. snk file for encryption, relative to the package root # 2. Assembly name # 3. Versions to map from # 4. Versions to map to # 5. Priority of this policy my ($snk, $assembly, $map, $version, $priority) = split(/\s+/); # Verify the fields my $version_map; # Remove the .dll to normalize it $assembly =~ s/\.dll$//; # Get the token from the file my $cmd = "/usr/bin/cli-sn -t '$snk' | grep 'Public Key' " . "| cut -f 2- -d :"; my $token = `$cmd`; # FIXME: error handling here! $token =~ s/^\s*(.*?)\s*$/$1/sg; # Check the version numbers if ($map =~ /^(\d+\.\d+)\.\d+\.\d+$/) { $version_map = $1; } else { if ($map =~ /^(\d+\.\d+)\.\d+\.\d+-(\d+\.\d+)\.\d+\.\d+$/) { if ($1 ne $2) { $errors = 1; print STDERR "E: $package $.: Version ranges ($map) must " . "have the first two digits of the version the same. " . "Use two different lines for this line.\n"; next; } $version_map = $1; } else { $errors = 1; print STDERR "E: $package $.: The version field ($map) " . "must be in the following format: " . "'A.B.C.D' or 'A.B.C.D-E.F.G.H'\n"; next; } } # We have now gathered up everything we need. We use a hash to # consolidate all the various bindings into the unique # combinations of policy files we need. my $pk = join("--", $snk, $assembly, $version_map, $priority); $policies{$pk} .= join("\n", ' ', ' ") . "\n"; } close POLICY; # Make sure the policies.d directory exists if (! -d "$tmp/usr/share/cli-common/policies.d") { doit("install","-d","$tmp/usr/share/cli-common/policies.d"); } if (! -d "$tmp/usr/share/cli-common/policies.d/$package") { doit("install","-d","$tmp/usr/share/cli-common/policies.d/$package"); } # Once all the various', " ", "", " ", " tags are consolidated, we # then generate the policy files. This will result in one policy file for # a given assembly, key file, and A.B version. foreach my $pk (keys %policies) { # Get the pkg_dir my ($snk, $assembly, $version_map, $priority) = split(/--/, $pk); my $pkg_dir = "usr/share/cli-common/policies.d/$package"; my $tmp_pkg_dir = "$tmp/$pkg_dir"; my $policy_file = "$version_map.$assembly"; # Open the policy file chooser open CHOOSER, ">$tmp/usr/share/cli-common/policies.d/" . sprintf("%03d-%s.%s", $priority, $version_map, $assembly); print CHOOSER "/$pkg_dir/policy.$policy_file.dll\n"; close CHOOSER; # Open up the file unless (open PF, ">$tmp_pkg_dir/policy.$policy_file.config") { $errors = 1; print STDERR "E: $package: Cannot write $policy_file.config\n"; print STDERR "E: $package: $!\n"; next; } # Write out the policy file print PF " \n \n"; close PF; # Compile the assembly file. We have to change directory first # because of AL limitation. system("cd $tmp_pkg_dir/ && /usr/bin/cli-al " . "/link:policy.$policy_file.config " . "/out:policy.$policy_file.dll " . "/keyfile:" . $ENV{PWD} . "/$snk"); # Clean up the config file #unlink("$tmp_pkg_dir/policy.$policy_file.config"); # Set up the scripts if (! $dh{NOSCRIPTS}) { autoscript($package, "postinst", "postinst-cligacpolicy", "s/#ASSEMBLY# #VERSION#/$assembly $version_map/"); autoscript($package, "postrm", "postrm-cligacpolicy", "s/#ASSEMBLY# #VERSION#/$assembly $version_map/"); } } } # Finish up exit $errors; =head1 SEE ALSO L\n"; print PF $policies{$pk}; print PF " \nThis program is a part of cli-common-dev. =head1 AUTHOR Dylan R. E. Moonfire =cut # # cli-common-0.9+nmu1/dh_clifixperms 0000755 0000000 0000000 00000002766 12473430700 014122 0 ustar #!/usr/bin/perl -w =head1 NAME dh_clifixperms - fix permissions of files in CLI package build directories =cut use strict; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B# ## ## ## # [S>] [B<-X>I - ] =head1 DESCRIPTION dh_clifixperms is a debhelper program that is responsible for setting the permissions of files and directories for CLI assemblies and executables. dh_clifixperms makes all files that end in *.dll, *.mdb, *.cs, *.aspx, and *.config to mode 644 and *.exe to mode 755. =head1 OPTIONS =over 4 =item B<-X>I
- , B<--exclude> I
- Exclude files that contain "item" anywhere in their filename from having their permissions changed. You may use this option multiple times to build up a list of things to exclude. =back =cut init(); foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); my $find_options=''; if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { $find_options="! \\( $dh{EXCLUDE_FIND} \\)"; } # Fix the permissions of various CLI-based files for my $ext (qw(dll mdb cs config aspx)) { complex_doit("find $tmp $find_options -name \"*.$ext\" -type f -print0", "2>/dev/null | xargs -0r chmod 0644"); } complex_doit("find $tmp $find_options -name \"*.exe\" -type f -print0", "2>/dev/null | xargs -0r chmod 0755"); } =head1 SEE ALSO L
This program is a part of cli-common. =head1 AUTHOR Dylan R. E. Moonfire based on work from Joey Hess . =cut cli-common-0.9+nmu1/framework-package-remove 0000755 0000000 0000000 00000001213 12473430700 015765 0 ustar #!/bin/bash function supports_framework_remove () { echo Checking $1 if [ -x $1 ]; then if $1 2>&1 | grep "remove-framework" > /dev/null; then echo supported return 0 fi fi echo unsupported return 1 } # If there is a second argument, it's the only runtime to remove if [ -n "$2" ]; then RUNTIMES=/usr/share/cli-common/runtimes.d/$2 else RUNTIMES=/usr/share/cli-common/runtimes.d/* fi for file in $RUNTIMES do if supports_framework_remove $file ; then # Figure out the formal name F="$($file name)" # Remove it echo "Removing $1 from $F" $file remove-framework $1 fi done cli-common-0.9+nmu1/dh_clideps 0000755 0000000 0000000 00000061244 12473430700 013214 0 ustar #!/usr/bin/perl -w =head1 NAME dh_clideps - calculates CLI (.NET) dependencies =cut use strict; use Cwd; use File::Find; use File::Temp; use Debian::Debhelper::Dh_Lib; #eval 'use Debian::Debhelper::Dh_Lib'; #print "You need to install the debhelper package in order to use this program!" if $@; =head1 SYNOPSIS B [S>] =head1 DESCRIPTION dh_clideps is a debhelper program that is responsible for generating the ${cli:Depends} substitutions and adding them to substvars files. The program will look at .dll/.exe and .config files in your package, and will use the embedded dependency information to generate a dependency string on assembly and shared libs packages, including the setting of version ranges (as declared by the shlibs/clilibs files of the used packages). The dependency on a certain CLR (Common Language Runtime) version will be also added to the final variable. Note: the dependencies on shared libraries may be not resolved correctly if there are no .config files associated with the the .exe/.dll file which refers to the particular shared library (by its SONAME). If you use this program, your package should build-depend on cli-common-dev (>= 0.4.0). =head1 OPTIONS =over 4 =item B<-d> Attempt to predict and avoid duplicates that may appear if you package both, native shared libraries and DLL assemblies in one package. The list of possibly duplicating candidates is expected to be in the variable shlib:Depends from debian/package.substvars. =item B<-r> Don't set a strong versioned dependency on mono-runtime or other CLR packages. This option can be used to specify a relaxed dependency on the VM/CLR by-hand in the control file, eg. "mono-runtime | cli-runtime". =item B<-l>directory[:directory:directory:..] Before mondis is run, MONO_GAC_PREFIX and MONO_PATH are set to the specified directory (or directories -- separate with colons). This is useful for multi-binary packages where a library is built in one package and another package contains binaries linked against said library. Relative paths will be made absolute for the benefit of monodis. Note that the directory given should be the complete or relative path to a directory that contains the library. See example below. =item B<-X>path B<--exclude=>path Paths to exclude from the .dll/.exe search. Assemblies in these paths or their subdirectories will not be searched for dependencies, and assemblies missing references will not cause dh_clideps to fail. =item B<--exclude-moduleref=>moduleref ModuleRef to exclude from dependency resolution. dh_clideps will not attempt to resolve dependencies of these ModuleRefs. In particular, dh_clideps will not fail if these modulerefs are unresolvable. May be specified multiple times. Each time it excludes a new ModuleRef. ModuleRefs to be excluded can be optionally prefixed with "i:" to specify a case-insensitive match. If foo is excluded, both foo and foo.dll will be considered when matching the exclude. =item B Uses the mono runtime in . (used for bootstrapping mono packages) =back =head1 EXAMPLES Suppose that your source package produces libfoo1.0-cil and libbar1.0-cil binary packages. In your rules file, first run dh_makeclilibs, then dh_clideps: (MONO_GAC_PREFIX example) dh_makeclilibs -V dh_clideps -l debian/libfoo1.0-cil/usr:debian/libbar1.0-cil/usr or (MONO_PATH example) dh_clideps -l debian/foo-application/usr/lib/foo-application or (MONO_GAC_PREFIX example) dh_clideps -l debian/tmp/usr Suppose your source package libquux1.0-cil also ships some examples in /usr/share, and you don't want to pull in those dependencies. dh_clideps -X/usr/share Suppose your source package has a ModuleRef on libbaz but works correctly without it. Excluding this ModuleRef will prevent dh_clideps from adding a package dependency or failing if the libbaz dependency is unresolvable. dh_clideps --exclude-moduleref=libbaz =cut # Static list of modulerefs to automatically exclude @{$dh{MODULE_EXCLUDE}} = ( "i:advapi32", "i:comctl32", "i:dwmapi", "i:gdi32", "i:imm32", "i:kernel32", "i:netapi32", "i:oleaut32", "i:opengl32", "i:shell32", "i:shlwapi", "i:system32", "i:user32", "i:uxtheme", "i:winmm", "i:ws2_32", ); # Add an item to the moduleref exclude list. sub AddModulerefExclude { my($option,$value)=@_; push @{$dh{MODULE_EXCLUDE}},$value; } # gar, debhelper 7.1 defines -d for all scripts already :( init(options => { # "d" => \$dh{D_FLAG}, "r" => \$dh{R_FLAG}, "l=s", => \$dh{L_PARAMS}, "internal-mono" => \$dh{INTERNAL_MONO_FLAG}, "exclude-moduleref=s", => \&AddModulerefExclude, }); my $clr; my $cli = '/usr/bin/cli'; my $cli_version = `$cli --version 2>&1`; my $cli_parser; my $cli_parser_paths; my $pwd = `pwd`; my @allpackages = getpackages(); chomp $pwd; my $mono_gac_prefix = ""; my $mono_path = ""; if ($dh{L_PARAMS}) { my @mono_paths = (); my @mono_gac_prefixes = (); # Add to existing paths, if set. push(@mono_gac_prefixes, $ENV{'MONO_GAC_PREFIX'}) if exists $ENV{'MONO_GAC_PREFIX'}; push(@mono_paths, $ENV{'MONO_PATH'}) if exists $ENV{'MONO_PATH'}; foreach (split(/:/, $dh{L_PARAMS})) { # Force the path absolute. my $full_path; if (m:^/:) { $full_path = $_; } else { $full_path = getcwd()."/$_"; } if (-d "$full_path/lib/mono/gac") { # it's a GAC prefix push(@mono_gac_prefixes, $full_path); } else { # it's a Mono PATH push(@mono_paths, $full_path); } } $mono_gac_prefix .= ":" . join(':', @mono_gac_prefixes); $mono_path .= ":" . join(':', @mono_paths); } else { $mono_gac_prefix = $ENV{'MONO_GAC_PREFIX'} if exists $ENV{'MONO_GAC_PREFIX'}; $mono_path = $ENV{'MONO_PATH'} if exists $ENV{'MONO_PATH'}; } if (defined($dh{INTERNAL_MONO_FLAG}) || (defined($ARGV[0]) && $ARGV[0] eq "internal-mono")) { $clr = "mono"; $cli_parser = "$pwd/debian/tmp/usr/bin/monodis"; $cli_parser_paths = "LD_LIBRARY_PATH=$pwd/debian/tmp/usr/lib MONO_PATH=$mono_path:$pwd/debian/tmp/usr/lib/mono/1.0:$pwd/debian/tmp/usr/lib/mono/2.0 MONO_GAC_PREFIX=$mono_gac_prefix "; $cli_version = `LD_LIBRARY_PATH=$pwd/debian/tmp/usr/lib $pwd/debian/tmp/usr/bin/mono --version 2>&1`; verbose_print("Will use built Mono (debian/tmp/usr/bin/monodis) for CIL parsing."); } elsif (-x "/usr/bin/monodis") { $clr = "mono"; $cli_parser = "/usr/bin/monodis"; $cli_parser_paths = "MONO_PATH=$mono_path MONO_GAC_PREFIX=$mono_gac_prefix "; verbose_print("Will use Mono (/usr/bin/monodis) for CIL parsing."); } elsif (-x "/usr/bin/ildasm") { $clr = "pnet"; $cli_parser = "/usr/share/cli-common/ildasm-monodis"; verbose_print("Will use Portable.NET (/usr/bin/ildasm) for CIL parsing."); } else { error("Could not find a CIL disassembler, aborting."); } { local $/=""; open(FILE, 'debian/control'); my $srcblock = ; close(FILE); if ($srcblock =~ m/Build-Depends(?:\-Indep)?\:(?:.*\n\s+)*.*cli\-common\-dev\s*\(>=\s*([^\)]+)\)/ && system("dpkg", "--compare-versions", $1, ">=", "0.8~") != 0) { warning("Warning! No Build-Depends(-Indep) on cli-common-dev (>= 0.8~)!"); } } if (!defined $cli_version || $cli_version eq "" ) { warning("Warning! No CLR is installed. (Probably forgot to Build-Depend on cli-virtual-machine.)"); } else { if ($clr eq "mono") { if ($cli_version =~ /(mint|version)\ ([\d\.]+)/) { $cli_version = "$2"; } else { error("Unable to parse Mono version out of \"$cli_version\"."); } } elsif ($clr eq "pnet") { if ($cli_version =~ /ILRUN\ ([\d\.]+)/) { $cli_version = "$1"; } else { error("Unable to parse Portable.NET version out of \"$cli_version\"."); } } else { error("Unable to detect CLR, aborting."); } } # Cleaning the paths given on the command line foreach (@ARGV) { s#/$##; s#^/##; } my $fh; verbose_print("Loading clilibs..."); my %clilibdata; open($fh, "cat /var/lib/dpkg/info/*.clilibs debian/*/DEBIAN/clilibs 2> /dev/null |"); while (<$fh>) { /(\S+)\s+(\S+)\s+(\w.*)\n?/; $clilibdata{"$1/$2"} = $3; } close($fh); verbose_print("Loading shlibs..."); my %shlibdata; open($fh, "cat /var/lib/dpkg/info/*.shlibs $pwd/debian/shlibs.local $pwd/debian/*/DEBIAN/shlibs 2> /dev/null |"); while (<$fh>) { /(\S+)\s+(\S+)\s+(\w.*)\n?/; my ($soname, $soversion, $dependency); #chomp; #my($soname, $soversion, $dependency) = split(/\s+/, $_, 3); $soname = $1; $soversion = $2; $dependency = $3; $shlibdata{"$soname.so.$soversion"} = $dependency; } close($fh); our $needs_net_1_0; our $needs_net_2_0; our $needs_net_2_1; our $needs_net_4_0; our $needs_net_4_5; my $failure = 0; foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp = tmpdir($package); my %refs = ( depends => [], recommends => [], suggests => [] ); my $found_exe = 0; use File::Spec; my @exclude_dirs = (); foreach(@{$dh{EXCLUDE}}) { push(@exclude_dirs, File::Spec->catdir($tmp, $_)); } $needs_net_1_0 = 0; $needs_net_2_0 = 0; $needs_net_2_1 = 0; $needs_net_4_0 = 0; $needs_net_4_5 = 0; # for idempotency delsubstvar($package, "cli:Depends"); delsubstvar($package, "cli:Suggests"); delsubstvar($package, "cli:Recommends"); # find binaries find (sub { return unless -f && !-l && /\.(exe|dll)$/; my $file = $_; if (/\.exe$/) { $found_exe = 1; } foreach(@exclude_dirs) { if($File::Find::dir =~ m/^$_/) { verbose_print("Excluding module $file from dir $File::Find::dir"); return; } } verbose_print("Package: $package Assembly: $file"); my %shlibRefs = resolveShlibRefs($package, $file); if ($shlibRefs{failure} == 1) { $failure = 1; } push(@{$refs{depends}}, @{$shlibRefs{depends}}); push(@{$refs{recommends}}, @{$shlibRefs{recommends}}); push(@{$refs{suggests}}, @{$shlibRefs{suggests}}); my %clilibRefs = resolveClilibRefs($package, $tmp, $file); push(@{$refs{depends}}, @{$clilibRefs{depends}}); push(@{$refs{recommends}}, @{$clilibRefs{recommends}}); push(@{$refs{suggests}}, @{$clilibRefs{suggests}}); }, $tmp); $refs{depends} = filterDuplicates($package, $refs{depends}); $refs{recommends} = filterDuplicates($package, $refs{recommends}); $refs{suggests} = filterDuplicates($package, $refs{suggests}); my $vm_ref = ""; if (!defined($dh{R_FLAG}) && $found_exe) { if ($clr eq "mono") { if ($needs_net_4_5) { $vm_ref = "mono-runtime (>= 3.0~), "; } elsif ($needs_net_4_0) { $vm_ref = "mono-runtime (>= 2.10.1), "; } elsif ($needs_net_2_1) { $vm_ref = "mono-runtime (>= 1.2.6), "; } elsif ($needs_net_2_0) { $vm_ref = "mono-runtime (>= 1.1.8.1), "; } elsif ($needs_net_1_0) { $vm_ref = "mono-runtime (>= 1.0), "; } else { $vm_ref = "mono-runtime (>= $cli_version), "; } } elsif ($clr eq "pnet") { $vm_ref = "pnet-interpreter (>= $cli_version), "; } } my $dh_ref = ""; if (-f "$tmp/usr/share/cli-common/packages.d/$package.installcligac") { # this package uses late GAC install, thus we need cli-common at package install time if (-f "debian/cligacpolicy" || -f "debian/$package.cligacpolicy") { # if this package uses dh_cligacpolicy then we need 0.5.4 for the policy-remove script in .postrm # and 0.5.6 to get a working .postrm script (tried also to remove on purge) $dh_ref = "cli-common (>= 0.5.6), "; } else { # we still need at least 0.5.1, as older versions silently missed installing policy files $dh_ref = "cli-common (>= 0.5.1), "; } } $vm_ref .= $dh_ref; #$deps .= join(", ", "", # sort { # # beautify the sort order, requested by meebey # my $apkg; # $a =~ /^\S+/; # $apkg=$&; # $b =~ /^\S+/; # if($apkg eq $&) { # return -1 if( ($a=~/>=/) && ($b=~/<)); # return 1 if( ($b=~/>=/) && ($a=~/<)); # } # $a cmp $b; # } (keys %depkgsFiltered) #); @{$refs{depends}} = sort(@{$refs{depends}}); @{$refs{recommends}} = sort(@{$refs{recommends}}); @{$refs{suggests}} = sort(@{$refs{suggests}}); addsubstvar($package, "cli:Depends", $vm_ref . join(", ", @{$refs{depends}})); addsubstvar($package, "cli:Recommends", join(", ", @{$refs{recommends}})); addsubstvar($package, "cli:Suggests", join(", ", @{$refs{suggests}})); } if ($failure != 0) { error("Error: unresolvable module references or missing shlibs entries, please check above errors!"); } sub filterDuplicates { my $package = shift; my $packages = shift; my %packagesFiltered; for (@{$packages}) { # filter undef, empties, dups and don't depend on ourself package if (!$_) { next; } /^(\S+)/; if ($1 && $1 ne $package) { $packagesFiltered{$_} = 1; } } # now filter the dupes coming from shlibs if (defined($dh{D_FLAG})) { my $fh; if (open($fh, "< $pwd/debian/$package.substvars" )) { while (<$fh>) { if (/^shlibs:Depends=(.*)\n?/) { for (split(/\s*,\s*/, $1)) { delete $packagesFiltered{$_}; } } } close($fh); } else { verbose_print("Could not read $pwd/debian/$package.substvars"); } } return [ keys %packagesFiltered ]; } sub loadDllMap { my $filename = shift; our $dllmapdata = shift; if (!-f $filename) { verbose_print("loadDllMap(): DLL map $filename not found, ignoring..."); return; } use XML::DOM; my $parser = new XML::DOM::Parser; my $doc = $parser->parsefile($filename, whitespace => 'strip'); my $root = $doc->getDocumentElement(); my @mapentries = $root->getElementsByTagName("dllmap"); foreach my $mapentry (@mapentries) { my $dll = $mapentry->getAttribute("dll"); my $target = $mapentry->getAttribute("target"); my $os = $mapentry->getAttribute("os"); my $valid = 1; if ($os) { $valid = ($os =~ m/^!/); $os =~ s/^!//; foreach (split(/,/, $os)) { if ($_ eq "linux") { $valid = !$valid; last; } } } if ($valid) { verbose_print("DLL map: '$dll' target: '$target'"); $dllmapdata->{$dll} = $target; } } } sub loadOverrides { my $package = shift; my $overridedata = shift; # load clideps overrides verbose_print("Loading clideps-override for $package..."); my $fh; open($fh, "cat $pwd/debian/$package.clideps-override 2> /dev/null |"); while (<$fh>) { /(\S+)\s+(\S+)(?:\s+(\(\S+\s+\S+\)))?\n?/; my ($type, $package, $version); $type = $1; $package = $2; $version = $3 if defined($3); if ($version) { $overridedata->{$package} = $type." ".$version; } else { $overridedata->{$package} = $type; } } close($fh); } sub resolveOverride { my $package = shift; my $pkgref = shift; my %ret = ( depends => undef, recommends => undef, suggests => undef ); my $type = "depends"; my $newpkgref = $pkgref; $newpkgref =~ m/(\S+)(?:\s+(\(\S+\s+\S+\)))?/; my $pkgname = $1; my $ver = $2; # hack for libc6, # for ia64 and alpha the package name is libc6.1, # for kfreebsd-i386 and kfreebsd-amd64 it is libc0.1 if ($pkgname =~ m/^libc[06]/) { $newpkgref = "libc6 $ver | libc6.1 $ver | libc0.1 $ver"; } my %overridedata; loadOverrides($package, \%overridedata); if (defined($overridedata{$pkgname})) { verbose_print("Found clideps-override: $pkgname for: $package"); my $override = $overridedata{$pkgname}; $override =~ m/(\S+)(?:\s+(\(\S+\s+\S+\)))?/; if ($1 eq "suggests" || $1 eq "recommends") { $type = $1; } elsif ($1 eq "ignores") { } else { warning("Warning: unknown override type: $1 in: '$override' for: $package!"); } if (defined($2)) { $newpkgref = "$pkgname $2"; } else { $newpkgref = $pkgref; } } verbose_print("resolved pkgref: $pkgref to $type: $newpkgref"); $ret{$type} = $newpkgref; return %ret; } sub resolveClilibRefs { my $package = shift; my $tmp = shift; my $assembly_filename = shift; my %ret = ( depends => [], recommends => [], suggests => [] ); my (undef, $tmpfile) = File::Temp::tempfile("/tmp/".basename($0).".XXXX", UNLINK => 1); my $command = "LANG=C $cli_parser_paths MONO_GAC_PREFIX=\$MONO_GAC_PREFIX:$tmp/usr $cli_parser --assemblyref $assembly_filename 2>&1 > $tmpfile"; verbose_print("running CLI parser command: $command"); system($command); if ($?) { my $output; { local *F; open(F, $tmpfile); local $/; $output = ; close(F); } error("cli_parser call failed: '".$command."' rc: $? output: $output"); return; } my ($ver, $name, $key); local *F; open(F, $tmpfile); while ( ) { $ver = $1 if /Version=(.*)\n/; $name = $1 if /Could not find assembly ([^,]+),/; $name = $1 if /Name=(.*)\n/; $ver = "$1.$2" if /Major\/Minor:\s*(\d+),(\d+)/; $ver .= ".$1.$2" if /Build:\s*(\d+),(\d+)/; if (/0x\S+:.([ABCDEF0123456789 ]+)\n/ || /Token:\s*(\w+)/) { $key = $1; $key =~ s/\ //g; $key = $ver . "__" . lc($key); my $compat = "$name/$key"; if (!defined($clilibdata{$compat})) { warning("Warning: No Debian dependency data for $name ($key)!"); } else { my $pkgref = $clilibdata{$compat}; my %overriddenRef = resolveOverride($package, $pkgref); push(@{$ret{depends}}, $overriddenRef{depends}); push(@{$ret{recommends}}, $overriddenRef{recommends}); push(@{$ret{suggests}}, $overriddenRef{suggests}); } if ($name eq "mscorlib") { if ($ver eq "1.0.5000.0") { $needs_net_1_0 = 1; } elsif ($ver eq "2.0.3600.0") { $needs_net_2_0 = 1; } elsif ($ver eq "2.0.0.0") { $needs_net_2_0 = 1; } elsif ($ver eq "2.1.0.0") { $needs_net_2_1 = 1; } elsif ($ver eq "4.0.0.0") { # HACK: Mono 3.0 only provides a .NET 4.0 corlib for development # support. At runtime Mono 3.0 always loads the 4.5 corlib though as # .NET 4.5 and .NET 4.0 both contain a corlib with the same assembly # version but the 4.5 corlib contains more symbols! Thus we need to # always depend on the 4.5 corlib with Mono 3.0. # TODO: check cli_version for >= 3.0 and fallback to needs_net_4_0 $needs_net_4_5 = 1; } else { warning("Warning: Unknown mscorlib version: $ver!"); } } } } close(F); return %ret; } sub resolveShlibRefs { my $package = shift; my $assembly_filename = shift; my $config_filename = $assembly_filename.".config"; my %ret = ( depends => [], recommends => [], suggests => [], failure => 0); if (-r $config_filename) { verbose_print("Found DLL map: $config_filename"); } else { verbose_print("Found no specific DLL map, but resolving modulerefs anyway"); } # load dll maps verbose_print("Loading DLL maps for: $assembly_filename..."); my %dllmapdata; loadDllMap("/etc/mono/config", \%dllmapdata); loadDllMap("$pwd/debian/tmp/etc/mono/config", \%dllmapdata); loadDllMap($config_filename, \%dllmapdata); # parse modulerefs my (undef, $tmpfile) = File::Temp::tempfile("/tmp/".basename($0).".XXXX", UNLINK => 1); my $command = "LANG=C $cli_parser_paths $cli_parser --moduleref $assembly_filename 2>&1 > $tmpfile"; system($command); if ($?) { my $output; { local *F; open(F, $tmpfile); local $/; $output = ; close(F); } error("cli_parser call failed: '".$command."' rc: $? output: $output"); return; } local *F; open(F, $tmpfile); while ( ) { my $moduleref = $1 if /\d+:\s+(.*)\n/; if (!defined($moduleref)) { next; } my $skip = 0; foreach my $excluded_moduleref (@{$dh{MODULE_EXCLUDE}}) { # explicitly excluded modulerefs are never checked $excluded_moduleref =~ /^(i:)?(.*)/; my $exclude_pattern = "^$2(.dll)?\$"; if (defined $1 && $1 eq "i:" && $moduleref =~ /$exclude_pattern/i) { # i: specified; case insensitive match verbose_print("Ignoring moduleref $moduleref (case insensitive)"); $skip = 1; last; } elsif ($moduleref =~ /$exclude_pattern/) { # case sensitive verbose_print("Ignoring moduleref $moduleref"); $skip = 1; last; } } next if $skip; my $target = $dllmapdata{$moduleref}; my $fullTarget = $target; if (defined($target)) { $target = basename($target); verbose_print("Resolved moduleref via DLL map: $moduleref to: $target"); } elsif (defined($shlibdata{$moduleref})) { verbose_print("Resolved moduleref via direct match in shlibs"); } elsif (resolvePrivateLibrary($package, $moduleref, $package)) { # There is no DllMap, but the package ships the private library alongside the assembly verbose_print("Resolved moduleref to private library $moduleref"); next; } elsif (resolvePrivateLibrary($package, "lib" . $moduleref . ".so", $package)) { # There is no DllMap, the assembly is relying on Mono's "foo" -> "libfoo.so" # translation, and is shipping libfoo.so alongside the assembly verbose_print("Resolved moduleref to private library lib" . $moduleref . ".so"); next; } else { warning("Error: Could not resolve moduleref: $moduleref for: $assembly_filename!"); $ret{failure} = 1; next; } my $pkgref; if (defined($target) && defined($shlibdata{$target})) { $pkgref = $shlibdata{$target}; } elsif (defined($shlibdata{$moduleref})) { $pkgref = $shlibdata{$moduleref}; } elsif (defined($target) && defined($shlibdata{$target.".0"})) { # for DLL maps that have an unversioned library as target $pkgref = $shlibdata{$target.".0"}; } else { if(!resolvePrivateLibrary($package, $fullTarget, $package)) { # Private library can't be found in the current package. Try to resolve it # in the other binary packages, and add a strong dependency if we find it. foreach my $binary_package (@allpackages) { verbose_print("Checking $binary_package for $fullTarget"); if(resolvePrivateLibrary($package, $fullTarget, $binary_package)) { verbose_print("Found private library in $binary_package"); $pkgref = $binary_package . " (= \${binary:Version})"; verbose_print("pkgref is $pkgref"); last; } } if (!defined($pkgref)) { warning("Error: Missing shlibs entry: $target or $moduleref for: $assembly_filename!"); $ret{failure} = 1; } } else { verbose_print("Found private library $target for $moduleref"); next; } } my %overriddenRef = resolveOverride($package, $pkgref); push(@{$ret{depends}}, $overriddenRef{depends}); push(@{$ret{recommends}}, $overriddenRef{recommends}); push(@{$ret{suggests}}, $overriddenRef{suggests}); } close(F); return %ret; } sub resolvePrivateLibrary { my $package = shift; my $target = shift; my $resolveIn = shift; my $library_file; use File::Spec; if (File::Spec->file_name_is_absolute($target)) { # If the DLLMap target is absolute, we should check that the target # exists in that location. Since we're currently in the directory # with the assembly, we need to back out first. my @targetDirs = File::Spec->splitdir($target); my @cwdComponents = File::Spec->splitdir(File::Spec->rel2abs(File::Spec->curdir())); my @upDirs = ("../", "../"); # Find where the last occurance of tmpdir is in $curdir, and add enough # updirs to get there from cwd. while(join("/", ($cwdComponents[-2], $cwdComponents[-1])) ne tmpdir($package)) { pop(@cwdComponents); push(@upDirs, "../"); } $library_file = File::Spec->rel2abs(File::Spec->catdir((File::Spec->curdir(), @upDirs, tmpdir($resolveIn), @targetDirs))); } else { # If the DLLMap target is not absolute, look in the same directory # as the assembly. $library_file = basename($target); } verbose_print("Looking for $target at $library_file"); if (-f $library_file || -s $library_file) { return 1; } else { return 0; } } =head1 SEE ALSO L This program is a part of cli-common-dev. =head1 AUTHOR Mirco Bauer , Eduard Bloch , partialy based on code from Brendan O'Dea and Joey Hess . =cut cli-common-0.9+nmu1/policy-install 0000755 0000000 0000000 00000001752 12473430700 014057 0 ustar #!/bin/bash # This file is actually used to create and to remove entries from a # policy. It automatically removes old versions, and if there is a new # one, it installs it. This allows the system to remove the "best" one # and have it pick the second-best, if installed. # Variables ASSEMBLY=$1 VERSION=$2 COMBINED="$VERSION.$ASSEMBLY" POLICY="policy.$VERSION.$ASSEMBLY" # Remove the old policy, if we have one installed if [ -f /usr/share/cli-common/packages.d/$POLICY.installcligac ]; then /usr/share/cli-common/policy-remove $ASSEMBLY $VERSION > /dev/null fi # Choose the correct one for file in $(ls /usr/share/cli-common/policies.d/???-$COMBINED \ 2>/dev/null | sort -rn) do # Copy this one as a installcligac cp $file /usr/share/cli-common/packages.d/$POLICY.installcligac #echo "Installing GAC policy file ($POLICY) into available GACs" /usr/share/cli-common/gac-package-install $POLICY > /dev/null || exit 1 # We just deal with the one exit done cli-common-0.9+nmu1/ildasm-monodis 0000755 0000000 0000000 00000004651 12473430700 014034 0 ustar #!/usr/bin/perl # # Setup # # Directives use strict; use warnings; # Modules use Getopt::Long; # # Variables # # Filenames my $assemblyref; # Get the mode GetOptions( "assemblyref!" => \$assemblyref, ); # Get the filenames my $dll_filename = shift; usage() if (!defined $dll_filename); # Figure out what to do if ($assemblyref) { parse_assemblyref($dll_filename); } else { # As per meeby, do assemblyref parse_assemblyref($dll_filename); } # # Create a pipe to the 'ildasm' program and give it the given # DLL. Then, take the results, parse them, and write it out to stdout. # sub parse_assemblyref { # Get the parameters my $dll_filename = shift; # Open the pipe open PIPE, "/usr/bin/ildasm $dll_filename |" or die "Cannot open /usr/bin/ildasm $dll_filename ($!)"; # Print out the header print "AssemblyRef Table\n"; # Go through the results my $count = 0; while ( ) { # Clean up the line chomp; # Check for assembly ref if (/^\.assembly extern (.*?)$/) { # We have an assembly reference my $name = $1; my $version = undef; my $key = "\tZero sized public key"; $count++; # On occasion, the name has quotes around it, but monodis # doesn't. $name =~ s/\'//g; $name =~ s/\"//g; # Go through and parse the rest of the variables until we # get to a } which signals the end of the block. while ( ) { # Stop if we get a } last if /^\}/; s/^\s+//; # Check for the keys if (/\.ver (\d+):(\d+):(\d+):(\d+)/) { # Make it look like mono $version = "$1.$2.$3.$4"; next; } # Check for public key if (/\.publickeytoken = \((.*?)\)/) { # Monodis adds a space at the end of this next line $key = "\tPublic Key:\n0x00000000: $1 "; } } # Emit it print join("\n", "$count: Version=$version", "\tName=$name", $key, ), "\n"; } } # Mono also has an extra space at the end print "\n"; # Close the pipe close PIPE; } # # Usage. Just your typical complain function that automatically exits # out of perl after complaining. # sub usage { print STDERR join("\n", "USAGE: $0 [options] /path/to/something.dll", "", "Options:", sprintf("%-20.20s %s", "--assemblyref", "Dumps output like 'monodis --assemblyref'"), ), "\n"; exit 1; } cli-common-0.9+nmu1/gac-package-install 0000755 0000000 0000000 00000005540 12473430700 014702 0 ustar #!/usr/bin/perl # # Setup # # Directives use strict; use warnings; # Modules use File::Basename; # This script gets the name of the package as the first parameter. It # parses the file given, figures out the black and white listing, then # installs them as appropriate. If there is a second parameter, this # is the only CLR installed. # # Handle the input file # # Get the package my $pkg = $ARGV[0]; my $use_clr = $ARGV[1]; my $full = "/usr/share/cli-common/packages.d/$pkg"; # Make sure it exists if ( ! -f "$full.installcligac" ) { print STDERR "! $full.installcligac doesn't exist!\n"; exit 1; } # Parse the file unless (open INPUT, "<$full.installcligac") { print STDERR "! Cannot open $full.installcligac ($!)\n"; exit 2; } my @dlls = (); my %blacklist = (); my %whitelist = (); while () { # Clean up the line and ignore blanks and comments chomp; s/^\s+//; s/\s+$//; next if /^\#/; next if /^\s*$/; # Split on the space my @p = split(/\s+/); # Check the DLL my $dll = shift @p; if (! -f $dll) { print STDERR "! Assembly $dll does not exist\n"; exit 3; } push @dlls, $dll; # Go through the listing while (@p) { # Get it my $p = shift @p; #print "D: List -> $dll: $p\n"; # Add it to the appropriate list. The dll:$dll key is used for # sanity checking. if ($p =~ s/^-//) { $blacklist{"$p:$dll"}++; $blacklist{"dll:$dll"}++; } elsif ($p =~ s/^\+//) { $whitelist{"$p:$dll"}++; $whitelist{"dll:$dll"}++; } } } # Do some sanity checking foreach my $dll (@dlls) { if (defined($whitelist{"dll:$dll"}) && defined($blacklist{"dll:$dll"})) { print STDERR "! $dll has both a white- and blacklist.\n"; print STDERR "! Ignoring blacklist.\n"; } } # Go through the installation targets foreach my $clr (glob("/usr/share/cli-common/runtimes.d/*")) { # Ignore temporary files next if $clr =~ /~$/; next if $clr =~ /^\./; # Get the "name" my $name = basename($clr); # Get the formal name my $formal = `$clr name`; $formal = $name if !defined $formal || $formal =~ /^\s*$/; chomp($formal); # Only use the one CLR if given next if (defined $use_clr && $name ne $use_clr); # Figure out the package list my @install = (); foreach my $dll (@dlls) { # Check the white list if (defined $whitelist{"dll:$dll"}) { next if (!defined $whitelist{"$name:$dll"}); } elsif (defined $blacklist{"dll:$dll"}) { next if (defined $blacklist{"$name:$dll"}); } # We are going to install this one push @install, $dll; } # Install it my $t = scalar(@install) . " assemblies"; $t = "1 assembly" if (@install == 1); print STDOUT "* Installing $t from $pkg into $formal\n"; system($clr, "install", $pkg, @install) == 0 or die "E: Installation of $pkg with $clr failed\n"; } cli-common-0.9+nmu1/postrm-cligacpolicy 0000644 0000000 0000000 00000000241 12473430700 015065 0 ustar if [ "$1" = "remove" ] || [ "$1" = "upgrade" ] && [ -x /usr/share/cli-common/policy-remove ]; then /usr/share/cli-common/policy-remove #ASSEMBLY# #VERSION# fi cli-common-0.9+nmu1/cli-nant.make 0000644 0000000 0000000 00000000045 12473430700 013524 0 ustar export DH_OPTIONS += --with=cli-nant cli-common-0.9+nmu1/dh_clistrip 0000755 0000000 0000000 00000004051 12473430700 013413 0 ustar #!/usr/bin/perl -w =head1 NAME dh_clistrip - strips CLI debug symbols from package build directories =cut use strict; use File::Find; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B [S>] [B<-X>I - ] [--dbg-package=package] =head1 DESCRIPTION dh_clistrip is a debhelper program that removes debug symbols from CLI libraries and applications. dh_clistrip deletes all *.exe.mdb and *.dll.mdb files. =head1 OPTIONS =over 4 =item B<-X>I
- , B<--exclude=>I
- Exclude files that contain "item" anywhere in their filename from being deleted. You may use this option multiple times to build up a list of things to exclude. =item B<--dbg-package=>I
Moves the debug symbols to the specified package. =back =cut init(); my $pwd = `pwd`; chomp $pwd; # This variable can be used to turn off stripping (see Policy). if (defined $ENV{DEB_BUILD_OPTIONS} && $ENV{DEB_BUILD_OPTIONS} =~ /nostrip/) { exit; } foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp = tmpdir($package); my $debug_pkg = ''; if (defined($dh{DEBUGPACKAGES})) { $debug_pkg = @{$dh{DEBUGPACKAGES}}[0]; verbose_print("debug_pkg: $debug_pkg"); } if ($package eq $debug_pkg) { # skip debug package next; } # find debug symbols find (sub { foreach my $exclude (@{$dh{EXCLUDE}}) { return if /$exclude/; } return unless -f && /\.(exe|dll)\.mdb$/; my $file = $_; my $dir = $File::Find::dir; if ($debug_pkg ne '') { my $debug_dir = $dir; verbose_print("dir: $dir"); $debug_dir =~ s!$tmp!!; verbose_print("debug_dir: $debug_dir"); $debug_dir = $pwd . "/debian/$debug_pkg/" . $debug_dir; verbose_print("debug_dir: $debug_dir"); if (! -d $debug_dir) { doit("install", "-d", $debug_dir); } verbose_print("moving $file to $debug_dir"); doit("mv", $file, $debug_dir); } else { verbose_print("deleting $file"); doit("rm", $file); } }, $tmp); } =head1 SEE ALSO L This program is part of cli-common-dev. =head1 AUTHOR Mirco Bauer =cut cli-common-0.9+nmu1/framework-install 0000755 0000000 0000000 00000000553 12473430700 014553 0 ustar #!/bin/bash # Make sure the GAC file exists if [ ! -x /usr/share/cli-common/runtimes.d/$1 ]; then echo ! Cannot install framework $1 exit 1 fi for file in /usr/share/cli-common/packages.d/*.installcliframework do if [ -f $file ]; then /usr/share/cli-common/framework-package-install \ $(basename $file .installcliframework) \ $1 fi done cli-common-0.9+nmu1/dh_makeclilibs 0000755 0000000 0000000 00000025105 12473430700 014044 0 ustar #!/usr/bin/perl -w =head1 NAME dh_makeclilibs - automatically create clilibs file =cut use strict; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B [S>] [B<-r>] [B<-V>I<[dependancies]>] [B<-m>I ] [B<-l>I ] [B<-X>I - ] =head1 DESCRIPTION dh_makeclilibs is a debhelper program that automatically scans for versioned CIL (.NET) assemblies, and generates a clilibs file for the libraries it finds. By default, dh_makeclilibs scans the .dll files in the package directories and writes the discovered compatibility data (major/minor, build, token) to "clilibs" files in the appropriate packages. However, if a file like debian/package.clilibs is found, this one will be installed and no scanning is performed. =head1 OPTIONS =over 4 =item B<-V>, B<-V>I
=item B<--version-info>, B<--version-info=>I By default, the clilibs file generated by this program does not make packages depend on any particular version of the package containing the assembly. It may be necessary for you to add some version dependency information to the clilibs file. If -V is specified with no dependency information, the current version of the package is plugged into a dependency that looks like "packagename (>= packageversion)". If -V is specified with parameters, the parameters can be used to specify the exact dependency information needed (be sure to include the package name). Beware of using -V without any parameters; this is a conservative setting that always ensures that other packages' shared library dependencies are at least as tight as they need to be, so that if the maintainer screws up then they won't break. The flip side is that packages might end up with dependencies that are too tight and so find it harder to be upgraded. =item B<-m>I Like -V, but specifies only the version string, the package name comes from the package that is actually processed. This option is more flexible if you try to set a range of valid versions for different assembly packages coming from one source package. =item B<-l>I Specifies the (expected) version of this package when the compatibility to the current assemblies will break. =item B<-r> An experimental option to automaticaly guess the next incompatible upstream version and insert them (like working with -l and -m options, see above). Do not expect the guessed values to be always correct - normally, the usualy assumed version string has the form generation.major.minor where versions with changes in "minor" are compatible and "major" versions break with compatibility. =item B<-X>I - , B<--exclude=>I
- Exclude files that contain "item" anywhere in their filename or directory from being treated as shared libraries. =item B<--internal-mono> Uses the Mono runtime in . (used for bootstrapping Mono packages) =back =head1 EXAMPLES dh_makeclilibs Assuming this is a package named libfoobar0.9x-cil, generates a clilibs file that looks something like: libfoobar 1.0.2345.0_23a12f34 libfoobar0.9x-cil dh_makeclilibs -V Assuming the current version of the package is 0.93-3, generates a clilibs file that looks something like: libfoobar 1.0.2345.0_23a12f34 libfoobar0.9x-cil (>= 0.93-3) dh_makeclilibs -V 'libfoobar0.9x-cil (>= 0.92)' Generates a clilibs file that looks something like: libfoobar 1.0.2345.0_23a12f34 libfoobar0.9x-cil (>= 0.92) Assuming that your package creates libfoobar-cil and liblafasel-cil, which are compatible to 0.92 versions but the upstream is going to break compatibility in the next version, 0.94: dh_makeclilibs -m 0.92 -l 0.94 Generates clilibs file that looks something like: libfoobar 1.0.2345.0_23a12f34 libfoobar-cil (>= 0.92), libfoobar-cil (<< 0.94) and liblafasel 1.0.2345.0_23a12f34 liblafasel-cil (>= 0.92), liblafasel-cil (<< 0.94) =cut # gar, debhelper 7.1 defines -V for all scripts already :( init(options => { # "V", => \$dh{V_FLAG}, "r" => \$dh{R_FLAG}, "m=s" => \$dh{M_PARAMS}, "l=s" => \$dh{L_PARAMS}, "internal-mono" => \$dh{INTERNAL_MONO_FLAG}, }); my $clr; my $cli = '/usr/bin/cli'; my $cli_version = `$cli --version 2>&1`; my $cli_parser; my $sn = 'sn'; if (defined($dh{INTERNAL_MONO_FLAG}) || (defined($ARGV[0]) && $ARGV[0] eq "internal-mono")) { $clr = "mono"; my $mono_path = "LD_LIBRARY_PATH=debian/tmp/usr/lib MONO_PATH=debian/tmp/usr/lib/mono/4.0 MONO_CFG_DIR=debian/tmp/etc"; $cli_parser = "$mono_path debian/tmp/usr/bin/monodis"; $sn = "$mono_path debian/tmp/usr/bin/mono debian/tmp/usr/lib/mono/4.5/sn.exe"; verbose_print("Will use build Mono (debian/tmp/usr/bin/monodis) for CIL parsing."); } elsif (-x "/usr/bin/monodis") { $clr = "mono"; $cli_parser = "/usr/bin/monodis"; verbose_print("Will use Mono (/usr/bin/monodis) for CIL parsing."); } elsif (-x "/usr/bin/ildasm") { $clr = "pnet"; $cli_parser = "/usr/share/cli-common/ildasm-monodis"; verbose_print("Will use Portable.NET (/usr/bin/ildasm) for CIL parsing."); } else { error("Could not find a CIL disassembler, aborting."); } { local $/=""; open(FILE, 'debian/control'); my $srcblock =
; close(FILE); if ($srcblock =~ m/Build-Depends(?:\-Indep)?\:(?:.*\n\s+)*.*cli\-common\-dev\s*\(>=\s*([^\)]+)\)/ && system("dpkg", "--compare-versions", $1, ">=", "0.8~") != 0) { warning("Warning! No Build-Depends(-Indep) on cli-common-dev (>= 0.8~)!"); } } my $fh; my %shlibdata; foreach my $package (@{$dh{DOPACKAGES}}) { next if is_udeb($package); my $tmp = tmpdir($package); my %seen; my $need_ldconfig = 0; doit("rm", "-f", "$tmp/DEBIAN/clilibs"); if (-e "debian/$package.clilibs" ) { complex_doit("cat debian/$package.clilibs > $tmp/DEBIAN/clilibs"); } else { # So, we look for files or links to existing files with names that # match "*.so*". Matching *.so.* is not good enough because of # broken crap like db3. And we only look at real files not # symlinks, so we don't accidentually add clilibs data to -dev # packages. This may have a few false positives, which is ok, # because only if we can get a library name and a major number from # objdump is anything actually added. my $exclude = ''; if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { $exclude = "! \\( $dh{EXCLUDE_FIND} \\) "; } open(FIND, "find $tmp -type f \\( -name '*.dll' \\) $exclude |"); dll: while ( ) { chomp; my ($library, $ver, $libfile); $libfile = $_; my $sig; my $command = "$sn -T $libfile 2>&1"; verbose_print("running signature reader command: $command"); my $output = `$command`; if ($? == 0) { $sig = $output; if ($sig !~ s/.*key token: (\w+).*/$1/is) { warning "$libfile has no signature, ignoring"; next dll; } } else { error("signature reader call failed: '$command' rc: $? output:\n$output"); return; } $command = "$sn -v $libfile 2>&1"; verbose_print("running signature verifier command: $command"); $output = `$command`; if ($? != 0) { verbose_print("signature verifier call failed: '$command' rc: $? output:\n$output"); warning("$libfile has no valid signature, ignoring"); next dll; } $command = "LANG=C MONO_GAC_PREFIX=\$MONO_GAC_PREFIX:$tmp/usr $cli_parser --assembly $libfile 2>&1"; verbose_print("running CLI parser command: $command"); $output = `$command`; if ($? == 0) { $output =~ m/Name:\s+(\S+)/; $library = $1; $output =~ m/Version:\s+(\S+)/; $ver = $1; } else { error("cli_parser call failed: '$command' rc: $? output:\n$output"); return; } if (!-d "$tmp/DEBIAN") { doit("install", "-d", "$tmp/DEBIAN"); } my $deps = $package; # Call isnative becuase it sets $dh{VERSION} # as a side effect. isnative($package); my $version = $dh{VERSION}; # Old compatibility levels include the # debian revision, while new do not. if (!compat(3)) { # Remove debian version, if any. $version =~ s/-[^-]+$//; } if (defined($dh{M_PARAMS}) && $dh{M_PARAMS} ne '') { $version = $dh{M_PARAMS}; } if ($dh{V_FLAG_SET}) { if ($dh{V_FLAG} ne '' ) { $deps = $dh{V_FLAG}; } else { $deps = "$package (>= $version)"; } } if (defined($dh{R_FLAG})) { $version =~ s/-[^-]+$//; my @uvers = split ( /\./, $version ); $uvers[1]++; $deps = "$package (>= $version), $package (<< ".join(".", @uvers).")"; } if (defined($dh{M_PARAMS})) { $deps = "$package (>= ".$dh{M_PARAMS}.")"; } if (defined($dh{L_PARAMS})) { $deps .= ", $package (<< ".$dh{L_PARAMS}.")"; } if (defined($library) && defined($ver) && defined($deps) && $library ne '' && $ver ne '' && $deps ne '') { # Prevent duplicate lines from entering the file. my $line = "$library $ver" . "__$sig $deps"; # extra dependencies are to be resolved by dh_clideps, # don't forward the dependency libs to the apps where it # does not belong to # if ( my $extra = extraDeps ($libfile) ) { $line .= ", $extra"; } if (!$seen{$line}) { $seen{$line} = 1; complex_doit("echo '$line' >> $tmp/DEBIAN/clilibs"); } } } } close FIND; if (-e "$tmp/DEBIAN/clilibs") { doit("chmod", 644, "$tmp/DEBIAN/clilibs"); doit("chown", "0:0", "$tmp/DEBIAN/clilibs"); } } =head1 SEE ALSO L This program is a part of cli-common-dev. =head1 KNOWN BUGS Will possibly not work correctly with DH_COMPAT levels 1 and 2. =head1 AUTHOR Mirco Bauer , Eduard Bloch , inspired by dh_makeshlibs by Joey Hess =cut