X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=policy.sgml;h=25a5fe644f09f3cfd7760b8f926bf2ccc0e1daa5;hb=0657d7bbc96bd322cc798968cd2065b6465add0a;hp=e5a5a40470a3f6ee62acc7038c06c440ac083395;hpb=0f73d5645981711c0082b294c1a9334a6eef07e3;p=debian%2Fdebian-policy.git diff --git a/policy.sgml b/policy.sgml index e5a5a40..25a5fe6 100644 --- a/policy.sgml +++ b/policy.sgml @@ -802,6 +802,35 @@ in the .deb file format.

+

+ A .deb package contains two sets of files: a set of files + to install on the system when the package is installed, and a set + of files that provide additional metadata about the package or + which are executed when the package is installed or removed. This + second set of files is called control information files. + Among those files are the package maintainer scripts + and control, the binary + package control file that contains the control fields for + the package. Other control information files + include the shlibs + file used to store shared library dependency information + and the conffiles file that lists the package's + configuration files (described in ). +

+ +

+ There is unfortunately a collision of terminology here between + control information files and files in the Debian control file + format. Throughout this document, a control file refers + to a file in the Debian control file format. These files are + documented in . Only files referred to + specifically as control information files are the files + included in the control information file member of + the .deb file format used by binary packages. Most + control information files are not in the Debian control file + format. +

+ The package name @@ -878,23 +907,40 @@ - + The maintainer of a package

- Every package must have a Debian maintainer (the - maintainer may be one person or a group of people - reachable from a common email address, such as a mailing - list). The maintainer is responsible for ensuring that - the package is placed in the appropriate distributions. -

- -

- The maintainer must be specified in the - Maintainer control field with their correct name - and a working email address. If one person maintains - several packages, they should try to avoid having - different forms of their name and email address in + Every package must have a maintainer, except for orphaned + packages as described below. The maintainer may be one person + or a group of people reachable from a common email address, such + as a mailing list. The maintainer is responsible for + maintaining the Debian packaging files, evaluating and + responding appropriately to reported bugs, uploading new + versions of the package (either directly or through a sponsor), + ensuring that the package is placed in the appropriate archive + area and included in Debian releases as appropriate for the + stability and utility of the package, and requesting removal of + the package from the Debian distribution if it is no longer + useful or maintainable. +

+ +

+ The maintainer must be specified in the Maintainer + control field with their correct name and a working email + address. The email address given in the Maintainer + control field must accept mail from those role accounts in + Debian used to send automated mails regarding the package. This + includes non-spam mail from the bug-tracking system, all mail + from the Debian archive maintenance software, and other role + accounts or automated processes that are commonly agreed on by + the project. + A sample implementation of such a whitelist written for the + Mailman mailing list management software is used for mailing + lists hosted by alioth.debian.org. + + If one person or team maintains several packages, they should + use the same form of their name and email address in the Maintainer fields of those packages.

@@ -904,15 +950,23 @@

- If the maintainer of a package quits from the Debian - project, "Debian QA Group" - packages@qa.debian.org takes over the - maintainer-ship of the package until someone else - volunteers for that task. These packages are called - orphaned packages. - The detailed procedure for doing this gracefully can - be found in the Debian Developer's Reference, - see . + If the maintainer of the package is a team of people with a + shared email address, the Uploaders control field must + be present and must contain at least one human with their + personal email address. See for the + syntax of that field. +

+ +

+ An orphaned package is one with no current maintainer. Orphaned + packages should have their Maintainer control field set + to Debian QA Group <packages@qa.debian.org>. + These packages are considered maintained by the Debian project + as a whole until someone else volunteers to take over + maintenance. + The detailed procedure for gracefully orphaning a package can + be found in the Debian Developer's Reference + (see ).

@@ -921,9 +975,9 @@ The description of a package

- Every Debian package must have an extended description - stored in the appropriate field of the control record. - The technical information about the format of the + Every Debian package must have a Description control + field which contains a synopsis and extended description of the + package. Technical information about the format of the Description field is in .

@@ -1050,10 +1104,10 @@

- Sometimes, a package requires another package to be installed - and configured before it can be installed. In this - case, you must specify a Pre-Depends entry for - the package. + Sometimes, unpacking one package requires that another package + be first unpacked and configured. In this case, the + depending package must specify this dependency in + the Pre-Depends control field.

@@ -1135,7 +1189,7 @@ must be available and usable on the system at all times, even when packages are in an unconfigured (but unpacked) state. Packages are tagged essential for a system using the - Essential control file field. The format of the + Essential control field. The format of the Essential control field is described in .

@@ -1255,17 +1309,16 @@

