X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=policy.sgml;h=f0e3f8d320dcf52b960b0dd71e8101681e364be5;hb=0b42bb3a5a763f110f2e7f2b8670eaef61944a57;hp=1e9934cd29e49b489cccca7584f84719c1637f09;hpb=3bb4976623bbf548b6b31f84495355abaeffc81e;p=debian%2Fdebian-policy.git diff --git a/policy.sgml b/policy.sgml index 1e9934c..3c63507 100644 --- a/policy.sgml +++ b/policy.sgml @@ -2,6 +2,8 @@ %versiondata; + + ]> @@ -800,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 @@ -847,36 +878,30 @@

In general, Debian packages should use the same version - numbers as the upstream sources. -

- -

- However, in some cases where the upstream version number is - based on a date (e.g., a development "snapshot" release) the - package management system cannot handle these version - numbers without epochs. For example, dpkg will consider - "96May01" to be greater than "96Dec24". + numbers as the upstream sources. However, upstream version + numbers based on some date formats (sometimes used for + development or "snapshot" releases) will not be ordered + correctly by the package management software. For + example, dpkg will consider "96May01" to be + greater than "96Dec24".

To prevent having to use epochs for every new upstream - version, the date based portion of the version number - should be changed to the following format in such cases: - "19960501", "19961224". It is up to the maintainer whether - they want to bother the upstream maintainer to change - the version numbers upstream, too. + version, the date-based portion of any upstream version number + should be given in a way that sorts correctly: four-digit year + first, followed by a two-digit numeric month, followed by a + two-digit numeric date, possibly with punctuation between the + components.

- Note that other version formats based on dates which are - parsed correctly by the package management system should - not be changed. -

- -

- Native Debian packages (i.e., packages which have been - written especially for Debian) whose version numbers include - dates should always use the "YYYYMMDD" format. + Native Debian packages (i.e., packages which have been written + especially for Debian) whose version numbers include dates + should also follow these rules. If punctuation is desired + between the date components, remember that hyphen (-) + cannot be used in native package versions. Period + (.) is normally a good choice.

@@ -925,9 +950,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 .

@@ -1054,10 +1079,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 + dependent package must specify this dependency in + the Pre-Depends control field.

@@ -1139,7 +1164,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 .

@@ -1210,9 +1235,11 @@

- You should not use dpkg-divert on a file - belonging to another package without consulting the - maintainer of that package first. + You should not use dpkg-divert on a file belonging + to another package without consulting the maintainer of that + package first. When adding or removing diversions, package + maintainer scripts must provide the --package flag + to dpkg-divert and must not use --local.

@@ -1257,17 +1284,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 @@ -1610,19 +1636,55 @@ 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. -

- -

- The date must be in RFC822 format - This is generated by date -R. - ; it must include the time zone specified - numerically, with the time zone name or abbreviation - optionally present as a comment in parentheses. + 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. +

+ +

+ The date has the following format + This is the same as the format generated by date + -R. + (compatible and with the same semantics of + RFC 2822 and RFC 5322): + day-of-week, dd month yyyy hh:mm:ss +zzzz + where: + + + day-of week is one of: Mon, Tue, Wed, Thu, Fri, Sat, Sun + + + dd is a one- or two-digit day of the month (01-31) + + + month is one of: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, + Sep, Oct, Nov, Dec + + yyyy is the four-digit year (e.g. 2010) + hh is the two-digit hour (00-23) + mm is the two-digit minutes (00-59) + ss is the two-digit seconds (00-60) + + +zzzz or -zzzz is the the time zone offset from Coordinated + Universal Time (UTC). "+" indicates that the time is ahead + of (i.e., east of) UTC and "-" indicates that the time is + behind (i.e., west of) UTC. The first two digits indicate + the hour difference from UTC and the last two digits + indicate the number of additional minutes difference from + UTC. The last two digits must be in the range 00-59. + +

@@ -1761,7 +1823,7 @@ The build target should perform all the configuration and compilation of the package. If a package has an interactive pre-build - configuration routine, the Debianized source package + configuration routine, the Debian source package must either be built after this has taken place (so that the binary package can be built without rerunning the configuration) or the configuration routine @@ -1827,21 +1889,28 @@ A package may also provide both of the targets build-arch and build-indep. The build-arch target, if provided, should - perform all the configuration and compilation required - for producing all architecture-dependant binary packages + perform all the configuration and compilation required for + producing all architecture-dependant binary packages (those packages for which the body of the - Architecture field in debian/control - is not all). - Similarly, the build-indep target, if - provided, should perform all the configuration and - compilation required for producing all - architecture-independent binary packages - (those packages for which the body of the - Architecture field in debian/control - is all). + Architecture field in debian/control is + not all). Similarly, the build-indep + target, if provided, should perform all the configuration + and compilation required for producing all + architecture-independent binary packages (those packages + for which the body of the Architecture field + in debian/control is all). The build target should depend on those of the targets build-arch and build-indep that - are provided in the rules file. + are provided in the rules file. + The intent of this split is so that binary-only builds + need not install the dependencies required for + the build-indep target. However, this is not + yet used in practice since dpkg-buildpackage + -B, and therefore the autobuilders, + invoke build rather than build-arch + due to the difficulties in determining whether the + optional build-arch target exists. +

@@ -2158,16 +2227,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.

@@ -2186,12 +2255,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.

@@ -2370,6 +2439,11 @@ Package: libc6 libc6.

+

+ A paragraph must not contain more than one instance of a + particular field name. +

+

Many fields' values may span several lines; in this case each continuation line must start with a space or a tab. @@ -2454,13 +2528,11 @@ Package: libc6 The syntax and semantics of the fields are described below.

- -

These fields are used by dpkg-gencontrol to generate control files for binary packages (see below), by dpkg-genchanges to generate the - .changes file to accompany the upload, and by + .changes file to accompany the upload, and by dpkg-source when it creates the .dsc source control file as part of a source archive. Many fields are permitted to span multiple lines in @@ -2494,7 +2566,8 @@ Package: libc6

The DEBIAN/control file contains the most vital - (and version-dependent) information about a binary package. + (and version-dependent) information about a binary package. It + consists of a single paragraph.

@@ -2521,23 +2594,24 @@ Package: libc6 Debian source control files -- .dsc

- This file contains a series of fields, identified and - separated just like the fields in the control file of - a binary package. The fields are listed below; their - syntax is described above, in . + This file consists of a single paragraph, possibly surrounded by + a PGP signature. The fields of that paragraph are listed below. + Their syntax is described above, in . Format (mandatory) Source (mandatory) + Binary + Architecture Version (mandatory) Maintainer (mandatory) Uploaders - Binary - Architecture - Build-Depends et al + Homepage Standards-Version (recommended) + Build-Depends et al + Checksums-Sha1 + and Checksums-Sha256 (recommended) Files (mandatory) - Homepage

@@ -2556,12 +2630,19 @@ Package: libc6 Debian changes files -- .changes

