]> git.donarmstrong.com Git - debian/debian-policy.git/blobdiff - policy.sgml
Merge branch 'master' into bug477240-rra
[debian/debian-policy.git] / policy.sgml
index 99ab0fffc98f6acd3d9a323693c9fbf9e6641846..d1c7ca82eb6864ca329dcdbe3e8a14cdae60633e 100644 (file)
@@ -2,6 +2,8 @@
 <!-- include version information so we don't have to hard code it
      within the document -->
 <!entity % versiondata SYSTEM "version.ent"> %versiondata;
+<!-- current Debian changes file format -->
+<!entity changesversion "1.8">
 ]>
 <debiandoc>
 
        in the <tt>.deb</tt> file format.
       </p>
 
+      <p>
+       A <tt>.deb</tt> 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 <em>control information files</em>.
+       Among those files are the package maintainer scripts
+       and <file>control</file>, the <qref id="binarycontrolfiles">binary
+       package control file</qref> that contains the control fields for
+       the package.  Other control information files
+       include <qref id="sharedlibs-shlibdeps">the <file>shlibs</file>
+       file</qref> used to store shared library dependency information
+       and the <file>conffiles</file> file that lists the package's
+       configuration files (described in <ref id="config-files">).
+      </p>
+
+      <p>
+       There is unfortunately a collision of terminology here between
+       control information files and files in the Debian control file
+       format.  Throughout this document, a <em>control file</em> refers
+       to a file in the Debian control file format.  These files are
+       documented in <ref id="controlfields">.  Only files referred to
+       specifically as <em>control information files</em> are the files
+       included in the control information file member of
+       the <file>.deb</file> file format used by binary packages.  Most
+       control information files are not in the Debian control file
+       format.
+      </p>
+
       <sect>
        <heading>The package name</heading>
 
 
          <p>
            In general, Debian packages should use the same version
-           numbers as the upstream sources.
-         </p>
-
-         <p>
-           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, <prgn>dpkg</prgn> will consider "96May01" to be
+           greater than "96Dec24".
          </p>
 
          <p>
            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.
          </p>
 
          <p>
-           Note that other version formats based on dates which are
-           parsed correctly by the package management system should
-           <em>not</em> be changed.
-         </p>
-
-         <p>
-           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 (<tt>-</tt>)
+           cannot be used in native package versions.  Period
+           (<tt>.</tt>) is normally a good choice.
          </p>
        </sect1>
 
        <heading>The description of a package</heading>
 
        <p>
-         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 <tt>Description</tt> control
+         field which contains a synopsis and extended description of the
+         package.  Technical information about the format of the
          <tt>Description</tt> field is in <ref id="f-Description">.
        </p>
 
          must be available and usable on the system at all times, even
          when packages are in an unconfigured (but unpacked) state.
          Packages are tagged <tt>essential</tt> for a system using the
-         <tt>Essential</tt> control file field.  The format of the
+         <tt>Essential</tt> control field.  The format of the
          <tt>Essential</tt> control field is described in <ref
          id="f-Essential">.
        </p>
        </p>
 
        <p>
-         You should not use <prgn>dpkg-divert</prgn> on a file
-         belonging to another package without consulting the
-         maintainer of that package first.
+         You should not use <prgn>dpkg-divert</prgn> 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 <tt>--package</tt> flag
+         to <prgn>dpkg-divert</prgn> and must not use <tt>--local</tt>.
        </p>
 
        <p>
 
          <p>
            Packages which use the Debian Configuration Management
-           Specification may contain an additional
-           <prgn>config</prgn> script and a <tt>templates</tt>
-           file in their control archive<footnote>
-               The control.tar.gz inside the .deb.
-               See <manref name="deb" section="5">.
-           </footnote>.
-           The <prgn>config</prgn> script might be run before the
-           <prgn>preinst</prgn> 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
-           <em>essential</em> packages.<footnote>
+           Specification may contain the additional control information
+           files <file>config</file>
+           and <file>templates</file>.  <file>config</file> is an
+           additional maintainer script used for package configuration,
+           and <file>templates</file> contains templates used for user
+           prompting.  The <prgn>config</prgn> script might be run before
+           the <prgn>preinst</prgn> 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 <em>essential</em> packages.<footnote>
                  <package>Debconf</package> or another tool that
                  implements the Debian Configuration Management
                  Specification will also be installed, and any
                The <tt>build</tt> 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
                A package may also provide both of the targets
                <tt>build-arch</tt> and <tt>build-indep</tt>.
                The <tt>build-arch</tt> 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
-               <tt>Architecture</tt> field in <tt>debian/control</tt>
-               is not <tt>all</tt>).
-               Similarly, the <tt>build-indep</tt> 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
-               <tt>Architecture</tt> field in <tt>debian/control</tt>
-               is <tt>all</tt>).
+               <tt>Architecture</tt> field in <tt>debian/control</tt> is
+               not <tt>all</tt>).  Similarly, the <tt>build-indep</tt>
+               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 <tt>Architecture</tt> field
+               in <tt>debian/control</tt> is <tt>all</tt>).
                The <tt>build</tt> target should depend on those of the
                targets <tt>build-arch</tt> and <tt>build-indep</tt> that
-               are provided in the rules file.
+               are provided in the rules file.<footnote>
+                 The intent of this split is so that binary-only builds
+                 need not install the dependencies required for
+                 the <tt>build-indep</tt> target.  However, this is not
+                 yet used in practice since <tt>dpkg-buildpackage
+                 -B</tt>, and therefore the autobuilders,
+                 invoke <tt>build</tt> rather than <tt>build-arch</tt>
+                 due to the difficulties in determining whether the
+                 optional <tt>build-arch</tt> target exists.
+               </footnote>
              </p>
 
              <p>
@@ -2185,16 +2218,16 @@ endif
        <heading>Variable substitutions: <file>debian/substvars</file></heading>
 
        <p>
-         When <prgn>dpkg-gencontrol</prgn>,
-         <prgn>dpkg-genchanges</prgn> and <prgn>dpkg-source</prgn>
-         generate control files they perform variable substitutions
-         on their output just before writing it.  Variable
+         When <prgn>dpkg-gencontrol</prgn>
+         generates <qref id="binarycontrolfiles">binary package control
+         files</qref> (<file>DEBIAN/control</file>), it performs variable
+         substitutions on its output just before writing it.  Variable
          substitutions have the form <tt>${<var>variable</var>}</tt>.
          The optional file <file>debian/substvars</file> contains
          variable substitutions to be used; variables can also be set
          directly from <file>debian/rules</file> using the <tt>-V</tt>
-         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.
        </p>
 
        <p>
@@ -2213,12 +2246,12 @@ endif
         <heading>Optional upstream source location: <file>debian/watch</file></heading>
 
         <p>
-          This is an optional, recommended control file for the
-          <tt>uscan</tt> utility which defines how to automatically
-          scan ftp or http sites for newly available updates of the
-          package. This is used by <url id="
-          http://dehs.alioth.debian.org/"> and other Debian QA tools
-          to help with quality control and maintenance of the
+          This is an optional, recommended configuration file for the
+          <tt>uscan</tt> utility which defines how to automatically scan
+          ftp or http sites for newly available updates of the
+          package. This is used
+          by <url id="http://dehs.alioth.debian.org/"> and other Debian QA
+          tools to help with quality control and maintenance of the
           distribution as a whole.
         </p>
 
@@ -2398,8 +2431,8 @@ Package: libc6
        </p>
 
        <p>
-         Each paragraph may contain at most one instance of a particular
-         field name.
+         A paragraph must not contain more than one instance of a
+         particular field name.
        </p>
 
        <p>
@@ -2486,13 +2519,11 @@ Package: libc6
          The syntax and semantics of the fields are described below.
        </p>
 
-<!-- stuff -->
-
        <p>
          These fields are used by <prgn>dpkg-gencontrol</prgn> to
          generate control files for binary packages (see below), by
          <prgn>dpkg-genchanges</prgn> to generate the
-         <tt>.changes</tt> file to accompany the upload, and by
+         <file>.changes</file> file to accompany the upload, and by
          <prgn>dpkg-source</prgn> when it creates the
          <file>.dsc</file> source control file as part of a source
          archive. Many fields are permitted to span multiple lines in
@@ -2526,7 +2557,8 @@ Package: libc6
 
        <p>
          The <file>DEBIAN/control</file> 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.
        </p>
 
        <p>