Packages which use the Debian Configuration Management - Specification may contain an additional - config script and a templates - file in their control archive - The control.tar.gz inside the .deb. - See . - . - The config script might be run before the - preinst script, and before the package is unpacked - or any of its dependencies or pre-dependencies are satisfied. - Therefore it must work using only the tools present in - essential packages. + Specification may contain the additional control information + files config + and templates. config is an + additional maintainer script used for package configuration, + and templates contains templates used for user + prompting. The config script might be run before + the preinst script and before the package is + unpacked or any of its dependencies or pre-dependencies are + satisfied. Therefore it must work using only the tools + present in essential packages. Debconf or another tool that implements the Debian Configuration Management Specification will also be installed, and any @@ -1608,11 +1661,20 @@ The maintainer name and email address used in the changelog should be the details of the person uploading this version. They are not necessarily those of the - usual package maintainer. The information here will be - copied to the Changed-By field in the - .changes file (see ), - and then later used to send an acknowledgement when the - upload has been installed. + usual package maintainer. + If the developer uploading the package is not one of the usual + maintainers of the package (as listed in + the Maintainer + or Uploaders control + fields of the package), the first line of the changelog is + conventionally used to explain why a non-maintainer is + uploading the package. The Debian Developer's Reference + (see ) documents the conventions + used. + The information here will be copied to the Changed-By + field in the .changes file + (see ), and then later used to send an + acknowledgement when the upload has been installed.

@@ -1764,23 +1826,26 @@ identical behavior.

+

+ The following targets are required and must be implemented + by debian/rules: clean, binary, + binary-arch, binary-indep, and build. + These are the targets called by dpkg-buildpackage. +

+

Since an interactive debian/rules script makes it - impossible to auto-compile that package and also makes it - hard for other people to reproduce the same binary - package, all required targets must be - non-interactive. At a minimum, required targets are the - ones called by dpkg-buildpackage, namely, - clean, binary, binary-arch, - binary-indep, and build. It also follows - that any target that these targets depend on must also be + impossible to auto-compile that package and also makes it hard + for other people to reproduce the same binary package, all + required targets must be non-interactive. It also follows that + any target that these targets depend on must also be non-interactive.

- The targets are as follows (required unless stated otherwise): + The targets are as follows: - build + build (required)

The build target should perform all the @@ -1891,8 +1956,8 @@

- binary, binary-arch, - binary-indep + binary (required), binary-arch + (required), binary-indep (required)

@@ -1940,7 +2005,7 @@

- clean + clean (required)

This must undo any effects that the build @@ -2022,14 +2087,21 @@

The architectures we build on and build for are determined - by make variables using the utility - dpkg-architecture. - You can determine the - Debian architecture and the GNU style architecture - specification string for the build machine (the machine type - we are building on) as well as for the host machine (the - machine type we are building for). Here is a list of - supported make variables: + by make variables using the + utility dpkg-architecture. + You can determine the Debian architecture and the GNU style + architecture specification string for the build architecture as + well as for the host architecture. The build architecture is + the architecture on which debian/rules is run and + the package build is performed. The host architecture is the + architecture on which the resulting package will be installed + and run. These are normally the same, but may be different in + the case of cross-compilation (building packages for one + architecture on machines of a different architecture). +

+ +

+ Here is a list of supported make variables: DEB_*_ARCH (the Debian architecture) @@ -2053,8 +2125,8 @@ DEB_*_GNU_TYPE) where * is either BUILD for specification of - the build machine or HOST for specification of the - host machine. + the build architecture or HOST for specification of the + host architecture.

@@ -2190,16 +2262,16 @@ endif Variable substitutions: debian/substvars

- When dpkg-gencontrol, - dpkg-genchanges and dpkg-source - generate control files they perform variable substitutions - on their output just before writing it. Variable + When dpkg-gencontrol + generates binary package control + files (DEBIAN/control), it performs variable + substitutions on its output just before writing it. Variable substitutions have the form ${variable}. The optional file debian/substvars contains variable substitutions to be used; variables can also be set directly from debian/rules using the -V - option to the source packaging commands, and certain - predefined variables are also available. + option to the source packaging commands, and certain predefined + variables are also available.

@@ -2218,12 +2290,12 @@ endif Optional upstream source location: debian/watch

- This is an optional, recommended control file for the - uscan utility which defines how to automatically - scan ftp or http sites for newly available updates of the - package. This is used by and other Debian QA tools - to help with quality control and maintenance of the + This is an optional, recommended configuration file for the + uscan utility which defines how to automatically scan + ftp or http sites for newly available updates of the + package. This is used + by and other Debian QA + tools to help with quality control and maintenance of the distribution as a whole.

@@ -2690,20 +2762,32 @@ Package: libc6 putting the name in round brackets and moving it to the end, and bringing the email address forward).

+ +

+ See for additional requirements and + information about package maintainers. +

Uploaders

- List of the names and email addresses of co-maintainers of - the package, if any. If the package has other maintainers - beside the one named in the - Maintainer field, their names - and email addresses should be listed here. The format of each - entry is the same as that of the Maintainer field, and - multiple entries must be comma separated. This is an optional - field. + List of the names and email addresses of co-maintainers of the + package, if any. If the package has other maintainers besides + the one named in the Maintainer + field, their names and email addresses should be listed + here. The format of each entry is the same as that of the + Maintainer field, and multiple entries must be comma + separated. +

+ +

+ This is normally an optional field, but if + the Maintainer control field names a group of people + and a shared email address, the Uploaders field must + be present and must contain at least one human with their + personal email address.

@@ -3610,12 +3694,11 @@ Checksums-Sha256:

- These scripts are the files preinst, - postinst, prerm and - postrm in the control area of the package. - They must be proper executable files; if they are scripts - (which is recommended), they must start with the usual - #! convention. They should be readable and + These scripts are the control information + files preinst, postinst, prerm + and postrm. They must be proper executable files; + if they are scripts (which is recommended), they must start with + the usual #! convention. They should be readable and executable by anyone, and must not be world-writable.

@@ -3630,12 +3713,12 @@ Checksums-Sha256: they exit with a zero status if everything went well.

-

- Additionally, packages interacting with users using - debconf in the postinst script should - install a config script in the control area, - see for details. -

+

+ Additionally, packages interacting with users + using debconf in the postinst script + should install a config script as a control + information file. See for details. +

When a package is upgraded a combination of the scripts from @@ -3647,7 +3730,7 @@ Checksums-Sha256:

Broadly speaking the preinst is called before - (a particular version of) a package is installed, and the + (a particular version of) a package is unpacked, and the postinst afterwards; the prerm before (a version of) a package is removed and the postrm afterwards. @@ -3731,111 +3814,200 @@ Checksums-Sha256:

- - - new-preinst install - - - new-preinst install old-version - - - new-preinst upgrade old-version - - - old-preinst abort-upgrade - new-version - - + What follows is a summary of all the ways in which maintainer + scripts may be called along with what facilities those scripts + may rely on being available at that time. Script names preceded + by new- are the scripts from the new version of a + package being installed, upgraded to, or downgraded to. Script + names preceded by old- are the scripts from the old + version of a package that is being upgraded from or downgraded + from. +

- - - postinst configure - most-recently-configured-version - - - old-postinst abort-upgrade - new-version - - - conflictor's-postinst abort-remove - in-favour package - new-version - + The preinst script may be called in the following + ways: + + new-preinst install + new-preinst install + old-version + new-preinst upgrade + old-version - postinst abort-remove + The package will not yet be unpacked, so + the preinst script cannot rely on any files + included in its package. Only essential packages and + pre-dependencies (Pre-Depends) may be assumed to be + available. Pre-dependencies will have been configured at + least once, but at the time the preinst is + called they may only be in an unpacked or "Half-Configured" + state if a previous version of the pre-dependency was + completely configured and has not been removed since then. + + old-preinst abort-upgrade + new-version - deconfigured's-postinst - abort-deconfigure in-favour - failed-install-package version - [removing conflicting-package - version] + Called during error handling of an upgrade that failed after + unpacking the new package because the postrm + upgrade action failed. The unpacked files may be + partly from the new version or partly missing, so the script + cannot rely on files included in the package. Package + dependencies may not be available. Pre-dependencies will be + at least unpacked following the same rules as above, except + they may be only "Half-Installed" if an upgrade of the + pre-dependency failed. + This can happen if the new version of the package no + longer pre-depends on a package that had been partially + upgraded. + - + +

- - - prerm remove - - - old-prerm upgrade - new-version - - - new-prerm failed-upgrade - old-version - + The postinst script may be called in the following + ways: + + postinst configure + most-recently-configured-version - conflictor's-prerm remove - in-favour package - new-version + The files contained in the package will be unpacked. All + package dependencies will at least be unpacked. If there + are no circular dependencies involved, all package + dependencies will be configured. For behavior in the case + of circular dependencies, see the discussion + in . + + old-postinst abort-upgrade + new-version + conflictor's-postinst abort-remove + in-favour package + new-version + postinst abort-remove + deconfigured's-postinst + abort-deconfigure in-favour + failed-install-package version + [removing conflicting-package + version] - deconfigured's-prerm deconfigure - in-favour package-being-installed - version [removing - conflicting-package - version] + The files contained in the package will be unpacked. All + package dependencies will at least be "Half-Installed" and + will have previously been configured and not removed. + However, dependencies may not be configured or even fully + unpacked in some error situations. + For example, suppose packages foo and bar are installed + with foo depending on bar. If an upgrade of bar were + started and then aborted, and then an attempt to remove + foo failed because its prerm script failed, + foo's postinst abort-remove would be called with + bar only "Half-Installed". + + The postinst should still attempt any actions + for which its dependencies are required, since they will + normally be available, but consider the correct error + handling approach if those actions fail. Aborting + the postinst action if commands or facilities + from the package dependencies are not available is often the + best approach. - + +

- - - postrm remove - - - postrm purge - - - old-postrm upgrade - new-version - + The prerm script may be called in the following + ways: + + prerm remove + old-prerm + upgradenew-version + conflictor's-prerm remove + in-favour package + new-version + deconfigured's-prerm deconfigure + in-favour package-being-installed + version [removing + conflicting-package version] - new-postrm failed-upgrade - old-version + The package whose prerm is being called will be + at least "Half-Installed". All package dependencies will at + least be "Half-Installed" and will have previously been + configured and not removed. If there was no error, all + dependencies will at least be unpacked, but these actions + may be called in various error states where dependencies are + only "Half-Installed" due to a partial upgrade. + + new-prerm failed-upgrade + old-version - new-postrm abort-install + Called during error handling when prerm upgrade + fails. The new package will not yet be unpacked, and all + the same constraints as for preinst upgrade apply. + +

+ +

+ The postrm script may be called in the following + ways: + + postrm remove + postrm purge + old-postrm upgrade + new-version + disappearer's-postrm disappear + overwriter overwriter-version - new-postrm abort-install - old-version + The postrm script is called after the package's + files have been removed or replaced. The package + whose postrm is being called may have + previously been deconfigured and only be unpacked, at which + point subsequent package changes do not consider its + dependencies. Therefore, all postrm actions + may only rely on essential packages and must gracefully skip + any actions that require the package's dependencies if those + dependencies are unavailable. + This is often done by checking whether the command or + facility the postrm intends to call is + available before calling it. For example: + +if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule + db_purge +fi + + in postrm purges the debconf + configuration for the package + if debconf is installed. + + + new-postrm failed-upgrade + old-version - new-postrm abort-upgrade - old-version + Called when the old postrm upgrade action fails. + The new package will be unpacked, but only essential + packages and pre-dependencies can be relied on. + Pre-dependencies will either be configured or will be + "Unpacked" or "Half-Configured" but previously had been + configured and was never removed. + + new-postrm abort-install + new-postrm abort-install + old-version + new-postrm abort-upgrade + old-version - disappearer's-postrm disappear - overwriter - overwriter-version + Called before unpacking the new package as part of the + error handling of preinst failures. May assume + the same state as preinst can assume. - +

- +
Details of unpack phase of installation or upgrade @@ -4037,7 +4209,7 @@ Checksums-Sha256: behavior which, though deterministic, is hard for the system administrator to understand. It can easily lead to "missing" programs if, for example, a package - is installed which overwrites a file from another + is unpacked which overwrites a file from another package, and is then removed again. Part of the problem is due to what is arguably a bug in dpkg. @@ -4173,7 +4345,7 @@ Checksums-Sha256: If there was a conflicting package we go and do the removal actions (described below), starting with the removal of the conflicting package's files (any that - are also in the package being installed have already + are also in the package being unpacked have already been removed from the conflicting package's file list, and so do not get removed now). @@ -4311,7 +4483,7 @@ Checksums-Sha256: In the Depends, Recommends, Suggests, Pre-Depends, Build-Depends and Build-Depends-Indep - control file fields of the package, which declare + control fields of the package, which declare dependencies on other packages, the package names listed may also include lists of alternative package names, separated by vertical bar (pipe) symbols |. In such a case, @@ -4475,7 +4647,7 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any]

This is done using the Depends, Pre-Depends, Recommends, Suggests, Enhances, - Breaks and Conflicts control file fields. + Breaks and Conflicts control fields. Breaks is described in , and Conflicts is described in . The rest are described below. @@ -4513,31 +4685,40 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any]

- For this reason packages in an installation run are usually - all unpacked first and all configured later; this gives - later versions of packages with dependencies on later - versions of other packages the opportunity to have their - dependencies satisfied. + Since Depends only places requirements on the order in + which packages are configured, packages in an installation run + are usually all unpacked first and all configured later. + + This approach makes dependency resolution easier. If two + packages A and B are being upgraded, the installed package A + depends on exactly the installed package B, and the new + package A depends on exactly the new package B (a common + situation when upgrading shared libraries and their + corresponding development packages), satisfying the + dependencies at every stage of the upgrade would be + impossible. This relaxed restriction means that both new + packages can be unpacked together and then configured in their + dependency order. +

-

