X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=policy.sgml;h=07ae48f90b84c40f28fa0dcd3cad72306e364fc0;hb=55b23243686d371dd3ded1f89fbbaf12f4c2199b;hp=c160672a697c61e8e1961739277764242f858c92;hpb=7b23de903d3ba7734e23bae91d85b92a18a1f120;p=debian%2Fdebian-policy.git diff --git a/policy.sgml b/policy.sgml index c160672..07ae48f 100644 --- a/policy.sgml +++ b/policy.sgml @@ -2,6 +2,8 @@ %versiondata; + + ]> @@ -1210,9 +1212,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.

@@ -1788,7 +1792,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 @@ -2404,6 +2408,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. @@ -2488,13 +2497,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 @@ -2528,7 +2535,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.

@@ -2555,23 +2563,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

@@ -2590,12 +2599,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;.

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

@@ -2665,8 +2683,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).

@@ -2683,17 +2701,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 @@ -2707,9 +2725,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.

@@ -3019,9 +3038,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.

@@ -3250,12 +3270,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). +

@@ -3472,6 +3510,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. +

+
@@ -4289,21 +4371,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.

@@ -4319,6 +4404,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 @@ -4333,11 +4441,11 @@ Build-Depends: foo [!i386] | bar [!amd64]

- All fields that specify build-time 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: + 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] @@ -4588,17 +4696,29 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any]

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.

@@ -4609,21 +4729,24 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any] When one binary package declares a conflict with another using a Conflicts field, dpkg will refuse to allow them to be installed on the system at the - same time. + same time. This is a stronger restriction than Breaks, + which just prevents both packages from being configured at the + same time. Conflicting packages cannot be unpacked on the + system at the same time.

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. + first. If the package being installed 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.

@@ -4643,12 +4766,61 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any]

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

@@ -4695,35 +4867,45 @@ 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 @@ -4737,31 +4919,51 @@ Provides: bar 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. -

- -

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

For example, if a package foo is split into foo and foo-data - starting at version 1.2-3, foo-data should - have the field + 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 package foo - doesn't need any special control fields in this example, - although would generally depend on or - recommend foo-data. + 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).

@@ -4776,40 +4978,35 @@ Replaces: foo (<< 1.2-3) 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.

@@ -4823,7 +5020,8 @@ Conflicts: mail-transport-agent Replaces: mail-transport-agent ensuring that only one MTA can be installed at any one - time. + time. See for more information about this + example. @@ -4857,7 +5055,7 @@ Replaces: mail-transport-agent

There is no Build-Depends-Arch; this role is essentially met with Build-Depends. Anyone building the - build-indep and binary-indep targets is + build-indep and binary-indep targets is assumed to be building the whole package, and therefore installation of all build dependencies is required.

@@ -5163,11 +5361,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. +

@@ -5226,59 +5433,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.

@@ -5308,8 +5505,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.

@@ -5327,38 +5529,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 + 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 + 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. 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. + 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.

@@ -5404,10 +5602,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.

@@ -5419,13 +5616,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 @@ -5439,16 +5629,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 .

@@ -5492,13 +5683,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.

@@ -5552,11 +5747,12 @@ install -m644 debian/shlibs.package debian/package/DEBIAN/ 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. + 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. @@ -5571,74 +5767,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.) -

-
-
- @@ -6994,7 +7123,7 @@ exec /usr/lib/foo/foo "$@" Files - + Binaries

@@ -7129,10 +7258,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.

@@ -7189,40 +7318,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.

@@ -8184,11 +8331,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). @@ -9237,14 +9386,15 @@ END-INFO-DIR-ENTRY

Packages distributed under 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 + 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/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, @@ -10060,23 +10210,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.

@@ -10166,7 +10316,7 @@ END-INFO-DIR-ENTRY - Debianisation diff - + Debian package diff - package_upstream_version-revision.diff.gz @@ -10235,7 +10385,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.

@@ -10269,10 +10419,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: