work/0000755000000000000000000000000013441477100006727 5ustar work/cli-nant.make0000644000000000000000000000004513441477100011272 0ustar export DH_OPTIONS += --with=cli-nant work/cli-policy.sgml0000644000000000000000000012212313441477100011660 0ustar Debian CLI Policy Mirco Bauer meebey@debian.org Brandon Hale brandon@smarterits.com Sebastian Dröge slomo@debian.org Dylan R. E. Moonfire debian@mfgames.com Version 0.7 This document lays out basic policies regarding packaging Mono, other CLRs and CLI based applications/libraries on Debian GNU/Linux. Copyright © 2005-2009 Mirco Bauer Copyright © 2005 Brandon Hale Copyright © 2006 Sebastian Dröge Copyright © 2006 Dylan R. E. Moonfire.

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.

Policy History

Here are the changes to the Debian CLI Policy document.

Changes from 0.5.1 to 0.7: : GAC libraries must now go in /usr/lib/cli/assembly_name-X.Y instead of /usr/lib/cli/upstream_package_name-X.Y, as one source package might ship many assemblies with different ABI versions. This would produce very confusing directory names. : Late-GAC install is now mandatory. : Added CLI SDKs as alternative to the compiler. : Using the mono.snk key of cli-common-dev is now mandatory if upstream doesn't ship one. : Replaced MONO_SHARED_DIR workaround with cli.make and MONO_DISABLE_SHM. : Added debhelper 7 example. : Added reference to the mono-api-check tool and made raising clilibs version mandatory. : Updated URL to Microsoft .NET Guidelines. : Made upstream tarball names clearer. : Replaced find commands with dh + cli.make. : Removed ASP.NET as it's not a programming language and added IronPython and IronRuby.

Changes from 0.5.0 to 0.5.1: : Added examples for the different meanings of package name. : Explicitly name the "lib" prefix requirement for library packages.

Changes from 0.4.4 to 0.5.0: Removed DRAFT tag, the policy is now official. : Added C# 3.0 to the compiler list. : Added dh_clifixperms as alternative to the find command.

Changes from 0.4.2 to 0.4.3: : Fixed order of dh_installcligac calls. : Fixed debhelper example (order). : Fixed cdbs example (order).

Changes from 0.4.1 to 0.4.2: : Fixed naming of the policy files.

Changes from 0.4.0 to 0.4.1: : Fixed typo.

Changes from 0.3.0 to 0.4.0: : Added nemerle to the compilers. : Added a packaging chapter that includes some of the old chapter and some new. : Added informations about signing and policy files. : Added and consolidated the information on dh_installcligac. : Require that files are installed into /usr/lib/package or /usr/lib/cli/package-X.Y now.

Changes from 0.2.1 to 0.3.0: : Added URL for the ".NET" term. : Added explanation of GAC. : Added section for naming of GAC packages.

Changes from 0.2.0 to 0.2.1: : Added examples for debhelper and CDBS.

Changes from 0.1.1 to 0.2.0: : Added chapter "Policy History" : Compiler dependency is no longer strict on mono-mcs : Note that dh_makeclilibs must be called before dh_clideps : Moved dh_clideps and dh_makeclilibs into their own subsections : Added chapter "File Permissions" : cli-wrapper is now deprecated : Added an external link for DllNotFoundException

Used Terms

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:

CLI - Common Language Infrastructure

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 and standard.

CLR - Common Language Runtime

The CLR is an implementation of the CLI (often with a lot of add-ons or tools for developers). Mono and Microsoft .NET Framework are CLRs.

CIL - Common Intermediate Language

The CIL is the format of the bytecode for binaries and libraries used by the CLI.

".NET" or long "Microsoft .NET Framework"

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 CLI.

If you really want to use the ".NET" term in a correct form please refer to the .

GAC - Global Assembly Cache

The GAC contains and manages the libraries for the CLR. It allows users to install multiple versions of the same library and enables loading of the right version when an application is executed.