@@ -2553,23 +2585,24 @@ Package: libc6
        <heading>Debian source control files -- <tt>.dsc</tt></heading>
 
        <p>
-         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 <ref id="pkg-controlfields">.
+         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 <ref id="pkg-controlfields">.
 
        <list compact="compact">
          <item><qref id="f-Format"><tt>Format</tt></qref> (mandatory)</item>
          <item><qref id="f-Source"><tt>Source</tt></qref> (mandatory)</item>
+         <item><qref id="f-Binary"><tt>Binary</tt></qref></item>
+         <item><qref id="f-Architecture"><tt>Architecture</tt></qref></item>
          <item><qref id="f-Version"><tt>Version</tt></qref> (mandatory)</item>
          <item><qref id="f-Maintainer"><tt>Maintainer</tt></qref> (mandatory)</item>
          <item><qref id="f-Uploaders"><tt>Uploaders</tt></qref></item>
-         <item><qref id="f-Binary"><tt>Binary</tt></qref></item>
-         <item><qref id="f-Architecture"><tt>Architecture</tt></qref></item>
-          <item><qref id="sourcebinarydeps"><tt>Build-Depends</tt> et al</qref></item>
+         <item><qref id="f-Homepage"><tt>Homepage</tt></qref></item>
          <item><qref id="f-Standards-Version"><tt>Standards-Version</tt></qref> (recommended)</item>
+         <item><qref id="sourcebinarydeps"><tt>Build-Depends</tt> et al</qref></item>
+         <item><qref id="f-Checksums"><tt>Checksums-Sha1</tt>
+             and <tt>Checksums-Sha256</tt></qref> (recommended)</item>
          <item><qref id="f-Files"><tt>Files</tt></qref> (mandatory)</item>
-         <item><qref id="f-Homepage"><tt>Homepage</tt></qref></item>
        </list>
        </p>
 
@@ -2588,12 +2621,19 @@ Package: libc6
        <heading>Debian changes files -- <file>.changes</file></heading>
 
        <p>
-         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
-         <tt>debian/control</tt> file and other data about the
-         source package gathered via <tt>debian/changelog</tt>
-         and <tt>debian/rules</tt>.
+         The <file>.changes</file> 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
+         <file>debian/control</file> file and other data about the
+         source package gathered via <file>debian/changelog</file>
+         and <file>debian/rules</file>.
+       </p>
+
+       <p>
+         <file>.changes</file> files have a format version that is
+         incremented whenever the documented fields or their meaning
+         change.  This document describes format &changesversion;.
        </p>
 
        <p>
@@ -2613,6 +2653,8 @@ Package: libc6
            <item><qref id="f-Description"><tt>Description</tt></qref> (mandatory)</item>
            <item><qref id="f-Closes"><tt>Closes</tt></qref></item>
            <item><qref id="f-Changes"><tt>Changes</tt></qref> (mandatory)</item>
+           <item><qref id="f-Checksums"><tt>Checksums-Sha1</tt>
+               and <tt>Checksums-Sha256</tt></qref> (recommended)</item>
            <item><qref id="f-Files"><tt>Files</tt></qref> (mandatory)</item>
          </list>
        </p>
@@ -2663,8 +2705,8 @@ Package: libc6
 
          <p>
            The package maintainer's name and email address.  The name
-           should come first, then the email address inside angle
-           brackets <tt>&lt;&gt</tt> (in RFC822 format).
+           must come first, then the email address inside angle
+           brackets <tt>&lt;&gt;</tt> (in RFC822 format).
          </p>
 
          <p>
@@ -2681,17 +2723,17 @@ Package: libc6
        <sect1 id="f-Uploaders">
           <heading><tt>Uploaders</tt></heading>
 
-          <p>
-            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 
-            <qref id="f-Maintainer">Maintainer field</qref>, 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.
-          </p>
+         <p>
+           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
+           <qref id="f-Maintainer">Maintainer field</qref>, 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.
+         </p>
+
          <p>
            Any parser that interprets the Uploaders field in
            <file>debian/control</file> must permit it to span multiple
@@ -2705,9 +2747,10 @@ Package: libc6
          <heading><tt>Changed-By</tt></heading>
 
          <p>
-           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 <qref id="f-Maintainer">Maintainer
+           field</qref>.
          </p>
        </sect1>
 
@@ -3017,9 +3060,10 @@ Package: libc6
                  It is optional; if it isn't present then the
                  <var>upstream_version</var> 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.
                </p>
 
                <p>
@@ -3248,12 +3292,30 @@ Package: libc6
          <heading><tt>Format</tt></heading>
 
          <p>
-           This field specifies a format revision for the file.
-           The most current format described in the Policy Manual
-           is version <strong>1.5</strong>.  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 <ref id="f-Version">.
+           In <qref id="debianchangesfiles"><file>.changes</file></qref>
+           files, this field declares the format version of that file.
+           The syntax of the field value is the same as that of
+           a <qref id="f-Version">package version number</qref> except
+           that no epoch or Debian revision is allowed.  The format
+           described in this document is <tt>&changesversion;</tt>.
+         </p>
+
+         <p>
+           In <qref id="debiansourcecontrolfiles"><file>.dsc</file>
+           Debian source control</qref> 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.
+           <footnote>
+             The source formats currently supported by the Debian archive
+             software are <tt>1.0</tt>, <tt>3.0 (native)</tt>,
+             and <tt>3.0 (quilt)</tt>.
+           </footnote>
          </p>
        </sect1>
 
@@ -3470,6 +3532,50 @@ Files:
          </p>
        </sect1>
 
+       <sect1 id="f-Checksums">
+         <heading><tt>Checksums-Sha1</tt>
+           and <tt>Checksums-Sha256</tt></heading>
+
+         <p>
+           These fields contain a list of files with a checksum and size
+           for each one.  Both <tt>Checksums-Sha1</tt>
+           and <tt>Checksums-Sha256</tt> have the same syntax and differ
+           only in the checksum algorithm used: SHA-1
+           for <tt>Checksums-Sha1</tt> and SHA-256
+           for <tt>Checksums-Sha256</tt>.
+         </p>
+
+         <p>
+           <tt>Checksums-Sha1</tt> and <tt>Checksums-Sha256</tt> are
+           multiline fields.  The first line of the field value (the part
+           on the same line as <tt>Checksums-Sha1:</tt>
+           or <tt>Checksums-Sha256:</tt>) 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 <file>.changes</file> file):
+           <example>
+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
+           </example>
+         </p>
+
+         <p>
+           In the <file>.dsc</file> file, these fields should list all
+           files that make up the source package.  In
+           the <file>.changes</file> file, these fields should list all
+           files being uploaded.  The list of files in these fields
+           must match the list of files in the <tt>Files</tt> field.
+         </p>
+       </sect1>
       </sect>
 
       <sect>
@@ -3532,12 +3638,11 @@ Files:
        </p>
 
        <p>
-         These scripts are the files <prgn>preinst</prgn>,
-         <prgn>postinst</prgn>, <prgn>prerm</prgn> and
-         <prgn>postrm</prgn> 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
-         <tt>#!</tt> convention.  They should be readable and
+         These scripts are the control information
+         files <prgn>preinst</prgn>, <prgn>postinst</prgn>, <prgn>prerm</prgn>
+         and <prgn>postrm</prgn>.  They must be proper executable files;
+         if they are scripts (which is recommended), they must start with
+         the usual <tt>#!</tt> convention.  They should be readable and
          executable by anyone, and must not be world-writable.
        </p>
 
@@ -3552,12 +3657,12 @@ Files:
          they exit with a zero status if everything went well.
        </p>
 
-        <p>
-          Additionally, packages interacting with users using
-          <tt>debconf</tt> in the <prgn>postinst</prgn> script should
-          install a <prgn>config</prgn> script  in the control area,
-          see <ref id="maintscriptprompt"> for details.
-        </p>
+       <p>
+         Additionally, packages interacting with users
+         using <prgn>debconf</prgn> in the <prgn>postinst</prgn> script
+         should install a <prgn>config</prgn> script as a control
+         information file.  See <ref id="maintscriptprompt"> for details.
+       </p>
 
        <p>
          When a package is upgraded a combination of the scripts from
@@ -4233,7 +4338,7 @@ Files:
           In the <tt>Depends</tt>, <tt>Recommends</tt>,
           <tt>Suggests</tt>, <tt>Pre-Depends</tt>,
           <tt>Build-Depends</tt> and <tt>Build-Depends-Indep</tt>