- The .changes files are used by the Debian archive maintenance - software to process updates to packages. They contain one - paragraph which contains information from the - debian/control file and other data about the - source package gathered via debian/changelog - and debian/rules. + The .changes files are used by the Debian archive + maintenance software to process updates to packages. They + consist of a single paragraph, possibly surrounded by a PGP + signature. That paragraph contains information from the + debian/control file and other data about the + source package gathered via debian/changelog + and debian/rules. +

+ +

+ .changes files have a format version that is + incremented whenever the documented fields or their meaning + change. This document describes format &changesversion;.

@@ -2581,6 +2662,8 @@ Package: libc6 Description (mandatory) Closes Changes (mandatory) + Checksums-Sha1 + and Checksums-Sha256 (recommended) Files (mandatory)

@@ -2631,8 +2714,8 @@ Package: libc6

The package maintainer's name and email address. The name - should come first, then the email address inside angle - brackets <> (in RFC822 format). + must come first, then the email address inside angle + brackets <> (in RFC822 format).

@@ -2649,17 +2732,17 @@ Package: libc6 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 is the same as that of the Maintainer tag, and - multiple entries should be comma separated. Currently, - this field is restricted to a single line of data. 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 + 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. +

+

Any parser that interprets the Uploaders field in debian/control must permit it to span multiple @@ -2673,9 +2756,10 @@ Package: libc6 Changed-By

- The name and email address of the person who changed the - said package. Usually the name of the maintainer. - All the rules for the Maintainer field apply here, too. + The name and email address of the person who prepared this + version of the package, usually a maintainer. The syntax is + the same as for the Maintainer + field.

@@ -2735,41 +2819,64 @@ Package: libc6 Architecture field can include the following sets of values: - A unique single word identifying a Debian machine - architecture as described in . - all, which indicates an - architecture-independent package. - any, which indicates a package available - for building on any architecture. - source, which indicates a source package. + + A unique single word identifying a Debian machine + architecture as described in . + + + An architecture wildcard identifying a set of Debian + machine architectures, see . + any matches all Debian machine architectures + and is the most frequently used. + + + all, which indicates an + architecture-independent package. + + + source, which indicates a source package. +

In the main debian/control file in the source - package, this field may contain the special value - any, the special value all, or a list of - architectures separated by spaces. If any or - all appear, they must be the entire contents of the - field. Most packages will use either any or - all. Specifying a specific list of architectures is - for the minority of cases where a program is not portable or - is not useful on some architectures, and where possible the - program should be made portable instead. + package, this field may contain the special + value all, the special architecture + wildcard any, or a list of specific and wildcard + architectures separated by spaces. If all + or any appears, that value must be the entire + contents of the field. Most packages will use + either all or any. +

+ +

+ Specifying a specific list of architectures indicates that the + source will build an architecture-dependent package only on + architectures included in the list. Specifying a list of + architecture wildcards indicates that the source will build an + architecture-dependent package on only those architectures + that match any of the specified architecture wildcards. + Specifying a list of architectures or architecture wildcards + other than any is for the minority of cases where a + program is not portable or is not useful on some + architectures. Where possible, the program should be made + portable instead.

In the source package control file .dsc, this - field may contain either the special value any or a - list of architectures separated by spaces. If a list is given, - it may include (or consist solely of) the special value - all. In other words, in .dsc files - unlike the debian/control, all may occur - in combination with specific architectures. The - Architecture field in the source package control file - .dsc is generally constructed from the - Architecture fields in the - debian/control in the source package. + field may contain either the architecture + wildcard any or a list of architectures and + architecture wildcards separated by spaces. If a list is + given, it may include (or consist solely of) the special + value all. In other words, in .dsc + files unlike the debian/control, all may + occur in combination with specific architectures. + The Architecture field in the source package control + file .dsc is generally constructed from + the Architecture fields in + the debian/control in the source package.

@@ -2789,23 +2896,24 @@ Package: libc6

- Specifying a list of architectures indicates that the source - will build an architecture-dependent package, and will only - work correctly on the listed architectures. If the source - package also builds at least one architecture-independent - package, all will also be included in the list. + Specifying a list of architectures or architecture wildcards + indicates that the source will build an architecture-dependent + package, and will only work correctly on the listed or + matching architectures. If the source package also builds at + least one architecture-independent package, all will + also be included in the list.

In a .changes file, the Architecture - field lists the architecture(s) of the package(s) - currently being uploaded. This will be a list; if the - source for the package is also being uploaded, the special + field lists the architecture(s) of the package(s) currently + being uploaded. This will be a list; if the source for the + package is also being uploaded, the special entry source is also present. all will be present if any architecture-independent packages are being - uploaded. any may never occur in the - Architecture field in the .changes - file. + uploaded. Architecture wildcards such as any must + never occur in the Architecture field in + the .changes file.

@@ -2961,9 +3069,10 @@ Package: libc6 It is optional; if it isn't present then the upstream_version may not contain a hyphen. This format represents the case where a piece of - software was written specifically to be turned into a - Debian package, and so there is only one "debianisation" - of it and therefore no revision indication is required. + software was written specifically to be a Debian + package, where the Debian package source must always + be identical to the pristine source and therefore no + revision indication is required.

@@ -3039,10 +3148,12 @@ Package: libc6 not intended to cope with version numbers containing strings of letters which the package management system cannot interpret (such as ALPHA or pre-), or with - silly orderings (the author of this manual has heard of a - package whose versions went 1.1, 1.2, - 1.3, 1, 2.1, 2.2, - 2 and so forth). + silly orderings. + The author of this manual has heard of a package whose + versions went 1.1, 1.2, 1.3, + 1, 2.1, 2.2, 2 and so + forth. +

@@ -3174,7 +3285,9 @@ Package: libc6 Date

- This field includes the date the package was built or last edited. + This field includes the date the package was built or last + edited. It must be in the same format as the date + in a debian/changelog entry.

@@ -3188,12 +3301,30 @@ Package: libc6 Format

- This field specifies a format revision for the file. - The most current format described in the Policy Manual - is version 1.5. The syntax of the - format value is the same as that of a package version - number except that no epoch or Debian revision is allowed - - see . + In .changes + files, this field declares the format version of that file. + The syntax of the field value is the same as that of + a package version number except + that no epoch or Debian revision is allowed. The format + described in this document is &changesversion;. +

+ +

+ In .dsc + Debian source control files, this field declares the + format of the source package. The field value is used by + programs acting on a source package to interpret the list of + files in the source package and determine how to unpack it. + The syntax of the field value is a numeric major revision, a + period, a numeric minor revision, and then an optional subtype + after whitespace, which if specified is an alphanumeric word + in parentheses. The subtype is optional in the syntax but may + be mandatory for particular source format revisions. + + The source formats currently supported by the Debian archive + software are 1.0, 3.0 (native), + and 3.0 (quilt). +

@@ -3410,6 +3541,50 @@ Files:

+ + Checksums-Sha1 + and Checksums-Sha256 + +

+ These fields contain a list of files with a checksum and size + for each one. Both Checksums-Sha1 + and Checksums-Sha256 have the same syntax and differ + only in the checksum algorithm used: SHA-1 + for Checksums-Sha1 and SHA-256 + for Checksums-Sha256. +

+ +

+ Checksums-Sha1 and Checksums-Sha256 are + multiline fields. The first line of the field value (the part + on the same line as Checksums-Sha1: + or Checksums-Sha256:) is always empty. The content + of the field is expressed as continuation lines, one line per + file. Each line consists of the checksum, a space, the file + size, a space, and the file name. For example (from + a .changes file): + +Checksums-Sha1: + 1f418afaa01464e63cc1ee8a66a05f0848bd155c 1276 example_1.0-1.dsc + a0ed1456fad61116f868b1855530dbe948e20f06 171602 example_1.0.orig.tar.gz + 5e86ecf0671e113b63388dac81dd8d00e00ef298 6137 example_1.0-1.debian.tar.gz + 71a0ff7da0faaf608481195f9cf30974b142c183 548402 example_1.0-1_i386.deb +Checksums-Sha256: + ac9d57254f7e835bed299926fd51bf6f534597cc3fcc52db01c4bffedae81272 1276 example_1.0-1.dsc + 0d123be7f51e61c4bf15e5c492b484054be7e90f3081608a5517007bfb1fd128 171602 example_1.0.orig.tar.gz + f54ae966a5f580571ae7d9ef5e1df0bd42d63e27cb505b27957351a495bc6288 6137 example_1.0-1.debian.tar.gz + 3bec05c03974fdecd11d020fc2e8250de8404867a8a2ce865160c250eb723664 548402 example_1.0-1_i386.deb + +

+ +

+ In the .dsc file, these fields should list all + files that make up the source package. In + the .changes file, these fields should list all + files being uploaded. The list of files in these fields + must match the list of files in the Files field. +

+
@@ -3472,12 +3647,11 @@ Files:

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

@@ -3492,12 +3666,12 @@ Files: 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 @@ -3509,7 +3683,7 @@ Files:

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. @@ -3566,6 +3740,15 @@ Files: assume that program will handle falling back to noninteractive behavior.

+ +

+ For high-priority prompts without a reasonable default answer, + maintainer scripts may abort if there is no controlling + terminal. However, this situation should be avoided if at all + possible, since it prevents automated or unattended installs. + In most cases, users will consider this to be a bug in the + package. +

@@ -3584,111 +3767,173 @@ Files:

- - - 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 be at least unpacked. + They may be only unpacked or "Half-Configured", not + completely configured, but only if a previous version of the + pre-dependency was completely configured and the + pre-dependency had 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 not 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. - + +

- - - 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. + + 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". + - + +

- - - 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 cannot assume that + the package's dependencies are available. + + 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 unpackaging 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 @@ -3890,7 +4135,7 @@ Files: 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. @@ -4026,7 +4271,7 @@ Files: 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). @@ -4164,7 +4409,7 @@ Files: 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, @@ -4218,21 +4463,24 @@ Depends: libc6 (>= 2.2.1), exim | mail-transport-agent

- All fields that specify build-time relationships + Relationships may be restricted to a certain set of + architectures. This is indicated in brackets after each + individual package name and the optional version specification. + The brackets enclose a list of Debian architecture names + separated by whitespace. Exclamation marks may be prepended to + each of the names. (It is not permitted for some names to be + prepended with exclamation marks while others aren't.) +

+ +

+ For build relationship fields (Build-Depends, Build-Depends-Indep, - Build-Conflicts and Build-Conflicts-Indep) - may be restricted to a certain set of architectures. This - is indicated in brackets after each individual package name and - the optional version specification. The brackets enclose a - list of Debian architecture names separated by whitespace. - Exclamation marks may be prepended to each of the names. - (It is not permitted for some names to be prepended with - exclamation marks while others aren't.) If the current Debian - host architecture is not in this list and there are no - exclamation marks in the list, or it is in the list with a - prepended exclamation mark, the package name and the - associated version specification are ignored completely for - the purposes of defining the relationships. + Build-Conflicts and Build-Conflicts-Indep), if + the current Debian host architecture is not in this list and + there are no exclamation marks in the list, or it is in the list + with a prepended exclamation mark, the package name and the + associated version specification are ignored completely for the + purposes of defining the relationships.

@@ -4248,6 +4496,29 @@ Build-Depends: kernel-headers-2.2.10 [!hurd-i386], gnumach-dev only on hurd-i386.

+

+ For binary relationship fields, the architecture restriction + syntax is only supported in the source package control + file debian/control. When the corresponding binary + package control file is generated, the relationship will either + be omitted or included without the architecture restriction + based on the architecture of the binary package. This means + that architecture restrictions must not be used in binary + relationship fields for architecture-independent packages + (Architecture: all). +

+ +

+ For example: + +Depends: foo [i386], bar [amd64] + + becomes Depends: foo when the package is built on + the i386 architecture, Depends: bar when the + package is built on the amd64 architecture, and omitted + entirely in binary packages built on all other architectures. +

+

If the architecture-restricted dependency is part of a set of alternatives using |, that alternative is ignored @@ -4261,6 +4532,21 @@ Build-Depends: foo [!i386] | bar [!amd64] bar on all other architectures.

+

+ Relationships may also be restricted to a certain set of + architectures using architecture wildcards. The syntax for + declaring such restrictions is the same as declaring + restrictions using a certain set of architectures without + architecture wildcards. For example: + +Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any] + + is equivalent to foo on architectures using the Linux + kernel and any cpu, bar on architectures using any + kernel and an i386 cpu, and baz on any architecture + using a kernel other than Linux. +

+

Note that the binary package relationship fields such as Depends appear in one of the binary package @@ -4287,7 +4573,7 @@ Build-Depends: foo [!i386] | bar [!amd64]

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. @@ -4325,31 +4611,31 @@ Build-Depends: foo [!i386] | bar [!amd64]

- 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 + allows multiple packages to be upgraded in one unpack and + configure step even if some packages being upgraded have + versioned dependencies on the upgraded versions of other + packages involved in the installation run.

-

- 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 when being 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.

@@ -4361,7 +4647,8 @@ Build-Depends: foo [!i386] | bar [!amd64] 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).

@@ -4373,12 +4660,17 @@ Build-Depends: foo [!i386] | bar [!amd64]

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 be at least + unpacked or "Half-Installed". +

Recommends @@ -4437,11 +4729,21 @@ Build-Depends: foo [!i386] | bar [!amd64]

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

@@ -4450,13 +4752,6 @@ Build-Depends: foo [!i386] | bar [!amd64] 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. -

@@ -4481,7 +4776,7 @@ Build-Depends: foo [!i386] | bar [!amd64]

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 be unpacked unless the broken package is deconfigured first, and it will refuse to allow the broken package to be reconfigured.

@@ -4502,17 +4797,29 @@ Build-Depends: foo [!i386] | bar [!amd64]

Normally a Breaks entry will have an "earlier than" version clause; such a Breaks is introduced in the - version of an (implicit or explicit) dependency which - violates an assumption or reveals a bug in earlier versions - of the broken package. This use of Breaks will - inform higher-level package management tools that broken - package must be upgraded before the new one. + version of an (implicit or explicit) dependency which violates + an assumption or reveals a bug in earlier versions of the broken + package, or which takes over a file from earlier versions of the + package named in Breaks. This use of Breaks + will inform higher-level package management tools that the + broken package must be upgraded before the new one.

If the breaking package also overwrites some files from the - older package, it should use Replaces (not - Conflicts) to ensure this goes smoothly. + older package, it should use Replaces to ensure this + goes smoothly. See for a full discussion + of taking over files from other packages, including how to + use Breaks in those cases. +

+ +

+ Many of the cases where Breaks should be used were + previously handled with Conflicts + because Breaks did not yet exist. + Many Conflicts fields should now be Breaks. + See for more information about the + differences.

@@ -4520,24 +4827,27 @@ Build-Depends: foo [!i386] | bar [!amd64] 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 + 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 only + prevents both packages from being configured at the same time. + Conflicting packages cannot be unpacked on the system 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 (see ) the one on the system, - or the one on the system is marked as deselected, or both - packages are marked Essential, then - dpkg will automatically remove the package - which is causing the conflict, otherwise it will halt the - installation of the new package with an error. This - mechanism is specifically designed to produce an error when - the installed package is Essential, but the new - package is not. + 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 + marked Essential, then dpkg will + automatically remove the package which is causing the conflict. + Otherwise, it will halt the installation of the new package with + an error. This mechanism is specifically designed to produce an + error when the installed package is Essential, but the + new package is not.

@@ -4557,12 +4867,61 @@ Build-Depends: foo [!i386] | bar [!amd64]

- A Conflicts entry should almost never have an - "earlier than" version clause. This would prevent - dpkg from upgrading or installing the package - which declared such a conflict until the upgrade or removal - of the conflicted-with package had been completed. Instead, - Breaks may be used. + Normally, Breaks should be used instead + of Conflicts since Conflicts imposes a + stronger restriction on the ordering of package installation or + upgrade and can make it more difficult for the package manager + to find a correct solution to an upgrade or installation + problem. Breaks should be used + + when moving a file from one package to another (see + ), + when splitting a package (a special case of the previous + one), or + when the breaking package exposes a bug in or interacts + badly with particular versions of the broken + package. + + Conflicts should be used + + 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 + at a time (see ), + in other cases where one must prevent simultaneous + installation of two packages for reasons that are ongoing + (not fixed in a later version of one of the packages) or + that must prevent both packages from being unpacked at the + same time, not just configured. + + Be aware that adding Conflicts is normally not the best + solution when two packages provide the same files. Depending on + the reason for that conflict, using alternatives or renaming the + files is often a better approach. See, for + example, . +

+ +

+ Neither Breaks nor Conflicts should be used + unless two packages cannot be installed at the same time or + installing them both causes one of them to be broken or + unusable. Having similar functionality or performing the same + tasks as another package is not sufficient reason to + declare Breaks or Conflicts with that package. +

+ +

+ A Conflicts entry may have an "earlier than" version + clause if the reason for the conflict is corrected in a later + version of one of the packages. However, normally the presence + of an "earlier than" version clause is a sign + that Breaks should have been used instead. An "earlier + than" version clause in Conflicts + prevents dpkg from upgrading or installing the + package which declares such a conflict until the upgrade or + removal of the conflicted-with package has been completed, which + is a strong restriction.

@@ -4581,11 +4940,10 @@ Build-Depends: foo [!i386] | bar [!amd64]

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 )

@@ -4609,59 +4967,103 @@ Provides: bar

- If a relationship field has a version number attached - then only real packages will be considered to see whether - the relationship is satisfied (or the prohibition violated, - for a conflict or breakage) - it is assumed that a real - package which provides the virtual package is not of the - "right" version. So, a Provides field may not - contain version numbers, and the version number of the - concrete package which provides a particular virtual package - will not be looked at when considering a dependency on or - conflict with the virtual package name. + If a relationship field has a version number attached, only real + packages will be considered to see whether the relationship is + satisfied (or the prohibition violated, for a conflict or + breakage). In other words, if a version number is specified, + this is a request to ignore all Provides for that + package name and consider only real packages. The package + manager will assume that a package providing that virtual + package is not of the "right" version. A Provides + field may not contain version numbers, and the version number of + the concrete package which provides a particular virtual package + will not be considered when considering a dependency on or + conflict with the virtual package name. + It is possible that a future release of dpkg may + add the ability to specify a version number for each virtual + package it provides. This feature is not yet present, + however, and is expected to be used only infrequently. +

- It is likely that the ability will be added in a future - release of dpkg to specify a version number for - each virtual package it provides. This feature is not yet - present, however, and is expected to be used only - infrequently. + To specify which of a set of real packages should be the default + to satisfy a particular dependency on a virtual package, list + the real package as an alternative before the virtual one.

- If you want to specify which of a set of real packages - should be the default to satisfy a particular dependency on - a virtual package, you should list the real package as an - alternative before the virtual one. + If the virtual package represents a facility that can only be + provided by one real package at a time, such as + the mail-transport-agent virtual package that + requires installation of a binary that would conflict with all + other providers of that virtual package (see + ), all packages providing that + virtual package should also declare a conflict with it + using Conflicts. This will ensure that at most one + provider of that virtual package is unpacked or installed at a + time.

- Overwriting files and replacing packages - Replaces

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

- Firstly, as mentioned before, it is usually an error for a - package to contain files which are on the system in - another package. + It is usually an error for a package to contain files which + are on the system in another package. However, if the + overwriting package declares that it Replaces the one + containing the file being overwritten, then dpkg + will replace the file from the old package with that from the + new. The file will no longer be listed as "owned" by the old + package and will be taken over by the new package. + Normally, Breaks should be used in conjunction + with Replaces. + To see why Breaks is normally needed in addition + to Replaces, consider the case of a file in the + package foo being taken over by the + package foo-data. + Replaces will allow foo-data to + be installed and take over that file. However, + without Breaks, nothing + requires foo to be upgraded to a newer + version that knows it does not include that file and instead + depends on foo-data. Nothing would + prevent the new foo-data package from + being installed and then removed, removing the file that it + took over from foo. After that + operation, the package manager would think the system was in + a consistent state, but the foo package + would be missing one of its files. +