Mono stores the GAC at /usr/lib/mono/gac

DotGNU Portable.NET stores the GAC at /usr/lib/cscc/lib

Package Names

There are different set of package names we refer in this policy to. Here a list of examples for the different names: assembly (file) names: gtk-sharp.dll log4net.dll FlickrNet.dll (debian) source package names: gtk-sharp2 log4net libflickrnet (debian) binary package names: libgtk2.0-cil libgnome2.0-cil liblog4net1.2-cil libflickrnet2.1.5-cil upstream package names (a good indicator is the pkg-config file name): gtk-sharp-2.0 log4net flickrnet upstream tarball names (without version and file extension): gtk-sharp-2.12.9.tar.gz -> gtk-sharp log4net-1.2.0-beta8.zip -> log4net FlickrNet-25207.zip -> FlickrNet

Packaging Policy

This section describes the additions to the that are required for CLI packages.

General Packaging Architecture

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.

File Locations

The package's applications, libraries and meta-data must be installed into /usr/lib/upstream_package_name .

Libraries that will be installed into the GAC must be installed into /usr/lib/cli/assembly_name-X.Y (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 /usr/lib/mono/upstream_package_name path should only be used for Mono project packages.

Example path for the log4net package: /usr/lib/cli/log4net-1.2

Never install native "glue" libraries into /usr/lib, instead install them at /usr/lib/cli/assembly_name-X.Y . 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 in a Debian Policy conformant way.

You must not install application files (.exe) directly into /usr/bin. Instead create a wrapper script into /usr/bin to allow them to be run without path and the .exe suffix.

File Permissions

Source code files (*.cs, *.vb, *.boo, 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 Debhelper's /usr/bin/dh combined with cli.make. Otherwise you should add dh_clifixperms after dh_fixperms in the binary-* targets of debian/rules.

Build Dependencies

At a minimum, CLI packages should Build-Depends on cli-common-dev (>= 0.7) and the appropriate CLI compiler or CLI SDK package.

Current CLI compilers in Debian: C#: mono-mcs (>= 1.0) | c-sharp-compiler C# 2.0: mono-gmcs (>= 1.1.8) | c-sharp-2.0-compiler C# 3.0: mono-gmcs (>= 1.2.5) | c-sharp-3.0-compiler Nemerle: nemerle (>= 0.9) Boo: boo (>= 0.5.6) Current CLI SDKs in Debian: Mono: mono-devel (>= 2.4.2.3)

Software that uses Mono via the C interface library (libmono.so) 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 debhelper, cdbs, dpatch and quilt into Build-Depends-Indep. See the for more information on this.

GAC Library Packaging

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.

Naming & Versioning

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 cli-common-dev package.

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 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 lib.

To reflect the ABI stability and prevent breakages when a ABI-incompatible version is released, a similar solution for 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 assembly version.

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 libfoo123-X.Y-cil (i.e. libmono-c5-0.5-cil) to improve the readability.

The -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-cil or 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 (1.2.0.0 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.

Policy Files

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 . These files have to be named policy.X.Y.foo.dll (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

The 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 and also has a similar use: it is used by dh_clideps helper script to find the correct dependencies.

You should always set the minimum required version of the library in the clilibs file.

pkg-config File

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 in /usr/lib/pkgconfig. The filename must be identical to that shipped by upstream.

Signing

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 ABI compatbility.

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.

non-GAC Library Packaging

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.

Naming

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 /usr/lib/upstream_package_name.

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.

Mono Specific Packaging help

This section offers help with common problems encountered when packaging Mono-specific applications for Debian.

Naming

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.

DLL Maps

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.

Introduction

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 which will stop the execution of the program.

Solution: DLL map config file

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.

<configuration> <dllmap dll="foo" target="libfoo.so.0"/> </configuration>

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.

MONO_DISABLE_SHM

The Mono runtime uses a shared directory, by default ~/.wapi. This directory will be created/used when any CLI application is executed (like the C# compiler mcs).

There are 2 problems with this: In an autobuilder environment often the running user has no home directory. Mono uses the wrong home directory when running within fakeroot (it tries /root/.wapi instead of $HOME/.wapi ).

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 cli.make from cli-common-dev in debian/rules or to manually set the MONO_DISABLE_SHM environment variable. export MONO_DISABLE_SHM = 1

DotGNU Portable.NET Packaging help

This section offers help to common problems encountered when packaging DotGNU Portable.NET-specific applications for Debian.

Naming

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.

Appendix Helper Scripts: cli-common-dev

When using cli-common-dev and the included dh_* scripts packages must Build-Depends on cli-common-dev (>= 0.7) (this version may change later, when cli-common-dev has changes which are required to be used by all CLI packages, the CLI Policy version will represent such changes).

dh_makeclilibs

dh_makeclilibs is used to create the clilibs control files which are used later by dh_clideps for this or other packages. It must only be used when your package contains libraries that other packages may link against.

It has the same use (and very similar parameters) to dh_makeshlibs. You should always use the most minimal version necessary.

This program must be called before dh_clideps.

See for details.

dh_clideps

dh_clideps is used to discover the native and managed dependencies of the packages. It uses the clilibs control files, the .config of assemblies and the shlibs files created by dh_makeshlibs. The discovered dependencies are written into the ${cli:Depends} variable.

dh_shlibdeps must be run before dh_clideps. dh_makeshlibs and dh_makeclilibs must be run before dh_clideps. If not, when two binary packages from the same source package depend on one another, dh_clideps will not be able to determine the dependencies.

dh_clideps can remove duplicate dependencies created by running dh_clideps and dh_shlibsdeps when run given the -d parameter.

See for details.

dh_installcligac

dh_installcligac is used to facilitate the installation of strong-named assemblies into the various caches installed on the user's machine. Its primary purpose is to install the assemblies at the point of installation instead of pre-packing them inside the Debian package; this is also known as late-GAC install.

To identify which assemblies need to be installed into the GAC, dh_installcligac uses the debian/installcligac or the debian/packagename.installcligac to list the assemblies to install or uninstall at installation or removal respectivly.

The file format of the installcligac is simple: the full installed path of every assembly to install into the GAC. For example, the liblog4net1.2-cil package would have this in the debian/installcligac file: /usr/lib/cli/log4net-1.2/log4net.dll

dh_installcligac needs to be called after dh_install and before dh_clideps. See for details.

Examples debhelper 5/6 Example

For binary-arch packages: binary-arch: build install ... dh_shlibdeps -a dh_makeclilibs -a -V dh_installcligac -a dh_clideps -a ... For binary-indep packages: binary-indep: build install ... dh_makeclilibs -i -V dh_installcligac -i dh_clideps -i ...

debhelper 7 Example

With debhelper's 7 /usr/bin/dh you don't need to add any extra commands to debian/rules yourself as debhelper has an API that allows to extend it. cli-common-dev as of version 0.5.7 can extend debhelper 7 with all commands that are needed. You can enable this by passing "cli" to dh in debian/rules like this: %: dh $@ --with cli That's it, you are done! :-)

cdbs Example

common-binary-predeb-arch common-binary-predeb-indep:: dh_shlibdeps dh_makeclilibs -V dh_installcligac dh_clideps

Executable Wrapper Script Example

#!/bin/sh exec /usr/bin/cli /usr/lib/package/package.exe "$@"

API Compatibility Check Example

You need to install following packages for this example: mono-devel libmono-sharpzip0.6-cil libmono-sharpzip0.84-cil mono-api-check /usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.6.0.0__1b03e6acf1164f73/ICSharpCode.SharpZipLib.dll \ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.84.0.0__1b03e6acf1164f73/ICSharpCode.SharpZipLib.dll CLI API Check Assembly Name: ICSharpCode.SharpZipLib Missing Interfaces: 44 Additional Interfaces: 79 The two assemblies you compared are not API compatible! You must use a new package name! The new assembly has additional interfaces. You must raise the minimal version in clilibs! The mono-api-check wrapper script checks whether there are new public/protected interfaces (where interface in this context means namespace, class, method, interface, delegate, etc) or any missing ones. When an interface is changed it will show up as missing and additional. You should follow the instructions, in this case you must create a new versioned package for the library and raise the minimal version number for the dh_makeclilibs call.

GAC Policy File Example

<configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="foo" publicKeyToken="35e10195dab3c99f" /> <bindingRedirect oldVersion="1.2.0.0-1.2.10.0" newVersion="1.3.0.0"/> </dependentAssembly> </assemblyBinding> </runtime> </configuration> The above example would be used for a policy file for the "foo" assembly and would tell the GAC that version 1.3.0.0 is compatible with versions 1.2.0.0 to 1.2.10.0. You have to compile and install it with al -link:policy.1.2.foo.config -out:policy.1.2.foo.dll -keyfile:path/to/keyfile gacutil /i policy.1.2.foo.dll

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.

Migrating Existing Packages

Many CLI packages already exist in Debian, or are in ITP, and conform to the deprecated .

Any debian/rules hacks or patches that exist to redirect files to /usr/share/dotnet should be removed, and adjusted according to upstream file locations (/usr/lib). See for the rationale behind this change.

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 mono-jit, mono-mint, mono-utils (this one had the dh_* helper scripts which are now in cli-common-dev) and libmono-dev (use this one only if the package really links against mono or requires the mono.pc file).

work/cli.make0000644000000000000000000000031213441477100010331 0ustar #export MONO_SHARED_DIR=$(CURDIR) export MONO_DISABLE_SHM = 1 export DH_OPTIONS += --with=cli $(warning WARNING: the use of /usr/share/cli-common/cli.make is deprecated! Use dh $$@ --with=cli instead.) work/cli.pm0000644000000000000000000000111113441477100010026 0ustar #!/usr/bin/perl # debhelper sequence file for cli-common-dev scripts use warnings; use strict; use Debian::Debhelper::Dh_Lib; insert_after("dh_fixperms", "dh_clifixperms"); # have to use dh_installdeb as those scripts need to run for # binary-arch and binary-indep packages insert_before("dh_installdeb", "dh_clistrip"); insert_before("dh_installdeb", "dh_cligacpolicy"); insert_before("dh_installdeb", "dh_makeclilibs"); insert_before("dh_installdeb", "dh_installcligac"); insert_before("dh_installdeb", "dh_installcliframework"); insert_before("dh_installdeb", "dh_clideps"); 1; work/cli_nant.pm0000644000000000000000000000056613441477100011063 0ustar #!/usr/bin/perl # debhelper sequence file for cli-common-dev scripts use warnings; use strict; use Debian::Debhelper::Dh_Lib; insert_after("dh_auto_build", "dh_auto_build_nant"); insert_after("dh_auto_clean", "dh_auto_clean_nant"); remove_command("dh_auto_configure"); remove_command("dh_auto_build"); remove_command("dh_auto_test"); remove_command("dh_auto_clean"); 1; work/debian/0000755000000000000000000000000013441477100010151 5ustar work/debian/NEWS0000644000000000000000000000127413441477100010654 0ustar 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 work/debian/changelog0000644000000000000000000005130713441477100012031 0ustar cli-common (0.10) unstable; urgency=medium * The Cambridge BSP ‘Let’s RM the world’ release. [ Jo Shields ] * Use ikdasm, not monodis, as disassembler. * Mono 4.4 required for sufficiently featureful ikdasm. * Handle PPDB in dh_clistrip. * Fix "ignores" in overrides (Closes: #891637). * Skip MonoPosixHelper deps. * Handle modulerefs in subdirectories (used in XA, common in NuGets). * Use maintainer address from alioth-lists.debian.net (Closes: #919139). -- Andrej Shadura Mon, 11 Mar 2019 16:26:56 +0100 cli-common (0.9+nmu3) unstable; urgency=medium * Non-maintainer upload. [ Mirco Bauer ] * cli-policy.sgml: --with param to dh preferred over including cli.make [ Niels Thykier ] * dh_makechilibs: Remove only compat code for debhelper compat 3 * dh_*: Optimize out some fork+exec calls * Add NOOP promises so dh can optimize them out [ Daniel Kahn Gillmor ] * use Salsa for Vcs-* and Homepage [ Jeremy Bicha ] * Have cli-common-dev Provide dh-sequence-cli -- Jeremy Bicha Sat, 12 Jan 2019 13:47:28 -0500 cli-common (0.9+nmu2) unstable; urgency=medium * Non-maintainer upload. * Replace references and usage of "dh_clean -k" with "dh_prep". * dh_makeclilibs: Update to support "Rules-Requires-Root: no" (R³). Thanks to Daniel Kahn Gillmor for reporting the issue. (Closes: #910559) * Set "Rules-Requires-Root" (R³) to "no". * d/rules: Remove dh_installcliframework.1 on clean. * d/rules: Add required build-arch and build-indep targets. -- Niels Thykier Sun, 28 Oct 2018 17:08:11 +0000 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 work/debian/cli-common-dev.install0000644000000000000000000000154113441477100014353 0ustar 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/ work/debian/cli-common-dev.manpages0000644000000000000000000000014213441477100014474 0ustar dh_clideps.1 dh_clifixperms.1 dh_cligacpolicy.1 dh_clistrip.1 dh_installcligac.1 dh_makeclilibs.1 work/debian/cli-common.docs0000644000000000000000000000007713441477100013064 0ustar cli-policy.sgml cli-policy.txt cli-policy.pdf cli-policy.html/ work/debian/cli-common.install0000644000000000000000000000065413441477100013603 0ustar 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/ work/debian/compat0000644000000000000000000000000113441477100011346 0ustar 5work/debian/control0000644000000000000000000000421513441477100011556 0ustar Source: cli-common Section: cli-mono Priority: optional Maintainer: Debian Mono Group 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: https://salsa.debian.org/dotnet-team/cli-common Vcs-Git: https://salsa.debian.org/dotnet-team/cli-common.git Vcs-Browser: https://salsa.debian.org/dotnet-team/cli-common 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 (>= 4.4~) | cil-disassembler, mono-devel (>= 4.4~) | strong-name-tool, libxml-dom-perl Provides: dh-sequence-cli 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 work/debian/copyright0000644000000000000000000000047713441477100012114 0ustar 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. work/debian/dirs0000644000000000000000000000014013441477100011030 0ustar usr/share/cli-common/runtimes.d usr/share/cli-common/packages.d usr/share/cli-common/policies.d work/debian/rules0000755000000000000000000000250213441477100011230 0ustar #!/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-arch: build-stamp build-indep: 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 dh_installcliframework.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_prep 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 work/dh_auto_build_nant0000755000000000000000000000150213441477100012475 0ustar #!/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 work/dh_auto_clean_nant0000755000000000000000000000140713441477100012464 0ustar #!/usr/bin/perl -w =head1 NAME dh_auto_clean_nant - automatically cleans up after a nant build =cut use strict; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B [S>] =head1 DESCRIPTION dh_auto_clean_nant is a debhelper program that tries to automatically clean up after a nant build. =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", "clean", @{$dh{U_PARAMS}}); =head1 SEE ALSO L This program is a part of cli-common-dev. =head1 AUTHOR This program is partly based on dh_auto_clean developed by Joey Hess =cut work/dh_clideps0000755000000000000000000006166313441477100010767 0ustar #!/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 ikdasm. 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", "i:MonoPosixHelper" ); # 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/ikdasm"; $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/ikdasm) for CIL parsing."); } elsif (-x "/usr/bin/ikdasm") { $clr = "mono"; $cli_parser = "/usr/bin/ikdasm"; $cli_parser_paths = "MONO_PATH=$mono_path MONO_GAC_PREFIX=$mono_gac_prefix "; verbose_print("Will use Mono (/usr/bin/ikdasm) 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=~/<=/) && ($a=~/<) { 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; } if ($1 eq "ignores") { $newpkgref = ""; } } 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))); } elsif (index($target, '/') != -1) { # not absolute, but in a subdirectory, so process accordingly $library_file = File::Spec->rel2abs(File::Spec->catfile(File::Spec->curdir(), $target)); } 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 work/dh_clifixperms0000755000000000000000000000276613441477100011670 0ustar #!/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 work/dh_cligacpolicy0000755000000000000000000001665413441477100012006 0ustar #!/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_prep" 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; # PROMISE: DH NOOP WITHOUT cligacpolicy 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 install_dir("$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"; print PF $policies{$pk}; 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 This program is a part of cli-common-dev. =head1 AUTHOR Dylan R. E. Moonfire =cut # # # # # # # # # # work/dh_clistrip0000755000000000000000000000401413441477100011160 0ustar #!/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 *.pdb, *.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)|pdb)$/; 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"); install_dir($debug_dir); verbose_print("moving $file to $debug_dir"); doit("mv", $file, $debug_dir); } else { verbose_print("deleting $file"); rm_files($file); } }, $tmp); } =head1 SEE ALSO L This program is part of cli-common-dev. =head1 AUTHOR Mirco Bauer =cut work/dh_installcliframework0000755000000000000000000001127213441477100013407 0ustar #!/usr/bin/perl -w =head1 NAME dh_installcliframework - install development links into framework paths =cut use strict; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B [S>] [B<-n>] =head1 DESCRIPTION dh_installcliframework is a debhelper program that is responsible for installing assemblies and related files used by the Debian cli-common package into the framework paths. This is useful for third-party languages, such as F#, that add an automatic reference a core library in the same way that B adds an automatic reference to B. The format of a C file is line based, treating any line starting with '#' as a comment. The first component of each line specifies the framework version to install to, multiplied by 10 to get an integer. The second component is the full path of the file to install into the framework path. dh_installcliframework only installs links for compile-time assembly resolution; it does B provide any support for runtime assembly resolution, which is the responsibility of the GAC. Any assembly reference installed by dh_installcliframework will also need to be installed into the GAC. See L for how to do this. Note that, unlike the GAC, there is no mechanism for multiple versions of the same assembly to be installed into the framework paths. This means that it is usually incorrect for a package to call both dh_installcligac and dh_installcliframework. If the files installed by dh_installcliframework are provided by binary packages built from the same source package then appropriate dependencies are generated into the C field. 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 EXAMPLE =over 4 # Example debian/pkgfoo.installcliframework file # This is a comment. # Blank lines are ignored: # This assembly is installed into the .NET 4.0 framework path # (usually /usr/lib/mono/4.0/): 40 /usr/lib/cli/pkgfoo/Foo.dll # This assembly is installed into the .NET 3.5 framework path: 35 /usr/lib/cli/pkgfoo/Bar.dll # You can also install ancilliary files, if needed: 40 /usr/lib/cli/pkgfoo/Foo.dll.optdata # It is valid to install the same file for different framework versions: 40 /usr/lib/cli/pkgfoo/Baz.dll 45 /usr/lib/cli/pkgfoo/Baz.dll =back =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_prep" 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(); my @allpackages = getpackages(); # PROMISE: DH NOOP WITHOUT installcliframework foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp = tmpdir($package); my $cliframework = pkgfile($package, "installcliframework"); if ($cliframework ne '') { # sanity check: do all files listed in the installcliframework file exist? open CLIFRAMEWORK, "<$cliframework" or die "E: Can't open $cliframework\n"; my $pkgref; while () { chomp; s/^\s+//; s/\s+$//; next if /^\#/; next if /^\s*$/; # Split on the space my @p = split(/\s+/); # Framework version is first... my $framework = shift @p; # ...then the file to install my $file = shift @p; if (! -f "$tmp$file") { # Search through the other packages for our file foreach my $binary_package (@allpackages) { verbose_print("Checking $binary_package for $file"); if( -f (tmpdir($binary_package) . $file)) { verbose_print("Found framework reference in $binary_package"); $pkgref = $binary_package . " (= \${binary:Version})"; verbose_print("pkgref is $pkgref"); addsubstvar($package, "cli:Depends", $binary_package, "(= \${binary:Version})"); last; } } if (! defined($pkgref)) { die "E: Can't find file $file in any binary package!\n"; } } } close CLIFRAMEWORK; install_dir("$tmp/usr/share/cli-common/packages.d"); install_file($cliframework, "$tmp/usr/share/cli-common/packages.d/$package.installcliframework"); if (! $dh{NOSCRIPTS}) { autoscript($package, "postinst", "postinst-cliframework", { 'PACKAGE' => $package }); autoscript($package, "prerm", "prerm-cliframework", { 'PACKAGE' => $package }); } } } =head1 SEE ALSO L This program is a part of cli-common-dev. =head1 AUTHOR Christopher James Halse Rogers =cut work/dh_installcligac0000755000000000000000000000370713441477100012150 0ustar #!/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_prep" 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(); # PROMISE: DH NOOP WITHOUT installcligac 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; install_dir("$tmp/usr/share/cli-common/packages.d"); install_file($cligac, "$tmp/usr/share/cli-common/packages.d/$package.installcligac"); if (! $dh{NOSCRIPTS}) { autoscript($package, "postinst", "postinst-cligac", { 'PACKAGE' => $package }); autoscript($package, "prerm", "prerm-cligac", { 'PACKAGE' => $package }); } } } =head1 SEE ALSO L This program is a part of cli-common-dev. =head1 AUTHOR Dylan R. E. Moonfire =cut work/dh_makeclilibs0000755000000000000000000002447013441477100011616 0ustar #!/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.5 MONO_CFG_DIR=debian/tmp/etc"; $cli_parser = "$mono_path debian/tmp/usr/bin/ikdasm"; $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/ikdasm) for CIL parsing."); } elsif (-x "/usr/bin/ikdasm") { $clr = "mono"; $cli_parser = "/usr/bin/ikdasm"; verbose_print("Will use Mono (/usr/bin/ikdasm) 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; rm_files("$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; } my $deps = $package; # Call isnative becuase it sets $dh{VERSION} # as a side effect. isnative($package); my $version = $dh{VERSION}; # 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; install_dir("$tmp/DEBIAN"); complex_doit("echo '$line' >> $tmp/DEBIAN/clilibs"); } } } } close FIND; if (-e "$tmp/DEBIAN/clilibs") { reset_perm_and_owner(0644, "$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 work/framework-install0000755000000000000000000000055313441477100012321 0ustar #!/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 work/framework-package-install0000755000000000000000000000450613441477100013714 0ustar #!/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, 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.installcliframework" ) { print STDERR "! $full.installcliframework doesn't exist!\n"; exit 1; } # Parse the file unless (open INPUT, "<$full.installcliframework") { print STDERR "! Cannot open $full.installcliframework ($!)\n"; exit 2; } my @files = (); 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+/); # Framework version is first... my $framework = shift @p; # ...then the file to install my $file = shift @p; if (! -f $file) { print STDERR "! Assembly $file does not exist\n"; exit 3; } push @files, $framework; push @files, $file; } # 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); if (! check_framework_install_supported($clr)) { print STDOUT "* Skipping $formal; no support for framework install\n"; next; } # Install them my $t = (scalar(@files) / 2) . " assemblies"; $t = "1 assembly" if (@files == 2); print STDOUT "* Installing $t from $pkg into $formal framework paths\n"; system($clr, "install-framework", $pkg, @files) == 0 or die "E: Installation of $pkg with $clr failed\n"; } sub check_framework_install_supported { my $clr = shift; open PIPE, "$clr 2>&1 |" or die "E: Cannot query $clr capabilities"; while () { if (/install-framework/) { return 1; } } return 0; } work/framework-package-remove0000755000000000000000000000121313441477100013533 0ustar #!/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 work/framework-remove0000755000000000000000000000060013441477100012141 0ustar #!/bin/bash if [ ! -x /usr/share/cli-common/runtimes.d/$1 ]; then echo ! Cannot remove framework $1 exit 1 fi echo "* Removing packages from $1's framework paths" for file in /usr/share/cli-common/packages.d/*.installcliframework do if [ -f $file ]; then /usr/share/cli-common/framework-package-remove \ $(basename $file .installcliframework) \ $1 fi done work/gac-install0000755000000000000000000000061713441477100011057 0ustar #!/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 work/gac-package-install0000755000000000000000000000554013441477100012450 0ustar #!/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"; } work/gac-package-remove0000755000000000000000000000035113441477100012272 0ustar #!/bin/bash for file in /usr/share/cli-common/runtimes.d/* do if [ -x $file ]; then # Figure out the formal name F="$($file name)" # Remove it echo "Removing $1 from $F" $file remove $1 fi done work/gac-remove0000755000000000000000000000051713441477100010705 0ustar #!/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 work/ildasm-monodis0000755000000000000000000000465113441477100011602 0ustar #!/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; } work/mono.pub0000644000000000000000000000024013441477100010403 0ustar $$RSA1yw:kz.tѯ̓t+,4GM$G~hSoNF^՗.m6p/ MHֱ/F_I.d/^d%F+=QТY_z{ is9~ \@9Owork/policy-install0000755000000000000000000000175213441477100011625 0ustar #!/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 work/policy-remove0000755000000000000000000000055413441477100011453 0ustar #!/bin/sh set -e # This file is actually used to remove entries from a policy. # Variables ASSEMBLY=$1 VERSION=$2 COMBINED="$VERSION.$ASSEMBLY" POLICY="policy.$VERSION.$ASSEMBLY" #echo "Removing GAC policy file ($POLICY) from available GACs" /usr/share/cli-common/gac-package-remove $POLICY > /dev/null rm /usr/share/cli-common/packages.d/$POLICY.installcligac work/postinst-cliframework0000644000000000000000000000023013441477100013213 0ustar if [ "$1" = "configure" ] && [ -x /usr/share/cli-common/framework-package-install ]; then /usr/share/cli-common/framework-package-install #PACKAGE# fi work/postinst-cligac0000644000000000000000000000021413441477100011752 0ustar if [ "$1" = "configure" ] && [ -x /usr/share/cli-common/gac-package-install ]; then /usr/share/cli-common/gac-package-install #PACKAGE# fi work/postinst-cligacpolicy0000644000000000000000000000021513441477100013173 0ustar if [ "$1" = "configure" ] && [ -x /usr/share/cli-common/policy-install ]; then /usr/share/cli-common/policy-install #ASSEMBLY# #VERSION# fi work/postrm-cligacpolicy0000644000000000000000000000024113441477100012633 0ustar if [ "$1" = "remove" ] || [ "$1" = "upgrade" ] && [ -x /usr/share/cli-common/policy-remove ]; then /usr/share/cli-common/policy-remove #ASSEMBLY# #VERSION# fi work/prerm-cliframework0000644000000000000000000000025313441477100012462 0ustar if [ "$1" = "remove" ] || [ "$1" = "upgrade" ] && [ -x /usr/share/cli-common/framework-package-remove ]; then /usr/share/cli-common/framework-package-remove #PACKAGE# fi work/prerm-cligac0000644000000000000000000000023713441477100011221 0ustar if [ "$1" = "remove" ] || [ "$1" = "upgrade" ] && [ -x /usr/share/cli-common/gac-package-remove ]; then /usr/share/cli-common/gac-package-remove #PACKAGE# fi