- In case of circular dependencies, since installation or - removal order honoring the dependency order can't be - established, dependency loops are broken at some point - (based on rules below), and some packages may not be able to - rely on their dependencies being present when being - installed or removed, depending on which side of the break - of the circular dependency loop they happen to be on. If one - of the packages in the loop has no postinst script, then the - cycle will be broken at that package, so as to ensure that - all postinst scripts run with the dependencies properly - configured if this is possible. Otherwise the breaking point - is arbitrary. -

-

- The Depends field thus allows package maintainers - to impose an order in which packages should be configured. + If there is a circular dependency among packages being installed + or removed, installation or removal order honoring the + dependency order is impossible, requiring the dependency loop be + broken at some point and the dependency requirements violated + for at least one package. Packages involved in circular + dependencies may not be able to rely on their dependencies being + configured before they themselves are configured, depending on + which side of the break of the circular dependency loop they + happen to be on. If one of the packages in the loop has + no postinst script, then the cycle will be broken + at that package; this ensures that all postinst + scripts are run with their dependencies properly configured if + this is possible. Otherwise the breaking point is arbitrary. + Packages should therefore avoid circular dependencies where + possible, particularly if they have postinst + scripts.

@@ -4549,7 +4730,8 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any] This declares an absolute dependency. A package will not be configured unless all of the packages listed in its Depends field have been correctly - configured. + configured (unless there is a circular dependency as + described above).

@@ -4561,12 +4743,31 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any]

The Depends field should also be used if the - postinst, prerm or - postrm scripts require the package to be - present in order to run. Note, however, that the - postrm cannot rely on any non-essential - packages to be present during the purge - phase. + postinst or prerm scripts + require the depended-on package to be unpacked or + configured in order to run. In the case of postinst + configure, the depended-on packages will be unpacked + and configured first. (If both packages are involved in a + dependency loop, this might not work as expected; see the + explanation a few paragraphs back.) In the case + of prerm or other postinst + actions, the package dependencies will normally be at + least unpacked, but they may be only "Half-Installed" if a + previous upgrade of the dependency failed. +

+ +

+ Finally, the Depends field should be used if the + depended-on package is needed by the postrm + script to fully clean up after the package removal. There + is no guarantee that package dependencies will be + available when postrm is run, but the + depended-on package is more likely to be available if the + package declares a dependency (particularly in the case + of postrm remove). The postrm + script must gracefully skip actions that require a + dependency if that dependency isn't available. +

Recommends @@ -4625,11 +4826,21 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any]

- When the package declaring a pre-dependency is about - to be configured, the pre-dependency will be - treated as a normal Depends, that is, it will - be considered satisfied only if the depended-on - package has been correctly configured. + When the package declaring a pre-dependency is about to + be configured, the pre-dependency will be treated + as a normal Depends. It will be considered + satisfied only if the depended-on package has been + correctly configured. However, unlike + with Depends, Pre-Depends does not + permit circular dependencies to be broken. If a circular + dependency is encountered while attempting to honor + Pre-Depends, the installation will be aborted. +

+ +

+ Pre-Depends are also required if the + preinst script depends on the named package. + It is best to avoid this situation if possible.

@@ -4638,13 +4849,6 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any] installation would hamper the ability of the system to continue with any upgrade that might be in progress.

- -

- Pre-Depends are also required if the - preinst script depends on the named - package. It is best to avoid this situation if - possible. -

@@ -4669,7 +4873,7 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any]

When one binary package declares that it breaks another, dpkg will refuse to allow the package which - declares Breaks be installed unless the broken + declares Breaks to be unpacked unless the broken package is deconfigured first, and it will refuse to allow the broken package to be reconfigured.

@@ -4720,18 +4924,18 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any] Conflicting binary packages - Conflicts

- When one binary package declares a conflict with another - using a Conflicts field, dpkg will - refuse to allow them to be installed on the system at the - same time. This is a stronger restriction than Breaks, - which just prevents both packages from being configured at the - same time. Conflicting packages cannot be unpacked on the - system at the same time. + When one binary package declares a conflict with another using + a Conflicts field, dpkg will refuse to + allow them to be unpacked on the system at the same time. This + is a stronger restriction than Breaks, which prevents + the broken package from being configured while the breaking + package is in the "Unpacked" state but allows both packages to + be unpacked at the same time.

- If one package is to be installed, the other must be removed - first. If the package being installed is marked as replacing + If one package is to be unpacked, the other must be removed + first. If the package being unpacked is marked as replacing (see , but note that Breaks should normally be used in this case) the one on the system, or the one on the system is marked as deselected, or both packages are @@ -4780,7 +4984,7 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any] when two packages provide the same file and will continue to do so, in conjunction with Provides when only one - package providing a given virtual facility may be installed + package providing a given virtual facility may be unpacked at a time (see ), in other cases where one must prevent simultaneous installation of two packages for reasons that are ongoing @@ -4833,11 +5037,10 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any]

A virtual package is one which appears in the - Provides control file field of another package. - The effect is as if the package(s) which provide a - particular virtual package name had been listed by name - everywhere the virtual package name appears. (See also ) + Provides control field of another package. The effect + is as if the package(s) which provide a particular virtual + package name had been listed by name everywhere the virtual + package name appears. (See also )

@@ -4905,9 +5108,9 @@ Provides: bar

Packages can declare in their control file that they should - overwrite files in certain other packages, or completely - replace other packages. The Replaces control file - field has these two distinct purposes. + overwrite files in certain other packages, or completely replace + other packages. The Replaces control field has these + two distinct purposes.

Overwriting files in other packages @@ -5013,7 +5216,7 @@ Provides: mail-transport-agent Conflicts: mail-transport-agent Replaces: mail-transport-agent - ensuring that only one MTA can be installed at any one + ensuring that only one MTA can be unpacked at any one time. See for more information about this example. @@ -5034,7 +5237,7 @@ Replaces: mail-transport-agent

This is done using the Build-Depends, Build-Depends-Indep, Build-Conflicts and - Build-Conflicts-Indep control file fields. + Build-Conflicts-Indep control fields.

@@ -5098,55 +5301,134 @@ Replaces: mail-transport-agent

- Packages involving shared libraries should be split up into - several binary packages. This section mostly deals with how - this separation is to be accomplished; rules for files within - the shared library packages are in instead. + This section deals only with public shared libraries: shared + libraries that are placed in directories searched by the dynamic + linker by default or which are intended to be linked against + normally and possibly used by other, independent packages. Shared + libraries that are internal to a particular package or that are + only loaded as dynamic modules are not covered by this section and + are not subject to its requirements.

- - Run-time shared libraries +

+ A shared library is identified by the SONAME attribute + stored in its dynamic section. When a binary is linked against a + shared library, the SONAME of the shared library is + recorded in the binary's NEEDED section so that the + dynamic linker knows that library must be loaded at runtime. The + shared library file's full name (which usually contains additional + version information not needed in the SONAME) is + therefore normally not referenced directly. Instead, the shared + library is loaded by its SONAME, which exists on the file + system as a symlink pointing to the full name of the shared + library. This symlink must be provided by the + package. describes how to do this. + + This is a convention of shared library versioning, but not a + requirement. Some libraries use the SONAME as the full + library file name instead and therefore do not need a symlink. + Most, however, encode additional information about + backwards-compatible revisions as a minor version number in the + file name. The SONAME itself only changes when + binaries linked with the earlier version of the shared library + may no longer work, but the filename may change with each + release of the library. See for + more information. + +

- The run-time shared library needs to be placed in a package - whose name changes whenever the shared object version - changes. -

- Since it is common place to install several versions of a - package that just provides shared libraries, it is a - good idea that the library package should not - contain any extraneous non-versioned files, unless they - happen to be in versioned directories.

-
- The most common mechanism is to place it in a package - called - librarynamesoversion, - where soversion is the version number - in the soname of the shared library - The soname is the shared object name: it's the thing - that has to match exactly between building an executable - and running it for the dynamic linker to be able run the - program. For example, if the soname of the library is - libfoo.so.6, the library package would be - called libfoo6. - . - Alternatively, if it would be confusing to directly append - soversion to libraryname (e.g. because - libraryname itself ends in a number), you may use - libraryname-soversion and - libraryname-soversion-dev - instead. + When linking a binary or another shared library against a shared + library, the SONAME for that shared library is not yet + known. Instead, the shared library is found by looking for a file + matching the library name with .so appended. This file + exists on the file system as a symlink pointing to the shared + library. +

+ +

+ Shared libraries are normally split into several binary packages. + The SONAME symlink is installed by the runtime shared + library package, and the bare .so symlink is installed in + the development package since it's only used when linking binaries + or shared libraries. However, there are some exceptions for + unusual shared libraries or for shared libraries that are also + loaded as dynamic modules by other programs.

- If you have several shared libraries built from the same - source tree you may lump them all together into a single - shared library package, provided that you change all of - their sonames at once (so that you don't get filename - clashes if you try to install different versions of the - combined shared libraries package). + This section is primarily concerned with how the separation of + shared libraries into multiple packages should be done and how + dependencies on and between shared library binary packages are + managed in Debian. should be read in + conjunction with this section and contains additional rules for + the files contained in the shared library packages.

+ + Run-time shared libraries + +

+ The run-time shared library must be placed in a package + whose name changes whenever the SONAME of the shared + library changes. This allows several versions of the shared + library to be installed at the same time, allowing installation + of the new version of the shared library without immediately + breaking binaries that depend on the old version. Normally, the + run-time shared library and its SONAME symlink should + be placed in a package named + librarynamesoversion, + where soversion is the version number in + the SONAME of the shared library. + See for detailed information on how to + determine this version. Alternatively, if it would be confusing + to directly append soversion + to libraryname (if, for example, libraryname + itself ends in a number), you should use + libraryname-soversion + instead. +

+ +

+ If you have several shared libraries built from the same source + tree, you may lump them all together into a single shared + library package provided that all of their SONAMEs will + always change together. Be aware that this is not normally the + case, and if the SONAMEs do not change together, + upgrading such a merged shared library package will be + unnecessarily difficult because of file conflicts with the old + version of the package. When in doubt, always split shared + library packages so that each binary package installs a single + shared library. +

+ +

+ Every time the shared library ABI changes in a way that may + break binaries linked against older versions of the shared + library, the SONAME of the library and the + corresponding name for the binary package containing the runtime + shared library should change. Normally, this means + the SONAME should change any time an interface is + removed from the shared library or the signature of an interface + (the number of parameters or the types of parameters that it + takes, for example) is changed. This practice is vital to + allowing clean upgrades from older versions of the package and + clean transitions between the old ABI and new ABI without having + to upgrade every affected package simultaneously. +

+ +

+ The SONAME and binary package name need not, and indeed + normally should not, change if new interfaces are added but none + are removed or changed, since this will not break binaries + linked against the old shared library. Correct versioning of + dependencies on the newer shared library by binaries that use + the new interfaces is handled via + the shlibs + system or via symbols files (see + ). +

+

The package should install the shared libraries under their normal names. For example, the libgdbm3 @@ -5166,10 +5448,11 @@ Replaces: mail-transport-agent

- The run-time library package should include the symbolic link that - ldconfig would create for the shared libraries. - For example, the libgdbm3 package should include - a symbolic link from /usr/lib/libgdbm.so.3 to + The run-time library package should include the symbolic link for + the SONAME that ldconfig would create for + the shared libraries. For example, + the libgdbm3 package should include a symbolic + link from /usr/lib/libgdbm.so.3 to libgdbm.so.3.0.0. This is needed so that the dynamic linker (for example ld.so or ld-linux.so.*) can find the library between the @@ -5232,7 +5515,7 @@ Replaces: mail-transport-agent

During install or upgrade, the preinst is called before - the new files are installed, so calling "ldconfig" is + the new files are unpacked, so calling "ldconfig" is pointless. The preinst of an existing package can also be called if an upgrade fails. However, this happens during the critical time when a shared libs may exist on-disk @@ -5377,7 +5660,7 @@ Replaces: mail-transport-agent ) to ensure that the user only installs one development version at a time (as different development versions are likely to have the same header files in them, which would cause a - filename clash if both were installed). + filename clash if both were unpacked).

@@ -5389,6 +5672,14 @@ Replaces: mail-transport-agent (ld) when compiling packages, as it will only look for libgdbm.so when compiling dynamically.

+ +

+ If the package provides Ada Library Information + (*.ali) files for use with GNAT, these files must be + installed read-only (mode 0444) so that GNAT will not attempt to + recompile them. This overrides the normal file mode requirements + given in . +

@@ -5525,10 +5816,10 @@ Replaces: mail-transport-agent