- However, if the overwriting package declares that it - Replaces the one containing the file being - overwritten, then dpkg will replace the file - from the old package with that from the new. The file - will no longer be listed as "owned" by the old package. + For example, if a package foo is split + into foo and foo-data + starting at version 1.2-3, foo-data would + have the fields + +Replaces: foo (<< 1.2-3) +Breaks: foo (<< 1.2-3) + + in its control file. The new version of the + package foo would normally have the field + +Depends: foo-data (>= 1.2-3) + + (or possibly Recommends or even Suggests if + the files moved into foo-data are not + required for normal operation).

@@ -4676,40 +5078,35 @@ Provides: bar special argument to allow the package to do any final cleanup required. See . -

- Replaces is a one way relationship -- you have to - install the replacing package after the replaced - package. -

+ Replaces is a one way relationship. You have to install + the replacing package after the replaced package.

For this usage of Replaces, virtual packages (see ) are not considered when looking at a - Replaces field - the packages declared as being + Replaces field. The packages declared as being replaced must be mentioned by their real names.

- Furthermore, this usage of Replaces only takes - effect when both packages are at least partially on the - system at once, so that it can only happen if they do not - conflict or if the conflict has been overridden. + This usage of Replaces only takes effect when both + packages are at least partially on the system at once. It is + not relevant if the packages conflict unless the conflict has + been overridden.

-
Replacing whole packages, forcing their removal

- Secondly, Replaces allows the packaging system to + Second, Replaces allows the packaging system to resolve which package should be removed when there is a - conflict - see . This usage only - takes effect when the two packages do conflict, - so that the two usages of this field do not interfere with - each other. + conflict (see ). This usage only takes + effect when the two packages do conflict, so that the + two usages of this field do not interfere with each other.

@@ -4722,8 +5119,9 @@ Provides: mail-transport-agent Conflicts: mail-transport-agent Replaces: mail-transport-agent - ensuring that only one MTA can be installed at any one - time. + ensuring that only one MTA can be unpacked at any one + time. See for more information about this + example. @@ -4742,7 +5140,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.

@@ -4754,58 +5152,44 @@ Replaces: mail-transport-agent The dependencies and conflicts they define must be satisfied (as defined earlier for binary packages) in order to invoke the targets in debian/rules, as follows: -

- If you make "build-arch" or "binary-arch", you need - Build-Depends. If you make "build-indep" or - "binary-indep", you need Build-Depends and - Build-Depends-Indep. If you make "build" or "binary", - you need both. -

There is no Build-Depends-Arch; this role is essentially - met with Build-Depends. Anyone building the - build-indep and binary-indep targets - is basically assumed to be building the whole package - anyway and so installs all build dependencies. The - autobuilders use dpkg-buildpackage -B, which - calls build (not build-arch, since it - does not yet know how to check for its existence) and - binary-arch. + met with Build-Depends. Anyone building the + build-indep and binary-indep targets is + assumed to be building the whole package, and therefore + installation of all build dependencies is required.

- The purpose of the original split, I recall, was so that - the autobuilders wouldn't need to install extra packages - needed only for the binary-indep targets. But without a - build-arch/build-indep split, this didn't work, since - most of the work is done in the build target, not in the - binary target. + The autobuilders use dpkg-buildpackage -B, which + calls build, not build-arch since it does + not yet know how to check for its existence, and + binary-arch. The purpose of the original split + between Build-Depends and + Build-Depends-Indep was so that the autobuilders + wouldn't need to install extra packages needed only for the + binary-indep targets. But without a build-arch/build-indep + split, this didn't work, since most of the work is done in + the build target, not in the binary target.

- - Build-Depends, Build-Conflicts + clean, build-arch, and + binary-arch - The Build-Depends and - Build-Conflicts fields must be satisfied when - any of the following targets is invoked: - build, clean, binary, - binary-arch, build-arch, - build-indep and binary-indep. + Only the Build-Depends and Build-Conflicts + fields must be satisfied when these targets are invoked. - Build-Depends-Indep, - Build-Conflicts-Indep + build, build-indep, binary, + and binary-indep - The Build-Depends-Indep and - Build-Conflicts-Indep fields must be - satisfied when any of the following targets is - invoked: build, build-indep, - binary and binary-indep. + The Build-Depends, Build-Conflicts, + Build-Depends-Indep, and + Build-Conflicts-Indep fields must be satisfied when + these targets are invoked.

-
- @@ -4820,55 +5204,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.

- 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). + 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.

+

+ 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 @@ -4888,10 +5351,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 @@ -4954,7 +5418,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 @@ -5077,11 +5541,20 @@ Replaces: mail-transport-agent Development files

- The development files associated to a shared library need to be - placed in a package called - librarynamesoversion-dev, + If there are development files associated with a shared library, + the source package needs to generate a binary development package + named librarynamesoversion-dev, or if you prefer only to support one development version at a - time, libraryname-dev. + time, libraryname-dev. Installing + the development package must result in installation of all the + development files necessary for compiling programs against that + shared library. + This wording allows the development files to be split into + several packages, such as a separate architecture-independent + libraryname-headers, provided that + the development package depends on all the required additional + packages. +

@@ -5090,7 +5563,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).

@@ -5102,6 +5575,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 . +

@@ -5140,59 +5621,49 @@ Replaces: mail-transport-agent

- Thus, when a package is built which contains any shared - libraries, it must provide a shlibs file for other - packages to use, and when a package is built which contains - any shared libraries or compiled binaries, it must run + When a package is built which contains any shared libraries, it + must provide a shlibs file for other packages to + use. When a package is built which contains any shared + libraries or compiled binaries, it must run dpkg-shlibdeps on these to determine the libraries used and hence the dependencies needed by this package.

- In the past, the shared libraries linked to were - determined by calling ldd, but now - objdump is used to do this. The only - change this makes to package building is that - dpkg-shlibdeps must also be run on shared - libraries, whereas in the past this was unnecessary. - The rest of this footnote explains the advantage that - this method gives. + dpkg-shlibdeps will use a program + like objdump or readelf to find + the libraries directly needed by the binaries or shared + libraries in the package.

We say that a binary foo directly uses a library libbar if it is explicitly linked - with that library (that is, it uses the flag - -lbar during the linking stage). Other + with that library (that is, the library is listed in the ELF + NEEDED attribute, caused by adding -lbar + to the link line when the binary is created). Other libraries that are needed by libbar are linked indirectly to foo, and the dynamic linker will load them automatically when it loads - libbar. A package should depend on - the libraries it directly uses, and the dependencies for - those libraries should automatically pull in the other - libraries. -

- -

- Unfortunately, the ldd program shows both - the directly and indirectly used libraries, meaning that - the dependencies determined included both direct and - indirect dependencies. The use of objdump - avoids this problem by determining only the directly - used libraries. + libbar. A package should depend on the libraries + it directly uses, but not the libraries it indirectly uses. + The dependencies for those libraries will automatically pull + in the other libraries.