-          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 <tt>|</tt>.  In such a case,
@@ -4287,21 +4392,24 @@ Depends: libc6 (>= 2.2.1), exim | mail-transport-agent
        </p>
 
         <p>
-          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.)
+       </p>
+
+       <p>
+         For build relationship fields
          (<tt>Build-Depends</tt>, <tt>Build-Depends-Indep</tt>,
-         <tt>Build-Conflicts</tt> and <tt>Build-Conflicts-Indep</tt>)
-         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.
+         <tt>Build-Conflicts</tt> and <tt>Build-Conflicts-Indep</tt>), 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.
        </p>
 
        <p>
@@ -4317,6 +4425,29 @@ Build-Depends: kernel-headers-2.2.10 [!hurd-i386],
          <tt>gnumach-dev</tt> only on hurd-i386.
        </p>
 
+       <p>
+         For binary relationship fields, the architecture restriction
+         syntax is only supported in the source package control
+         file <file>debian/control</file>.  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
+         (<tt>Architecture: all</tt>).
+       </p>
+
+       <p>
+         For example:
+         <example compact="compact">
+Depends: foo [i386], bar [amd64]
+         </example>
+         becomes <tt>Depends: foo</tt> when the package is built on
+         the <tt>i386</tt> architecture, <tt>Depends: bar</tt> when the
+         package is built on the <tt>amd64</tt> architecture, and omitted
+         entirely in binary packages built on all other architectures.
+       </p>
+
        <p>
          If the architecture-restricted dependency is part of a set of
          alternatives using <tt>|</tt>, that alternative is ignored
@@ -4331,11 +4462,11 @@ Build-Depends: foo [!i386] | bar [!amd64]
        </p>
 
         <p>
-         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:
           <example compact="compact">
 Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any]
           </example>
@@ -4371,7 +4502,7 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any]
         <p>
           This is done using the <tt>Depends</tt>, <tt>Pre-Depends</tt>,
           <tt>Recommends</tt>, <tt>Suggests</tt>, <tt>Enhances</tt>,
-          <tt>Breaks</tt> and <tt>Conflicts</tt> control file fields.
+          <tt>Breaks</tt> and <tt>Conflicts</tt> control fields.
           <tt>Breaks</tt> is described in <ref id="breaks">, and
           <tt>Conflicts</tt> is described in <ref id="conflicts">.  The
           rest are described below.
@@ -4586,17 +4717,29 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any]
        <p>
          Normally a <tt>Breaks</tt> entry will have an "earlier than"
          version clause; such a <tt>Breaks</tt> 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 <tt>Breaks</tt> 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 <tt>Breaks</tt>.  This use of <tt>Breaks</tt>
+         will inform higher-level package management tools that the
+         broken package must be upgraded before the new one.
        </p>
 
        <p>
          If the breaking package also overwrites some files from the
-         older package, it should use <tt>Replaces</tt> (not
-         <tt>Conflicts</tt>) to ensure this goes smoothly.
+         older package, it should use <tt>Replaces</tt> to ensure this
+         goes smoothly.  See <ref id="replaces"> for a full discussion
+         of taking over files from other packages, including how to
+         use <tt>Breaks</tt> in those cases.
+       </p>
+
+       <p>
+         Many of the cases where <tt>Breaks</tt> should be used were
+         previously handled with <tt>Conflicts</tt>
+         because <tt>Breaks</tt> did not yet exist.
+         Many <tt>Conflicts</tt> fields should now be <tt>Breaks</tt>.
+         See <ref id="conflicts"> for more information about the
+         differences.
        </p>
       </sect>
 
@@ -4607,21 +4750,24 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any]
           When one binary package declares a conflict with another
          using a <tt>Conflicts</tt> field, <prgn>dpkg</prgn> will
          refuse to allow them to be installed on the system at the
-         same time.
+         same time.  This is a stronger restriction than <tt>Breaks</tt>,
+         which just prevents both packages from being configured at the
+         same time.  Conflicting packages cannot be unpacked on the
+         system at the same time.
        </p>
 
        <p>
          If one package is to be installed, the other must be removed
-         first - if the package being installed is marked as
-         replacing (see <ref id="replaces">) the one on the system,
-         or the one on the system is marked as deselected, or both
-         packages are marked <tt>Essential</tt>, then
-         <prgn>dpkg</prgn> 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 <tt>Essential</tt>, but the new
-         package is not.
+         first.  If the package being installed is marked as replacing
+         (see <ref id="replaces">, but note that <tt>Breaks</tt> 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 <tt>Essential</tt>, then <prgn>dpkg</prgn> 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 <tt>Essential</tt>, but the
+         new package is not.
        </p>
 
        <p>
@@ -4641,12 +4787,61 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any]
        </p>
 
        <p>
-         A <tt>Conflicts</tt> entry should almost never have an
-         "earlier than" version clause.  This would prevent
-         <prgn>dpkg</prgn> 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,
-         <tt>Breaks</tt> may be used.
+         Normally, <tt>Breaks</tt> should be used instead
+         of <tt>Conflicts</tt> since <tt>Conflicts</tt> 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.  <tt>Breaks</tt> should be used
+         <list>
+           <item>when moving a file from one package to another (see
+             <ref id="replaces">),</item>
+           <item>when splitting a package (a special case of the previous
+             one), or</item>
+           <item>when the breaking package exposes a bug in or interacts
+             badly with particular versions of the broken
+             package.</item>
+         </list>
+         <tt>Conflicts</tt> should be used
+         <list>
+           <item>when two packages provide the same file and will
+             continue to do so,</item>
+           <item>in conjunction with <tt>Provides</tt> when only one
+             package providing a given virtual facility may be installed
+             at a time (see <ref id="virtual">),</item>
+           <item>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.</item>
+         </list>
+         Be aware that adding <tt>Conflicts</tt> 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, <ref id="binaries">.
+       </p>
+
+       <p>
+         Neither <tt>Breaks</tt> nor <tt>Conflicts</tt> 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 <tt>Breaks</tt> or <tt>Conflicts</tt> with that package.
+       </p>
+
+       <p>
+         A <tt>Conflicts</tt> 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 <tt>Breaks</tt> should have been used instead.  An "earlier
+         than" version clause in <tt>Conflicts</tt>
+         prevents <prgn>dpkg</prgn> 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.
        </p>
       </sect>
 
@@ -4665,11 +4860,10 @@ Build-Depends: foo [linux-any], bar [any-i386], baz [!linux-any]
 
        <p>
          A <em>virtual package</em> is one which appears in the
-         <tt>Provides</tt> 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 <ref
-           id="virtual_pkg">)
+         <tt>Provides</tt> 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 <ref id="virtual_pkg">)
        </p>
 
        <p>
@@ -4693,59 +4887,103 @@ Provides: bar
        </p>
 
        <p>
-         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 <tt>Provides</tt> 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 <tt>Provides</tt> 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 <tt>Provides</tt>
+         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.<footnote>
+           It is possible that a future release of <prgn>dpkg</prgn> 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.
+         </footnote>
        </p>
 
        <p>
-         It is likely that the ability will be added in a future
-         release of <prgn>dpkg</prgn> 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.
        </p>
 
        <p>
-         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 <package>mail-transport-agent</package> virtual package that
+         requires installation of a binary that would conflict with all
+         other providers of that virtual package (see
+         <ref id="mail-transport-agents">), all packages providing that
+         virtual package should also declare a conflict with it
+         using <tt>Conflicts</tt>.  This will ensure that at most one
+         provider of that virtual package is unpacked or installed at a
+         time.
        </p>
       </sect>
 
-
       <sect id="replaces"><heading>Overwriting files and replacing
          packages - <tt>Replaces</tt></heading>
 
        <p>
           Packages can declare in their control file that they should
-          overwrite files in certain other packages, or completely
-          replace other packages. The <tt>Replaces</tt> control file
-          field has these two distinct purposes.
+          overwrite files in certain other packages, or completely replace
+          other packages. The <tt>Replaces</tt> control field has these
+          two distinct purposes.
        </p>
 
        <sect1><heading>Overwriting files in other packages</heading>
 
          <p>
-           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 <tt>Replaces</tt> the one
+           containing the file being overwritten, then <prgn>dpkg</prgn>
+           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, <tt>Breaks</tt> should be used in conjunction
+           with <tt>Replaces</tt>.<footnote>
+             To see why <tt>Breaks</tt> is normally needed in addition
+             to <tt>Replaces</tt>, consider the case of a file in the
+             package <package>foo</package> being taken over by the
+             package <package>foo-data</package>.
+             <tt>Replaces</tt> will allow <package>foo-data</package> to
+             be installed and take over that file.  However,
+             without <tt>Breaks</tt>, nothing
+             requires <package>foo</package> to be upgraded to a newer
+             version that knows it does not include that file and instead
+             depends on <package>foo-data</package>.  Nothing would
+             prevent the new <package>foo-data</package> package from
+             being installed and then removed, removing the file that it
+             took over from <package>foo</package>.  After that
+             operation, the package manager would think the system was in
+             a consistent state, but the <package>foo</package> package
+             would be missing one of its files.
+           </footnote>
          </p>
 
          <p>
-           However, if the overwriting package declares that it
-           <tt>Replaces</tt> the one containing the file being
-           overwritten, then <prgn>dpkg</prgn> 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 <package>foo</package> is split
+           into <package>foo</package> and <package>foo-data</package>
+           starting at version 1.2-3, <package>foo-data</package> would
+           have the fields
+           <example compact="compact">
+Replaces: foo (&lt;&lt; 1.2-3)
+Breaks: foo (&lt;&lt; 1.2-3)
+           </example>
+           in its control file.  The new version of the
+           package <package>foo</package> would normally have the field
+           <example compact="compact">
+Depends: foo-data (&gt;= 1.2-3)
+           </example>
+           (or possibly <tt>Recommends</tt> or even <tt>Suggests</tt> if
+           the files moved into <package>foo-data</package> are not
+           required for normal operation).
          </p>
 
          <p>
@@ -4760,40 +4998,35 @@ Provides: bar
            special argument to allow the package to do any final
            cleanup required.  See <ref id="mscriptsinstact">.
            <footnote>
-             <p>
-               Replaces is a one way relationship -- you have to              
-               install the replacing package after the replaced
-               package.
-             </p>
+             Replaces is a one way relationship.  You have to install
+             the replacing package after the replaced package.
            </footnote>
          </p>
 
          <p>
            For this usage of <tt>Replaces</tt>, virtual packages (see
            <ref id="virtual">) are not considered when looking at a
-           <tt>Replaces</tt> field - the packages declared as being
+           <tt>Replaces</tt> field.  The packages declared as being
            replaced must be mentioned by their real names.
          </p>
 
          <p>
-           Furthermore, this usage of <tt>Replaces</tt> 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 <tt>Replaces</tt> 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.
          </p>
-
        </sect1>
 
        <sect1><heading>Replacing whole packages, forcing their
            removal</heading>
 
          <p>
-           Secondly, <tt>Replaces</tt> allows the packaging system to
+           Second, <tt>Replaces</tt> allows the packaging system to
            resolve which package should be removed when there is a
-           conflict - see <ref id="conflicts">.  This usage only
-           takes effect when the two packages <em>do</em> conflict,
-           so that the two usages of this field do not interfere with
-           each other.
+           conflict (see <ref id="conflicts">).  This usage only takes
+           effect when the two packages <em>do</em> conflict, so that the
+           two usages of this field do not interfere with each other.
          </p>
 
          <p>
@@ -4807,7 +5040,8 @@ Conflicts: mail-transport-agent
 Replaces: mail-transport-agent
            </example>
            ensuring that only one MTA can be installed at any one
-           time.
+           time.  See <ref id="virtual"> for more information about this
+           example.
        </sect1>
       </sect>
 
@@ -4826,7 +5060,7 @@ Replaces: mail-transport-agent
         <p>
           This is done using the <tt>Build-Depends</tt>,
           <tt>Build-Depends-Indep</tt>, <tt>Build-Conflicts</tt> and
-          <tt>Build-Conflicts-Indep</tt> control file fields.
+          <tt>Build-Conflicts-Indep</tt> control fields.
         </p>
 
         <p>
@@ -4838,58 +5072,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 <tt>debian/rules</tt>, as follows:<footnote>
-           <p>
-             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.
-           </p>
            <p>
              There is no Build-Depends-Arch; this role is essentially
-              met with Build-Depends.  Anyone building the
-              <tt>build-indep</tt> and binary-indep<tt></tt> targets
-              is basically assumed to be building the whole package
-              anyway and so installs all build dependencies.  The
-              autobuilders use <tt>dpkg-buildpackage -B</tt>, which
-              calls <tt>build</tt> (not <tt>build-arch</tt>, since it
-              does not yet know how to check for its existence) and
-              <tt>binary-arch</tt>.
+             met with Build-Depends.  Anyone building the
+             <tt>build-indep</tt> and <tt>binary-indep</tt> targets is
+             assumed to be building the whole package, and therefore
+             installation of all build dependencies is required.
            </p>
            <p>
-             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 <tt>dpkg-buildpackage -B</tt>, which
+             calls <tt>build</tt>, not <tt>build-arch</tt> since it does
+             not yet know how to check for its existence, and
+             <tt>binary-arch</tt>.  The purpose of the original split
+             between <tt>Build-Depends</tt> and
+             <tt>Build-Depends-Indep</tt> 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.
            </p>
          </footnote>
-
          <taglist>
-           <tag><tt>Build-Depends</tt>, <tt>Build-Conflicts</tt></tag>
+           <tag><tt>clean</tt>, <tt>build-arch</tt>, and
+             <tt>binary-arch</tt></tag>
            <item>
-                The <tt>Build-Depends</tt> and
-               <tt>Build-Conflicts</tt> fields must be satisfied when
-               any of the following targets is invoked:
-               <tt>build</tt>, <tt>clean</tt>, <tt>binary</tt>,
-               <tt>binary-arch</tt>, <tt>build-arch</tt>,
-               <tt>build-indep</tt> and <tt>binary-indep</tt>.
+             Only the <tt>Build-Depends</tt> and <tt>Build-Conflicts</tt>
+             fields must be satisfied when these targets are invoked.
            </item>
-           <tag><tt>Build-Depends-Indep</tt>,
-             <tt>Build-Conflicts-Indep</tt></tag>
+           <tag><tt>build</tt>, <tt>build-indep</tt>, <tt>binary</tt>,
+             and <tt>binary-indep</tt></tag>
            <item>
-                The <tt>Build-Depends-Indep</tt> and
-               <tt>Build-Conflicts-Indep</tt> fields must be
-               satisfied when any of the following targets is
-               invoked: <tt>build</tt>, <tt>build-indep</tt>,
-               <tt>binary</tt> and <tt>binary-indep</tt>.
+             The <tt>Build-Depends</tt>, <tt>Build-Conflicts</tt>,
+             <tt>Build-Depends-Indep</tt>, and
+             <tt>Build-Conflicts-Indep</tt> fields must be satisfied when
+             these targets are invoked.
            </item>
          </taglist>
        </p>
-
       </sect>
-
     </chapt>
 
 
@@ -4904,55 +5124,134 @@ Replaces: mail-transport-agent
       </p>
 
       <p>
-       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 <ref id="libraries"> 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.
       </p>
 
-      <sect id="sharedlibs-runtime">
-       <heading>Run-time shared libraries</heading>
+      <p>
+       A shared library is identified by the <tt>SONAME</tt> attribute
+       stored in its dynamic section.  When a binary is linked against a
+       shared library, the <tt>SONAME</tt> of the shared library is
+       recorded in the binary's <tt>NEEDED</tt> 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 <tt>SONAME</tt>) is
+       therefore normally not referenced directly.  Instead, the shared
+       library is loaded by its <tt>SONAME</tt>, 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.  <ref id="sharedlibs-runtime"> describes how to do this.
+       <footnote>
+         This is a convention of shared library versioning, but not a
+         requirement.  Some libraries use the <tt>SONAME</tt> 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 <tt>SONAME</tt> 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 <ref id="sharedlibs-runtime"> for
+         more information.
+       </footnote>
+      </p>
 
       <p>
-       The run-time shared library needs to be placed in a package
-        whose name changes whenever the shared object version
-        changes.<footnote>
-            <p>
-              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.</p>
-          </footnote>
-          The most common mechanism is to place it in a package
-        called
-        <package><var>libraryname</var><var>soversion</var></package>,
-        where <file><var>soversion</var></file> is the version number
-        in the soname of the shared library<footnote>
-             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
-             <file>libfoo.so.6</file>, the library package would be
-             called <file>libfoo6</file>.
-         </footnote>.
-       Alternatively, if it would be confusing to directly append
-       <var>soversion</var> to <var>libraryname</var> (e.g. because
-       <var>libraryname</var> itself ends in a number), you may use
-       <package><var>libraryname</var>-<var>soversion</var></package> and
-       <package><var>libraryname</var>-<var>soversion</var>-dev</package>
-       instead.
+       When linking a binary or another shared library against a shared
+       library, the <tt>SONAME</tt> for that shared library is not yet
+       known.  Instead, the shared library is found by looking for a file
+       matching the library name with <tt>.so</tt> appended.  This file
+       exists on the file system as a symlink pointing to the shared
+       library.
+      </p>
+
+      <p>
+       Shared libraries are normally split into several binary packages.
+       The <tt>SONAME</tt> symlink is installed by the runtime shared
+       library package, and the bare <tt>.so</tt> 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.
       </p>
 
       <p>
-       If you have several shared libraries built from the same
-       source tree you may lump them all together into a single
-       shared library package, provided that you change all of
-       their sonames at once (so that you don't get filename
-       clashes if you try to install different versions of the
-       combined shared libraries package).
+       This section is primarily concerned with how the separation of
+       shared libraries into multiple packages should be done and how
+       dependencies on and between shared library binary packages are
+       managed in Debian.  <ref id="libraries"> should be read in
+       conjunction with this section and contains additional rules for
+       the files contained in the shared library packages.
       </p>
 
+      <sect id="sharedlibs-runtime">
+       <heading>Run-time shared libraries</heading>
+
+       <p>
+         The run-time shared library must be placed in a package
+         whose name changes whenever the <tt>SONAME</tt> 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 <tt>SONAME</tt> symlink should
+         be placed in a package named
+         <package><var>libraryname</var><var>soversion</var></package>,
+         where <var>soversion</var> is the version number in
+         the <tt>SONAME</tt> of the shared library.
+         See <ref id="shlibs"> for detailed information on how to
+         determine this version.  Alternatively, if it would be confusing
+         to directly append <var>soversion</var>
+         to <var>libraryname</var> (if, for example, <var>libraryname</var>
+         itself ends in a number), you should use
+         <package><var>libraryname</var>-<var>soversion</var></package>
+         instead.
+       </p>
+
+       <p>
+         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 <tt>SONAME</tt>s will
+         always change together.  Be aware that this is not normally the
+         case, and if the <tt>SONAME</tt>s 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.
+       </p>
+
+       <p>
+         Every time the shared library ABI changes in a way that may
+         break binaries linked against older versions of the shared
+         library, the <tt>SONAME</tt> of the library and the
+         corresponding name for the binary package containing the runtime
+         shared library should change.  Normally, this means
+         the <tt>SONAME</tt> 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.
+       </p>
+
+       <p>
+         The <tt>SONAME</tt> 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 <qref id="sharedlibs-shlibdeps"><tt>shlibs</tt>
+         system</qref> or via symbols files (see
+         <manref name="deb-symbols" section="5">).
+       </p>
+
       <p>
        The package should install the shared libraries under
        their normal names.  For example, the <package>libgdbm3</package>
@@ -4972,10 +5271,11 @@ Replaces: mail-transport-agent
       </p>
 
       <p>
-       The run-time library package should include the symbolic link that
-       <prgn>ldconfig</prgn> would create for the shared libraries.
-       For example, the <package>libgdbm3</package> package should include
-       a symbolic link from <file>/usr/lib/libgdbm.so.3</file> to
+       The run-time library package should include the symbolic link for
+       the <tt>SONAME</tt> that <prgn>ldconfig</prgn> would create for
+       the shared libraries.  For example,
+       the <package>libgdbm3</package> package should include a symbolic
+       link from <file>/usr/lib/libgdbm.so.3</file> to
        <file>libgdbm.so.3.0.0</file>.  This is needed so that the dynamic
        linker (for example <prgn>ld.so</prgn> or
        <prgn>ld-linux.so.*</prgn>) can find the library between the
@@ -5161,11 +5461,20 @@ Replaces: mail-transport-agent
        <heading>Development files</heading>
 
       <p>
-       The development files associated to a shared library need to be
-       placed in a package called
-       <package><var>libraryname</var><var>soversion</var>-dev</package>,
+       If there are development files associated with a shared library,
+       the source package needs to generate a binary development package
+       named <package><var>libraryname</var><var>soversion</var>-dev</package>,
        or if you prefer only to support one development version at a
-       time, <package><var>libraryname</var>-dev</package>.
+       time, <package><var>libraryname</var>-dev</package>.  Installing
+       the development package must result in installation of all the
+       development files necessary for compiling programs against that
+       shared library.<footnote>
+         This wording allows the development files to be split into
+         several packages, such as a separate architecture-independent
+         <package><var>libraryname</var>-headers</package>, provided that
+         the development package depends on all the required additional
+         packages.
+       </footnote>
       </p>
 
       <p>
@@ -5186,6 +5495,14 @@ Replaces: mail-transport-agent
        (<prgn>ld</prgn>) when compiling packages, as it will only look for
        <file>libgdbm.so</file> when compiling dynamically.
       </p>
+
+      <p>
+       If the package provides Ada Library Information
+       (<file>*.ali</file>) 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 <ref id="permissions-owners">.
+      </p>
       </sect>
 
       <sect id="sharedlibs-intradeps">
@@ -5224,59 +5541,49 @@ Replaces: mail-transport-agent
        </p>
 
        <p>
-         Thus, when a package is built which contains any shared
-         libraries, it must provide a <file>shlibs</file> 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 <file>shlibs</file> file for other packages to
+         use.  When a package is built which contains any shared
+         libraries or compiled binaries, it must run
          <qref id="pkg-dpkg-shlibdeps"><prgn>dpkg-shlibdeps</prgn></qref>
          on these to determine the libraries used and hence the
          dependencies needed by this package.<footnote>
            <p>
-             In the past, the shared libraries linked to were
-             determined by calling <prgn>ldd</prgn>, but now
-             <prgn>objdump</prgn> is used to do this.  The only
-             change this makes to package building is that
-             <prgn>dpkg-shlibdeps</prgn> 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.
+             <prgn>dpkg-shlibdeps</prgn> will use a program
+             like <prgn>objdump</prgn> or <prgn>readelf</prgn> to find
+             the libraries directly needed by the binaries or shared
+             libraries in the package.
            </p>
 
            <p>
              We say that a binary <tt>foo</tt> <em>directly</em> uses
              a library <tt>libbar</tt> if it is explicitly linked
-             with that library (that is, it uses the flag
-             <tt>-lbar</tt> during the linking stage).  Other
+             with that library (that is, the library is listed in the ELF
+             <tt>NEEDED</tt> attribute, caused by adding <tt>-lbar</tt>
+             to the link line when the binary is created).  Other
              libraries that are needed by <tt>libbar</tt> are linked
              <em>indirectly</em> to <tt>foo</tt>, and the dynamic
              linker will load them automatically when it loads
-             <tt>libbar</tt>.  A package should depend on
-             the libraries it directly uses, and the dependencies for
-             those libraries should automatically pull in the other
-             libraries.
-           </p>
-
-           <p>
-             Unfortunately, the <prgn>ldd</prgn> program shows both
-             the directly and indirectly used libraries, meaning that
-             the dependencies determined included both direct and
-             indirect dependencies.  The use of <prgn>objdump</prgn>
-             avoids this problem by determining only the directly
-             used libraries.
+             <tt>libbar</tt>.  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.
            </p>
 
            <p>
              A good example of where this helps is the following.  We
              could update <tt>libimlib</tt> with a new version that
-             supports a new graphics format called dgf (but retaining
-             the same major version number).  If we used the old
-             <prgn>ldd</prgn> method, every package that uses
-             <tt>libimlib</tt> would need to be recompiled so it
-             would also depend on <tt>libdgf</tt> or it wouldn't run
-             due to missing symbols.  However with the new system,
-             packages using <tt>libimlib</tt> can rely on
-             <tt>libimlib</tt> itself having the dependency on
-             <tt>libdgf</tt> and so they would not need rebuilding.
+             supports a new graphics format called dgf (but retaining the
+             same major version number) and depends on <tt>libdgf</tt>.
+             If we used <prgn>ldd</prgn> to add dependencies for every
+             library directly or indirectly linked with a binary, every
+             package that uses <tt>libimlib</tt> would need to be
+             recompiled so it would also depend on <tt>libdgf</tt> or it
+             wouldn't run due to missing symbols.  Since dependencies are
+             only added based on ELF <tt>NEEDED</tt> attribute, packages
+             using <tt>libimlib</tt> can rely on <tt>libimlib</tt> itself
+             having the dependency on <tt>libdgf</tt> and so they would
+             not need rebuilding.
            </p>
          </footnote>
        </p>
@@ -5306,8 +5613,13 @@ Replaces: mail-transport-agent
              <p><file>debian/shlibs.local</file></p>
 
              <p>
-               This lists overrides for this package.  Its use is
-               described below (see <ref id="shlibslocal">).
+               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 <file>shlibs</file> file for
+               a library cannot be used.  This file overrides information
+               obtained from any other source.
              </p>
            </item>
 
@@ -5325,38 +5637,34 @@ Replaces: mail-transport-agent
              <p><file>DEBIAN/shlibs</file> files in the "build directory"</p>
 
              <p>
-               When packages are being built, any
-               <file>debian/shlibs</file> files are copied into the
-               control file area of the temporary build directory and
-               given the name <file>shlibs</file>.  These files give
-               details of any shared libraries included in the
-               package.<footnote>
-                   An example may help here.  Let us say that the
-                   source package <tt>foo</tt> generates two binary
-                   packages, <tt>libfoo2</tt> and
-                   <tt>foo-runtime</tt>.  When building the binary
-                   packages, the two packages are created in the
-                   directories <file>debian/libfoo2</file> and
-                   <file>debian/foo-runtime</file> respectively.
-                   (<file>debian/tmp</file> could be used instead of one
-                   of these.)  Since <tt>libfoo2</tt> provides the
-                   <tt>libfoo</tt> shared library, it will require a
-                   <tt>shlibs</tt> file, which will be installed in
-                   <file>debian/libfoo2/DEBIAN/shlibs</file>, eventually
-                   to become
-                   <file>/var/lib/dpkg/info/libfoo2.shlibs</file>.  Then
-                   when <prgn>dpkg-shlibdeps</prgn> is run on the
-                   executable
-                   <file>debian/foo-runtime/usr/bin/foo-prog</file>, it
-                   will examine the
-                   <file>debian/libfoo2/DEBIAN/shlibs</file> file to
-                   determine whether <tt>foo-prog</tt>'s library
-                   dependencies are satisfied by any of the libraries
-                   provided by <tt>libfoo2</tt>.  For this reason,
-                   <prgn>dpkg-shlibdeps</prgn> must only be run once
-                   all of the individual binary packages'
-                   <tt>shlibs</tt> files have been installed into the
-                   build directory.
+               When packages are being built,
+               any <file>debian/shlibs</file> files are copied into the
+               control information file area of the temporary build
+               directory and given the name <file>shlibs</file>.  These
+               files give details of any shared libraries included in the
+               same package.<footnote>
+                 An example may help here.  Let us say that the source
+                 package <tt>foo</tt> generates two binary
+                 packages, <tt>libfoo2</tt> and <tt>foo-runtime</tt>.
+                 When building the binary packages, the two packages are
+                 created in the directories <file>debian/libfoo2</file>
+                 and <file>debian/foo-runtime</file> respectively.
+                 (<file>debian/tmp</file> could be used instead of one of
+                 these.)  Since <tt>libfoo2</tt> provides the
+                 <tt>libfoo</tt> shared library, it will require a
+                 <tt>shlibs</tt> file, which will be installed in
+                 <file>debian/libfoo2/DEBIAN/shlibs</file>, eventually to
+                 become <file>/var/lib/dpkg/info/libfoo2.shlibs</file>.
+                 When <prgn>dpkg-shlibdeps</prgn> is run on the
+                 executable <file>debian/foo-runtime/usr/bin/foo-prog</file>,
+                 it will examine
+                 the <file>debian/libfoo2/DEBIAN/shlibs</file> file to
+                 determine whether <tt>foo-prog</tt>'s library
+                 dependencies are satisfied by any of the libraries
+                 provided by <tt>libfoo2</tt>.  For this reason,
+                 <prgn>dpkg-shlibdeps</prgn> must only be run once all of
+                 the individual binary packages' <tt>shlibs</tt> files
+                 have been installed into the build directory.
                </footnote>
              </p>
            </item>
@@ -5402,10 +5710,9 @@ dpkg-shlibdeps debian/tmp/usr/bin/* debian/tmp/usr/sbin/* \
          </example>
          Otherwise, you will need to explicitly list the compiled
          binaries and libraries.<footnote>
-             If you are using <tt>debhelper</tt>, the
-             <prgn>dh_shlibdeps</prgn> program will do this work for
-             you.  It will also correctly handle multi-binary
-             packages.
+           If you are using <tt>debhelper</tt>, the
+           <prgn>dh_shlibdeps</prgn> program will do this work for you.
+           It will also correctly handle multi-binary packages.
          </footnote>
        </p>
 
@@ -5417,13 +5724,6 @@ dpkg-shlibdeps debian/tmp/usr/bin/* debian/tmp/usr/sbin/* \
          field in the control file for this to work.
        </p>
 
-       <p>
-         If <prgn>dpkg-shlibdeps</prgn> doesn't complain, you're
-         done.  If it does complain you might need to create your own
-         <file>debian/shlibs.local</file> file, as explained below (see
-         <ref id="shlibslocal">).
-       </p>
-
        <p>
          If you have multiple binary packages, you will need to call
          <prgn>dpkg-shlibdeps</prgn> on each one which contains
@@ -5437,16 +5737,17 @@ dpkg-shlibdeps debian/tmp/usr/bin/* debian/tmp/usr/sbin/* \
          you will need to specify that <prgn>dpkg-shlibdeps</prgn>
          should use the dependency line of type <tt>udeb</tt> by
          adding the <tt>-tudeb</tt> option<footnote>
-             <prgn>dh_shlibdeps</prgn> from the <tt>debhelper</tt> suite
-             will automatically add this option if it knows it is
-             processing a udeb.
-         </footnote>. If there is no dependency line of type <tt>udeb</tt>
-         in the <file>shlibs</file> file, <prgn>dpkg-shlibdeps</prgn> will
-         fall back to the regular dependency line.
+           <prgn>dh_shlibdeps</prgn> from the <tt>debhelper</tt> suite
+           will automatically add this option if it knows it is
+           processing a udeb.
+         </footnote>. If there is no dependency line of
+         type <tt>udeb</tt> in the <file>shlibs</file>
+         file, <prgn>dpkg-shlibdeps</prgn> will fall back to the regular
+         dependency line.
        </p>
 
        <p>
-         For more details on dpkg-shlibdeps, please see
+         For more details on <prgn>dpkg-shlibdeps</prgn>, please see
          <ref id="pkg-dpkg-shlibdeps"> and
          <manref name="dpkg-shlibdeps" section="1">.
        </p>
@@ -5490,13 +5791,17 @@ dpkg-shlibdeps debian/tmp/usr/bin/* debian/tmp/usr/sbin/* \
          usually of the form
          <tt><var>name</var>.so.<var>major-version</var></tt>, in our
          example, <tt>libz.so.1</tt>.<footnote>
-             This can be determined using the command
-             <example compact="compact">
+           This can be determined using the command
+           <example compact="compact">
 objdump -p /usr/lib/libz.so.1.1.3 | grep SONAME
-             </example>
+           </example>
          </footnote>
          The version part is the part which comes after
-         <tt>.so.</tt>, so in our case, it is <tt>1</tt>.
+         <tt>.so.</tt>, so in our case, it is <tt>1</tt>.  The soname may
+         instead be of the form
+         <tt><var>name</var>-<var>major-version</var>.so</tt>, such
+         as <tt>libdb-4.8.so</tt>, in which case the name would
+         be <tt>libdb</tt> and the version would be <tt>4.8</tt>.
        </p>
 
        <p>
@@ -5538,7 +5843,8 @@ udeb: libz 1 zlib1g-udeb (>= 1:1.1.3)
          It is usual to call this file <file>debian/shlibs</file> (but if
          you have multiple binary packages, you might want to call it
          <file>debian/shlibs.<var>package</var></file> instead).  Then
-         let <file>debian/rules</file> install it in the control area:
+         let <file>debian/rules</file> install it in the control
+         information file area:
          <example compact="compact">
 install -m644 debian/shlibs debian/tmp/DEBIAN
          </example>
@@ -5547,14 +5853,15 @@ install -m644 debian/shlibs debian/tmp/DEBIAN
 install -m644 debian/shlibs.<var>package</var> debian/<var>package</var>/DEBIAN/shlibs
          </example>
          An alternative way of doing this is to create the
-         <file>shlibs</file> file in the control area directly from
-         <file>debian/rules</file> without using a <file>debian/shlibs</file>
-         file at all,<footnote>
-             This is what <prgn>dh_makeshlibs</prgn> in the
-             <tt>debhelper</tt> suite does. If your package also has a udeb
-             that provides a shared library, <prgn>dh_makeshlibs</prgn> can
-             automatically generate the <tt>udeb:</tt> lines if you specify
-             the name of the udeb with the <tt>--add-udeb</tt> option.
+         <file>shlibs</file> file in the control information file area
+         directly from <file>debian/rules</file> without using
+         a <file>debian/shlibs</file> file at all,<footnote>
+           This is what <prgn>dh_makeshlibs</prgn> in
+           the <package>debhelper</package> suite does. If your package
+           also has a udeb that provides a shared
+           library, <prgn>dh_makeshlibs</prgn> can automatically generate
+           the <tt>udeb:</tt> lines if you specify the name of the udeb
+           with the <tt>--add-udeb</tt> option.
          </footnote>
          since the <file>debian/shlibs</file> file itself is ignored by
          <prgn>dpkg-shlibdeps</prgn>.
@@ -5569,74 +5876,7 @@ install -m644 debian/shlibs.<var>package</var> debian/<var>package</var>/DEBIAN/
          packages.
        </p>
       </sect1>
-
-      <sect1 id="shlibslocal">
-       <heading>Writing the <file>debian/shlibs.local</file> file</heading>
-
-       <p>
-         This file is intended only as a <em>temporary</em> fix if
-         your binaries or libraries depend on a library whose package
-         does not yet provide a correct <file>shlibs</file> file.
-       </p>
-
-       <p>
-         We will assume that you are trying to package a binary
-         <tt>foo</tt>.  When you try running
-         <prgn>dpkg-shlibdeps</prgn> you get the following error
-         message (<tt>-O</tt> displays the dependency information on
-         <tt>stdout</tt> instead of writing it to
-         <tt>debian/substvars</tt>, and the lines have been wrapped
-         for ease of reading):
-         <example compact="compact">
-$ 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)
-         </example>
-         You can then run <prgn>ldd</prgn> on the binary to find the
-         full location of the library concerned:
-         <example compact="compact">
-$ 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)
-         </example>
-         So the <prgn>foo</prgn> binary depends on the
-         <prgn>libbar</prgn> shared library, but no package seems to
-         provide a <file>*.shlibs</file> file handling
-         <file>libbar.so.1</file> in <file>/var/lib/dpkg/info/</file>.  Let's
-         determine the package responsible:
-         <example compact="compact">
-$ dpkg -S /usr/lib/libbar.so.1
-bar1: /usr/lib/libbar.so.1
-$ dpkg -s bar1 | grep Version
-Version: 1.0-1
-         </example>
-         This tells us that the <tt>bar1</tt> package, version 1.0-1,
-         is the one we are using.  Now we can file a bug against the
-         <tt>bar1</tt> package and create our own
-         <file>debian/shlibs.local</file> to locally fix the problem.
-         Including the following line into your
-         <file>debian/shlibs.local</file> file:
-         <example compact="compact">
-libbar 1 bar1 (>= 1.0-1)
-         </example>
-         should allow the package build to work.
-       </p>
-
-       <p>
-         As soon as the maintainer of <tt>bar1</tt> provides a
-         correct <file>shlibs</file> file, you should remove this line
-         from your <file>debian/shlibs.local</file> file.  (You should
-         probably also then have a versioned <tt>Build-Depends</tt>
-         on <tt>bar1</tt> to help ensure that others do not have the
-         same problem building your package.)
-       </p>
-      </sect1>
-
       </sect>
-
     </chapt>
 
 
@@ -6992,7 +7232,7 @@ exec /usr/lib/foo/foo "$@"
     <chapt id="files">
       <heading>Files</heading>
 
-      <sect>
+      <sect id="binaries">
        <heading>Binaries</heading>
 
        <p>
@@ -7127,10 +7367,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. 
         </p>
+
        <p>
-         You must specify the gcc option <tt>-D_REENTRANT</tt>
-         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.
        </p>
 
         <p>
@@ -7187,40 +7427,58 @@ strip --strip-unneeded <var>your-lib</var>
        </p>
 
        <p>
-         An ever increasing number of packages are using
-         <prgn>libtool</prgn> to do their linking.  The latest GNU
-         libtools (>= 1.3a) can take advantage of the metadata in the
-         installed <prgn>libtool</prgn> archive files (<file>*.la</file>
-         files).  The main advantage of <prgn>libtool</prgn>'s
-         <file>.la</file> files is that it allows <prgn>libtool</prgn> to
-         store and subsequently access metadata with respect to the
-         libraries it builds.  <prgn>libtool</prgn> 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 <em>essential</em> for programs
-         using <tt>libltdl</tt>.<footnote>
-             Although <prgn>libtool</prgn> is fully capable of
-             linking against shared libraries which don't have
-             <tt>.la</tt> files, as it is a mere shell script it can
-             add considerably to the build time of a
-             <prgn>libtool</prgn>-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 <prgn>libtool</prgn> version 1.4 (and to a
-             lesser extent <prgn>libtool</prgn> version 1.3), the
-             <file>.la</file> files also store information about
-             inter-library dependencies which cannot necessarily be
-             derived after the <file>.la</file> file is deleted.
+         Packages that use <prgn>libtool</prgn> to create and install
+         their shared libraries install a file containing additional
+         metadata (ending in <file>.la</file>) 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.<footnote>
+           These files store, among other things, all libraries on which
+           that shared library depends.  Unfortunately, if
+           the <file>.la</file> file is present and contains that
+           dependency information, using <prgn>libtool</prgn> 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.
          </footnote>
+         If the <file>.la</file> file is required for that library (if,
+         for instance, it's loaded via <tt>libltdl</tt> in a way that
+         requires that meta-information), the <tt>dependency_libs</tt>
+         setting in the <file>.la</file> file should normally be set to
+         the empty string.  If the shared library development package has
+         historically included the <file>.la</file>, it must be retained
+         in the development package (with <tt>dependency_libs</tt>
+         emptied) until all libraries that depend on it have removed or
+         emptied <tt>dependency_libs</tt> in their <file>.la</file>
+         files to prevent linking with those other libraries
+         using <prgn>libtool</prgn> from failing.
+       </p>
+
+       <p>
+         If the <file>.la</file> must be included, it should be included
+         in the development (<tt>-dev</tt>) package, unless the library
+         will be loaded by <prgn>libtool</prgn>'s <tt>libltdl</tt>
+         library.  If it is intended for use with <tt>libltdl</tt>,
+         the <file>.la</file> files must go in the run-time library
+         package.
        </p>
 
        <p>
-         Packages that use <prgn>libtool</prgn> to create shared
-         libraries should include the <file>.la</file> files in the
-         <tt>-dev</tt> package, unless the package relies on
-         <tt>libtool</tt>'s <tt>libltdl</tt> library, in which case
-         the <tt>.la</tt> files must go in the run-time library
-         package.
+         These requirements for handling of <file>.la</file> 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 <file>.la</file> files alongside the modules so that they
+         can be loaded by <tt>libltdl</tt>.  <tt>dependency_libs</tt>
+         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.
        </p>
 
        <p>
@@ -7311,7 +7569,19 @@ fname () {
 </example>
              must be supported and must set the value of <tt>c</tt> to
              <tt>delta</tt>.
-            </item>
+           </item>
+           <item>The XSI extension to <prgn>kill</prgn> allowing <tt>kill
+             -<var>signal</var></tt>, where <var>signal</var> 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 <prgn>kill</prgn> is implemented as a shell
+             built-in.
+           </item>
+           <item>The XSI extension to <prgn>trap</prgn> allowing numeric
+             signals must be supported.  In addition to the signal
+             numbers listed in the extension, which are the same as for
+             <prgn>kill<prgn> above, 13 (SIGPIPE) must be allowed.
+           </item>
          </list>
          If a shell script requires non-SUSv3 features from the shell
          interpreter other than those listed above, the appropriate shell
@@ -7537,6 +7807,8 @@ ln -fs ../sbin/sendmail debian/tmp/usr/bin/runq
                  package is purged.
              </item>
            </list>
+           Obsolete configuration files without local changes may be
+           removed by the package during upgrade.
          </p>
 
          <p>
@@ -7801,7 +8073,7 @@ endscript
        </p>
       </sect>
 
-      <sect>
+      <sect id="permissions-owners">
        <heading>Permissions and owners</heading>
 
        <p>
@@ -8128,10 +8400,14 @@ done
 
        <p>
          These two files are managed through the <prgn>dpkg</prgn>
-         "alternatives" mechanism.  Thus every package providing an
-         editor or pager must call the
-         <prgn>update-alternatives</prgn> script to register these
-         programs.
+         "alternatives" mechanism.  Every package providing an editor or
+         pager must call the <prgn>update-alternatives</prgn> script to
+         register as an alternative for <file>/usr/bin/editor</file>
+         or <file>/usr/bin/pager</file> as appropriate.  The alternative
+         should have a slave alternative
+         for <file>/usr/share/man/man1/editor.1.gz</file>
+         or <file>/usr/share/man/man1/pager.1.gz</file> pointing to the
+         corresponding manual page.
        </p>
 
        <p>
@@ -8180,11 +8456,13 @@ done
                <example compact="compact">
 /usr/lib/cgi-bin/<var>cgi-bin-name</var>
                </example>
-               and should be referred to as
+               or a subdirectory of that directory, and should be
+               referred to as
                <example compact="compact">
 http://localhost/cgi-bin/<var>cgi-bin-name</var>
                </example>
-
+               (possibly with a subdirectory name
+               before <var>cgi-bin-name</var>).
            </item>
 
            <item>
@@ -8340,8 +8618,7 @@ http://localhost/doc/<var>package</var>/<var>filename</var>
          this so programs should not fail if <prgn>newaliases</prgn>
          cannot be found.  Note that because of this, all MTA
          packages must have <tt>Provides</tt>, <tt>Conflicts</tt> and
-         <tt>Replaces: mail-transport-agent</tt> control file
-         fields.
+         <tt>Replaces: mail-transport-agent</tt> control fields.
        </p>
 
        <p>
@@ -8450,8 +8727,9 @@ name ["<var>syshostname</var>"]:
          <p>
            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 <tt>xserver</tt>.<footnote>
+           hardware should declare in their <tt>Provides</tt> control
+           field that they provide the virtual
+           package <tt>xserver</tt>.<footnote>
                This implements current practice, and provides an
                actual policy for usage of the <tt>xserver</tt>
                virtual package which appears in the virtual packages
@@ -8469,12 +8747,14 @@ name ["<var>syshostname</var>"]:
 
          <p>
            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 <tt>x-terminal-emulator</tt>.  They should also
-           register themselves as an alternative for
+           System which meet the criteria listed below should declare in
+           their <tt>Provides</tt> control field that they provide the
+           virtual package <tt>x-terminal-emulator</tt>.  They should
+           also register themselves as an alternative for
            <file>/usr/bin/x-terminal-emulator</file>, with a priority of
-           20.
+           20.  That alternative should have a slave alternative
+           for <file>/usr/share/man/man1/x-terminal-emulator.1.gz</file>
+           pointing to the corresponding manual page.
          </p>
 
          <p>
@@ -8515,9 +8795,9 @@ name ["<var>syshostname</var>"]:
 
          <p>
            Packages that provide a window manager should declare in
-           their control data that they provide the virtual package
-           <tt>x-window-manager</tt>.  They should also register
-           themselves as an alternative for
+           their <tt>Provides</tt> control field that they provide the
+           virtual package <tt>x-window-manager</tt>.  They should also
+           register themselves as an alternative for
            <file>/usr/bin/x-window-manager</file>, with a priority
            calculated as follows:
            <list compact="compact">
@@ -8551,6 +8831,9 @@ name ["<var>syshostname</var>"]:
                  configuration, add 10 points; otherwise add none.
              </item>
            </list>
+           That alternative should have a slave alternative
+           for <file>/usr/share/man/man1/x-window-manager.1.gz</file>
+           pointing to the corresponding manual page.
          </p>
        </sect1>
 
@@ -8690,8 +8973,8 @@ name ["<var>syshostname</var>"]:
 
              <item>
                  Font packages must declare a dependency on
-                 <tt>xfonts-utils</tt> in their control
-                 data.
+                 <tt>xfonts-utils</tt> in their <tt>Depends</tt>
+                 or <tt>Pre-Depends</tt> control field.
              </item>
 
              <item>
@@ -9232,16 +9515,16 @@ END-INFO-DIR-ENTRY
        </p>
 
        <p>
-         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 <file>/usr/share/common-licenses</file>,<footnote>
+         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 <file>/usr/share/common-licenses</file>,<footnote>
            <p>
              In particular,
-              <file>/usr/share/common-licenses/BSD</file>,
               <file>/usr/share/common-licenses/Apache-2.0</file>,
               <file>/usr/share/common-licenses/Artistic</file>,
+              <file>/usr/share/common-licenses/GPL-1</file>,
               <file>/usr/share/common-licenses/GPL-2</file>,
               <file>/usr/share/common-licenses/GPL-3</file>,
               <file>/usr/share/common-licenses/LGPL-2</file>,
@@ -9249,7 +9532,14 @@ END-INFO-DIR-ENTRY
               <file>/usr/share/common-licenses/LGPL-3</file>,
               <file>/usr/share/common-licenses/GFDL-1.2</file>, and
               <file>/usr/share/common-licenses/GFDL-1.3</file>
-              respectively.
+             respectively.  The University of California BSD license is
+             also included in <package>base-files</package> as
+             <file>/usr/share/common-licenses/BSD</file>, 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.
             </p>
           </footnote> rather than quoting them in the copyright
          file. 
@@ -9552,13 +9842,13 @@ END-INFO-DIR-ENTRY
 
        <p>
          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).
        </p>
 
        <p>
-         Here is a brief list of the control info files supported by
-         <prgn>dpkg</prgn> and a summary of what they're used for.
+         Here is a brief list of the control information files supported
+         by <prgn>dpkg</prgn> and a summary of what they're used for.
        </p>
 
        <p>
@@ -10050,23 +10340,23 @@ END-INFO-DIR-ENTRY
       </sect>
 
       <sect id="pkg-sourcetree">
-       <heading>The Debianised source tree</heading>
+       <heading>The Debian package source tree</heading>
 
        <p>
          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.
        </p>
 
        <p>
          The extra files created for Debian are in the subdirectory
-         <file>debian</file> of the top level of the Debianised source
-         tree.  They are described below.
+         <file>debian</file> of the top level of the Debian package
+         source tree. They are described below.
        </p>
 
        <sect1 id="pkg-debianrules">
@@ -10156,7 +10446,7 @@ END-INFO-DIR-ENTRY
            </item>
 
            <tag>
-             Debianisation diff -
+             Debian package diff -
              <file>
                <var>package</var>_<var>upstream_version-revision</var>.diff.gz
              </file>
@@ -10225,7 +10515,7 @@ END-INFO-DIR-ENTRY
          <item><p>Apply the diff using <tt>patch -p0</tt>.</p>
          </item>
          <item><p>Untar the tarfile again if you want a copy of the original
-             source code alongside the Debianised version.</p>
+             source code alongside the Debian version.</p>
          </item>
        </enumlist>
 
@@ -10259,10 +10549,10 @@ END-INFO-DIR-ENTRY
 
          <p>
            The source packaging tools manage the changes between the
-           original and Debianised source using <prgn>diff</prgn> and
+           original and Debian source using <prgn>diff</prgn> and
            <prgn>patch</prgn>.  Turning the original source tree as
-           included in the <file>.orig.tar.gz</file> into the debianised
-           source must not involve any changes which cannot be
+           included in the <file>.orig.tar.gz</file> into the Debian
+           package source must not involve any changes which cannot be
            handled by these tools.  Problematic changes which cause
            <prgn>dpkg-source</prgn> to halt with an error when
            building the source package are:
@@ -10429,7 +10719,7 @@ END-INFO-DIR-ENTRY
              <tag><tt>Package_Revision</tt></tag>
              <item>
                  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.
              </item>
 
@@ -10486,7 +10776,7 @@ END-INFO-DIR-ENTRY
        </heading>
 
        <p>
-         A package may contain a control area file called
+         A package may contain a control information file called
          <tt>conffiles</tt>.  This file should be a list of filenames
          of configuration files needing automatic handling, separated
          by newlines.  The filenames should be absolute pathnames,