When packages are being built, any debian/shlibs files are copied into the - control file area of the temporary build directory and - given the name shlibs. These files give - details of any shared libraries included in the same - package. + control information file area of the temporary build + directory and given the name shlibs. These + files give details of any shared libraries included in the + same package. An example may help here. Let us say that the source package foo generates two binary packages, libfoo2 and foo-runtime. @@ -5729,7 +6020,8 @@ udeb: libz 1 zlib1g-udeb (>= 1:1.1.3) It is usual to call this file debian/shlibs (but if you have multiple binary packages, you might want to call it debian/shlibs.package instead). Then - let debian/rules install it in the control area: + let debian/rules install it in the control + information file area: install -m644 debian/shlibs debian/tmp/DEBIAN @@ -5738,9 +6030,9 @@ install -m644 debian/shlibs debian/tmp/DEBIAN install -m644 debian/shlibs.package debian/package/DEBIAN/shlibs An alternative way of doing this is to create the - shlibs file in the control area directly from - debian/rules without using a debian/shlibs - file at all, + shlibs file in the control information file area + directly from debian/rules without using + a debian/shlibs file at all, This is what dh_makeshlibs in the debhelper suite does. If your package also has a udeb that provides a shared @@ -7454,7 +7746,19 @@ fname () { must be supported and must set the value of c to delta. - + + The XSI extension to kill allowing kill + -signal, where signal is either + the name of a signal or one of the numeric signals listed in + the XSI extension (0, 1, 2, 3, 6, 9, 14, and 15), must be + supported if kill is implemented as a shell + built-in. + + The XSI extension to trap allowing numeric + signals must be supported. In addition to the signal + numbers listed in the extension, which are the same as for + kill above, 13 (SIGPIPE) must be allowed. + If a shell script requires non-SUSv3 features from the shell interpreter other than those listed above, the appropriate shell @@ -7895,11 +8199,13 @@ ln -fs ../sbin/sendmail debian/tmp/usr/bin/runq

- Log files must be rotated occasionally so that they don't - grow indefinitely; the best way to do this is to drop a log - rotation configuration file into the directory - /etc/logrotate.d and use the facilities provided by - logrotate. + Log files must be rotated occasionally so that they don't grow + indefinitely. The best way to do this is to install a log + rotation configuration file in the + directory /etc/logrotate.d, normally + named /etc/logrotate.d/package, and use + the facilities provided by logrotate. +

The traditional approach to log files has been to set up ad hoc log rotation schemes using simple shell @@ -7924,17 +8230,20 @@ ln -fs ../sbin/sendmail debian/tmp/usr/bin/runq section="8">): /var/log/foo/*.log { -rotate 12 -weekly -compress -postrotate -/etc/init.d/foo force-reload -endscript + rotate 12 + weekly + compress + missingok + postrotate + start-stop-daemon -K -p /var/run/foo.pid -s HUP -x /usr/sbin/foo -q + endscript } This rotates all files under /var/log/foo, saves 12 - compressed generations, and forces the daemon to reload its - configuration information after the log rotation. + compressed generations, and tells the daemon to reopen its log + files after the log rotation. It skips this log rotation + (via missingok) if no such log file is present, which + avoids errors if the package is removed but not purged.

@@ -7946,7 +8255,7 @@ endscript

- + Permissions and owners

@@ -7987,6 +8296,12 @@ endscript

+

+ Control information files should be owned by root:root + and either mode 644 (for most files) or mode 755 (for + executables such as maintainer + scripts). +

Setuid and setgid executables should be mode 4755 or 2755 @@ -8491,8 +8806,7 @@ http://localhost/doc/package/filename this so programs should not fail if newaliases cannot be found. Note that because of this, all MTA packages must have Provides, Conflicts and - Replaces: mail-transport-agent control file - fields. + Replaces: mail-transport-agent control fields.

@@ -8601,8 +8915,9 @@ name ["syshostname"]:

Packages that provide an X server that, directly or indirectly, communicates with real input and display - hardware should declare in their control data that they - provide the virtual package xserver. + hardware should declare in their Provides control + field that they provide the virtual + package xserver. This implements current practice, and provides an actual policy for usage of the xserver virtual package which appears in the virtual packages @@ -8620,10 +8935,10 @@ name ["syshostname"]:

Packages that provide a terminal emulator for the X Window - System which meet the criteria listed below should declare - in their control data that they provide the virtual - package x-terminal-emulator. They should also - register themselves as an alternative for + System which meet the criteria listed below should declare in + their Provides control field that they provide the + virtual package x-terminal-emulator. They should + also register themselves as an alternative for /usr/bin/x-terminal-emulator, with a priority of 20. That alternative should have a slave alternative for /usr/share/man/man1/x-terminal-emulator.1.gz @@ -8668,9 +8983,9 @@ name ["syshostname"]:

Packages that provide a window manager should declare in - their control data that they provide the virtual package - x-window-manager. They should also register - themselves as an alternative for + their Provides control field that they provide the + virtual package x-window-manager. They should also + register themselves as an alternative for /usr/bin/x-window-manager, with a priority calculated as follows: @@ -8846,8 +9161,8 @@ name ["syshostname"]: Font packages must declare a dependency on - xfonts-utils in their control - data. + xfonts-utils in their Depends + or Pre-Depends control field. @@ -9667,7 +9982,7 @@ END-INFO-DIR-ENTRY

The DEBIAN directory will not appear in the file system archive of the package, and so won't be installed - by dpkg when the package is installed. + by dpkg when the package is unpacked.

@@ -9715,13 +10030,13 @@ END-INFO-DIR-ENTRY

It is possible to put other files in the package control - area, but this is not generally a good idea (though they - will largely be ignored). + information file area, but this is not generally a good idea + (though they will largely be ignored).

- Here is a brief list of the control info files supported by - dpkg and a summary of what they're used for. + Here is a brief list of the control information files supported + by dpkg and a summary of what they're used for.

@@ -10592,7 +10907,7 @@ END-INFO-DIR-ENTRY Package_Revision The Debian revision part of the package version was - at one point in a separate control file field. This + at one point in a separate control field. This field went through several names. @@ -10649,7 +10964,7 @@ END-INFO-DIR-ENTRY

- A package may contain a control area file called + A package may contain a control information file called conffiles. This file should be a list of filenames of configuration files needing automatic handling, separated by newlines. The filenames should be absolute pathnames,