A good example of where this helps is the following. We could update libimlib with a new version that - supports a new graphics format called dgf (but retaining - the same major version number). If we used the old - ldd method, every package that uses - libimlib would need to be recompiled so it - would also depend on libdgf or it wouldn't run - due to missing symbols. However with the new system, - packages using libimlib can rely on - libimlib itself having the dependency on - libdgf and so they would not need rebuilding. + supports a new graphics format called dgf (but retaining the + same major version number) and depends on libdgf. + If we used ldd to add dependencies for every + library directly or indirectly linked with a binary, every + package that uses libimlib would need to be + recompiled so it would also depend on libdgf or it + wouldn't run due to missing symbols. Since dependencies are + only added based on ELF NEEDED attribute, packages + using libimlib can rely on libimlib itself + having the dependency on libdgf and so they would + not need rebuilding.

@@ -5222,8 +5693,13 @@ Replaces: mail-transport-agent

debian/shlibs.local

- This lists overrides for this package. Its use is - described below (see ). + This lists overrides for this package. This file should + normally not be used, but may be needed temporarily in + unusual situations to work around bugs in other packages, + or in unusual cases where the normally declared dependency + information in the installed shlibs file for + a library cannot be used. This file overrides information + obtained from any other source.

@@ -5241,38 +5717,34 @@ Replaces: mail-transport-agent

DEBIAN/shlibs files in the "build directory"

- 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 - package. - An example may help here. Let us say that the - source package foo generates two binary - packages, libfoo2 and - foo-runtime. When building the binary - packages, the two packages are created in the - directories debian/libfoo2 and - debian/foo-runtime respectively. - (debian/tmp could be used instead of one - of these.) Since libfoo2 provides the - libfoo shared library, it will require a - shlibs file, which will be installed in - debian/libfoo2/DEBIAN/shlibs, eventually - to become - /var/lib/dpkg/info/libfoo2.shlibs. Then - when dpkg-shlibdeps is run on the - executable - debian/foo-runtime/usr/bin/foo-prog, it - will examine the - debian/libfoo2/DEBIAN/shlibs file to - determine whether foo-prog's library - dependencies are satisfied by any of the libraries - provided by libfoo2. For this reason, - dpkg-shlibdeps must only be run once - all of the individual binary packages' - shlibs files have been installed into the - build directory. + When packages are being built, + any debian/shlibs files are copied into the + 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. + When building the binary packages, the two packages are + created in the directories debian/libfoo2 + and debian/foo-runtime respectively. + (debian/tmp could be used instead of one of + these.) Since libfoo2 provides the + libfoo shared library, it will require a + shlibs file, which will be installed in + debian/libfoo2/DEBIAN/shlibs, eventually to + become /var/lib/dpkg/info/libfoo2.shlibs. + When dpkg-shlibdeps is run on the + executable debian/foo-runtime/usr/bin/foo-prog, + it will examine + the debian/libfoo2/DEBIAN/shlibs file to + determine whether foo-prog's library + dependencies are satisfied by any of the libraries + provided by libfoo2. For this reason, + dpkg-shlibdeps must only be run once all of + the individual binary packages' shlibs files + have been installed into the build directory.

@@ -5318,10 +5790,9 @@ dpkg-shlibdeps debian/tmp/usr/bin/* debian/tmp/usr/sbin/* \ Otherwise, you will need to explicitly list the compiled binaries and libraries. - If you are using debhelper, the - dh_shlibdeps program will do this work for - you. It will also correctly handle multi-binary - packages. + If you are using debhelper, the + dh_shlibdeps program will do this work for you. + It will also correctly handle multi-binary packages.

@@ -5333,13 +5804,6 @@ dpkg-shlibdeps debian/tmp/usr/bin/* debian/tmp/usr/sbin/* \ field in the control file for this to work.

-

- If dpkg-shlibdeps doesn't complain, you're - done. If it does complain you might need to create your own - debian/shlibs.local file, as explained below (see - ). -

-

If you have multiple binary packages, you will need to call dpkg-shlibdeps on each one which contains @@ -5353,16 +5817,17 @@ dpkg-shlibdeps debian/tmp/usr/bin/* debian/tmp/usr/sbin/* \ you will need to specify that dpkg-shlibdeps should use the dependency line of type udeb by adding the -tudeb option - dh_shlibdeps from the debhelper suite - will automatically add this option if it knows it is - processing a udeb. - . If there is no dependency line of type udeb - in the shlibs file, dpkg-shlibdeps will - fall back to the regular dependency line. + dh_shlibdeps from the debhelper suite + will automatically add this option if it knows it is + processing a udeb. + . If there is no dependency line of + type udeb in the shlibs + file, dpkg-shlibdeps will fall back to the regular + dependency line.

- For more details on dpkg-shlibdeps, please see + For more details on dpkg-shlibdeps, please see and .

@@ -5406,13 +5871,17 @@ dpkg-shlibdeps debian/tmp/usr/bin/* debian/tmp/usr/sbin/* \ usually of the form name.so.major-version, in our example, libz.so.1. - This can be determined using the command - + This can be determined using the command + objdump -p /usr/lib/libz.so.1.1.3 | grep SONAME - + The version part is the part which comes after - .so., so in our case, it is 1. + .so., so in our case, it is 1. The soname may + instead be of the form + name-major-version.so, such + as libdb-4.8.so, in which case the name would + be libdb and the version would be 4.8.

@@ -5454,7 +5923,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 @@ -5463,14 +5933,15 @@ 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, - This is what dh_makeshlibs in the - debhelper suite does. If your package also has a udeb - that provides a shared library, dh_makeshlibs can - automatically generate the udeb: lines if you specify - the name of the udeb with the --add-udeb option. + 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 + library, dh_makeshlibs can automatically generate + the udeb: lines if you specify the name of the udeb + with the --add-udeb option. since the debian/shlibs file itself is ignored by dpkg-shlibdeps. @@ -5485,74 +5956,7 @@ install -m644 debian/shlibs.package debian/package/DEBIAN/ packages.

- - - Writing the debian/shlibs.local file - -

- This file is intended only as a temporary fix if - your binaries or libraries depend on a library whose package - does not yet provide a correct shlibs file. -

- -

- We will assume that you are trying to package a binary - foo. When you try running - dpkg-shlibdeps you get the following error - message (-O displays the dependency information on - stdout instead of writing it to - debian/substvars, and the lines have been wrapped - for ease of reading): - -$ dpkg-shlibdeps -O debian/tmp/usr/bin/foo -dpkg-shlibdeps: warning: unable to find dependency - information for shared library libbar (soname 1, - path /usr/lib/libbar.so.1, dependency field Depends) -shlibs:Depends=libc6 (>= 2.2.2-2) - - You can then run ldd on the binary to find the - full location of the library concerned: - -$ ldd foo -libbar.so.1 => /usr/lib/libbar.so.1 (0x4001e000) -libc.so.6 => /lib/libc.so.6 (0x40032000) -/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) - - So the foo binary depends on the - libbar shared library, but no package seems to - provide a *.shlibs file handling - libbar.so.1 in /var/lib/dpkg/info/. Let's - determine the package responsible: - -$ dpkg -S /usr/lib/libbar.so.1 -bar1: /usr/lib/libbar.so.1 -$ dpkg -s bar1 | grep Version -Version: 1.0-1 - - This tells us that the bar1 package, version 1.0-1, - is the one we are using. Now we can file a bug against the - bar1 package and create our own - debian/shlibs.local to locally fix the problem. - Including the following line into your - debian/shlibs.local file: - -libbar 1 bar1 (>= 1.0-1) - - should allow the package build to work. -

- -

- As soon as the maintainer of bar1 provides a - correct shlibs file, you should remove this line - from your debian/shlibs.local file. (You should - probably also then have a versioned Build-Depends - on bar1 to help ensure that others do not have the - same problem building your package.) -

-
-
- @@ -6908,7 +7312,7 @@ exec /usr/lib/foo/foo "$@" Files - + Binaries

@@ -7043,10 +7447,10 @@ INSTALL = install -s # (or use strip on the files in debian/tmp) for C files) will need to be compiled twice, for the normal case.

+

- You must specify the gcc option -D_REENTRANT - when building a library (either static or shared) to make - the library compatible with LinuxThreads. + Libraries should be built with threading support and to be + thread-safe if the library supports this.

@@ -7103,40 +7507,58 @@ strip --strip-unneeded your-lib

- An ever increasing number of packages are using - libtool to do their linking. The latest GNU - libtools (>= 1.3a) can take advantage of the metadata in the - installed libtool archive files (*.la - files). The main advantage of libtool's - .la files is that it allows libtool to - store and subsequently access metadata with respect to the - libraries it builds. libtool will search for - those files, which contain a lot of useful information about - a library (such as library dependency information for static - linking). Also, they're essential for programs - using libltdl. - Although libtool is fully capable of - linking against shared libraries which don't have - .la files, as it is a mere shell script it can - add considerably to the build time of a - libtool-using package if that shell script - has to derive all this information from first principles - for each library every time it is linked. With the - advent of libtool version 1.4 (and to a - lesser extent libtool version 1.3), the - .la files also store information about - inter-library dependencies which cannot necessarily be - derived after the .la file is deleted. + Packages that use libtool to create and install + their shared libraries install a file containing additional + metadata (ending in .la) alongside the library. + For public libraries intended for use by other packages, these + files normally should not be included in the Debian package, + since the information they include is not necessary to link with + the shared library on Debian and can add unnecessary additional + dependencies to other programs or libraries. + These files store, among other things, all libraries on which + that shared library depends. Unfortunately, if + the .la file is present and contains that + dependency information, using libtool when + linking against that library will cause the resulting program + or library to be linked against those dependencies as well, + even if this is unnecessary. This can create unneeded + dependencies on shared library packages that would otherwise + be hidden behind the library ABI, and can make library + transitions to new SONAMEs unnecessarily complicated and + difficult to manage. + If the .la file is required for that library (if, + for instance, it's loaded via libltdl in a way that + requires that meta-information), the dependency_libs + setting in the .la file should normally be set to + the empty string. If the shared library development package has + historically included the .la, it must be retained + in the development package (with dependency_libs + emptied) until all libraries that depend on it have removed or + emptied dependency_libs in their .la + files to prevent linking with those other libraries + using libtool from failing. +

+ +

+ If the .la must be included, it should be included + in the development (-dev) package, unless the library + will be loaded by libtool's libltdl + library. If it is intended for use with libltdl, + the .la files must go in the run-time library + package.

- Packages that use libtool to create shared - libraries should include the .la files in the - -dev package, unless the package relies on - libtool's libltdl library, in which case - the .la files must go in the run-time library - package. + These requirements for handling of .la files do not + apply to loadable modules or libraries not installed in + directories searched by default by the dynamic linker. Packages + installing loadable modules will frequently need to install + the .la files alongside the modules so that they + can be loaded by libltdl. dependency_libs + does not need to be modified for libraries or modules that are + not installed in directories searched by the dynamic linker by + default and not intended for use by other packages.

@@ -7227,7 +7649,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 @@ -7453,6 +7887,8 @@ ln -fs ../sbin/sendmail debian/tmp/usr/bin/runq package is purged. + Obsolete configuration files without local changes may be + removed by the package during upgrade.

@@ -7666,11 +8102,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 @@ -7695,17 +8133,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.

@@ -7717,7 +8158,7 @@ endscript

- + Permissions and owners

@@ -7758,6 +8199,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 @@ -7923,51 +8370,10 @@ done

If a program needs to specify an architecture specification - string in some place, it should select one of the - strings provided by dpkg-architecture -L. The - strings are in the format - os-arch, though the OS part - is sometimes elided, as when the OS is Linux. -

Currently, the strings are: - i386 ia64 alpha amd64 armeb arm hppa m32r m68k mips - mipsel powerpc ppc64 s390 s390x sh3 sh3eb sh4 sh4eb - sparc darwin-i386 darwin-ia64 darwin-alpha darwin-amd64 - darwin-armeb darwin-arm darwin-hppa darwin-m32r - darwin-m68k darwin-mips darwin-mipsel darwin-powerpc - darwin-ppc64 darwin-s390 darwin-s390x darwin-sh3 - darwin-sh3eb darwin-sh4 darwin-sh4eb darwin-sparc - freebsd-i386 freebsd-ia64 freebsd-alpha freebsd-amd64 - freebsd-armeb freebsd-arm freebsd-hppa freebsd-m32r - freebsd-m68k freebsd-mips freebsd-mipsel freebsd-powerpc - freebsd-ppc64 freebsd-s390 freebsd-s390x freebsd-sh3 - freebsd-sh3eb freebsd-sh4 freebsd-sh4eb freebsd-sparc - kfreebsd-i386 kfreebsd-ia64 kfreebsd-alpha - kfreebsd-amd64 kfreebsd-armeb kfreebsd-arm kfreebsd-hppa - kfreebsd-m32r kfreebsd-m68k kfreebsd-mips - kfreebsd-mipsel kfreebsd-powerpc kfreebsd-ppc64 - kfreebsd-s390 kfreebsd-s390x kfreebsd-sh3 kfreebsd-sh3eb - kfreebsd-sh4 kfreebsd-sh4eb kfreebsd-sparc knetbsd-i386 - knetbsd-ia64 knetbsd-alpha knetbsd-amd64 knetbsd-armeb - knetbsd-arm knetbsd-hppa knetbsd-m32r knetbsd-m68k - knetbsd-mips knetbsd-mipsel knetbsd-powerpc - knetbsd-ppc64 knetbsd-s390 knetbsd-s390x knetbsd-sh3 - knetbsd-sh3eb knetbsd-sh4 knetbsd-sh4eb knetbsd-sparc - netbsd-i386 netbsd-ia64 netbsd-alpha netbsd-amd64 - netbsd-armeb netbsd-arm netbsd-hppa netbsd-m32r - netbsd-m68k netbsd-mips netbsd-mipsel netbsd-powerpc - netbsd-ppc64 netbsd-s390 netbsd-s390x netbsd-sh3 - netbsd-sh3eb netbsd-sh4 netbsd-sh4eb netbsd-sparc - openbsd-i386 openbsd-ia64 openbsd-alpha openbsd-amd64 - openbsd-armeb openbsd-arm openbsd-hppa openbsd-m32r - openbsd-m68k openbsd-mips openbsd-mipsel openbsd-powerpc - openbsd-ppc64 openbsd-s390 openbsd-s390x openbsd-sh3 - openbsd-sh3eb openbsd-sh4 openbsd-sh4eb openbsd-sparc - hurd-i386 hurd-ia64 hurd-alpha hurd-amd64 hurd-armeb - hurd-arm hurd-hppa hurd-m32r hurd-m68k hurd-mips - hurd-mipsel hurd-powerpc hurd-ppc64 hurd-s390 hurd-s390x - hurd-sh3 hurd-sh3eb hurd-sh4 hurd-sh4eb hurd-sparc -

- + string in some place, it should select one of the strings + provided by dpkg-architecture -L. The strings are in + the format os-arch, though the OS + part is sometimes elided, as when the OS is Linux.

@@ -7979,6 +8385,27 @@ done arch-unknown-linux, since the unknown does not look very good.

+ + + Architecture wildcards + +

+ A package may specify an architecture wildcard. Architecture + wildcards are in the format any (which matches every + architecture), os-any, or + any-cpu. + Internally, the package system normalizes the GNU triplets + and the Debian arches into Debian arch triplets (which are + kind of inverted GNU triplets), with the first component of + the triplet representing the libc and ABI in use, and then + does matching against those triplets. However, such + triplets are an internal implementation detail that should + not be used by packages directly. The libc and ABI portion + is handled internally by the package system based on + the os and cpu. + +

+
@@ -8064,10 +8491,14 @@ done

These two files are managed through the dpkg - "alternatives" mechanism. Thus every package providing an - editor or pager must call the - update-alternatives script to register these - programs. + "alternatives" mechanism. Every package providing an editor or + pager must call the update-alternatives script to + register as an alternative for /usr/bin/editor + or /usr/bin/pager as appropriate. The alternative + should have a slave alternative + for /usr/share/man/man1/editor.1.gz + or /usr/share/man/man1/pager.1.gz pointing to the + corresponding manual page.

@@ -8116,11 +8547,13 @@ done /usr/lib/cgi-bin/cgi-bin-name - and should be referred to as + or a subdirectory of that directory, and should be + referred to as http://localhost/cgi-bin/cgi-bin-name - + (possibly with a subdirectory name + before cgi-bin-name). @@ -8276,8 +8709,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.

@@ -8386,8 +8818,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 @@ -8405,12 +8838,14 @@ 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. + 20. That alternative should have a slave alternative + for /usr/share/man/man1/x-terminal-emulator.1.gz + pointing to the corresponding manual page.

@@ -8451,9 +8886,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: @@ -8487,6 +8922,9 @@ name ["syshostname"]: configuration, add 10 points; otherwise add none. + That alternative should have a slave alternative + for /usr/share/man/man1/x-window-manager.1.gz + pointing to the corresponding manual page.

@@ -8626,8 +9064,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. @@ -8893,7 +9331,7 @@ name ["syshostname"]: name="Man-Page-HOWTO">, , the examples created by debmake or dh_make, - the helper programs help2man, or the + the helper program help2man, or the directory /usr/share/doc/man-db/examples.

@@ -9168,16 +9606,16 @@ END-INFO-DIR-ENTRY

- Packages distributed under the UCB BSD license, the Apache - license (version 2.0), the Artistic license, the GNU GPL - (version 2 or 3), the GNU LGPL (versions 2, 2.1, or 3), and the - GNU FDL (versions 1.2 or 1.3) should refer to the corresponding - files under /usr/share/common-licenses, + Packages distributed under the Apache license (version 2.0), the + Artistic license, the GNU GPL (versions 1, 2, or 3), the GNU + LGPL (versions 2, 2.1, or 3), and the GNU FDL (versions 1.2 or + 1.3) should refer to the corresponding files + under /usr/share/common-licenses,

In particular, - /usr/share/common-licenses/BSD, /usr/share/common-licenses/Apache-2.0, /usr/share/common-licenses/Artistic, + /usr/share/common-licenses/GPL-1, /usr/share/common-licenses/GPL-2, /usr/share/common-licenses/GPL-3, /usr/share/common-licenses/LGPL-2, @@ -9185,7 +9623,14 @@ END-INFO-DIR-ENTRY /usr/share/common-licenses/LGPL-3, /usr/share/common-licenses/GFDL-1.2, and /usr/share/common-licenses/GFDL-1.3 - respectively. + respectively. The University of California BSD license is + also included in base-files as + /usr/share/common-licenses/BSD, but given the + brevity of this license, its specificity to code whose + copyright is held by the Regents of the University of + California, and the frequency of minor wording changes, its + text should be included in the copyright file rather than + referencing this file.

rather than quoting them in the copyright file. @@ -9440,7 +9885,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.

@@ -9488,13 +9933,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.

@@ -9986,23 +10431,23 @@ END-INFO-DIR-ENTRY - The Debianised source tree + The Debian package source tree

The source archive scheme described later is intended to - allow a Debianised source tree with some associated control - information to be reproduced and transported easily. The - Debianised source tree is a version of the original program - with certain files added for the benefit of the - Debianisation process, and with any other changes required + allow a Debian package source tree with some associated + control information to be reproduced and transported easily. + The Debian package source tree is a version of the original + program with certain files added for the benefit of the + packaging process, and with any other changes required made to the rest of the source code and installation scripts.

The extra files created for Debian are in the subdirectory - debian of the top level of the Debianised source - tree. They are described below. + debian of the top level of the Debian package + source tree. They are described below.

@@ -10092,7 +10537,7 @@ END-INFO-DIR-ENTRY
- Debianisation diff - + Debian package diff - package_upstream_version-revision.diff.gz @@ -10161,7 +10606,7 @@ END-INFO-DIR-ENTRY

Apply the diff using patch -p0.

Untar the tarfile again if you want a copy of the original - source code alongside the Debianised version.

+ source code alongside the Debian version.

@@ -10195,10 +10640,10 @@ END-INFO-DIR-ENTRY

The source packaging tools manage the changes between the - original and Debianised source using diff and + original and Debian source using diff and patch. Turning the original source tree as - included in the .orig.tar.gz into the debianised - source must not involve any changes which cannot be + included in the .orig.tar.gz into the Debian + package source must not involve any changes which cannot be handled by these tools. Problematic changes which cause dpkg-source to halt with an error when building the source package are: @@ -10365,7 +10810,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. @@ -10422,7 +10867,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,