]> git.donarmstrong.com Git - debian/debian-policy.git/blobdiff - policy.sgml
Merge branch 'master' into bug519941-rra
[debian/debian-policy.git] / policy.sgml
index c8087f3127483f1d5b3725747c022ef6d0ab672e..7a0b088996e5562a67fb0349a31de7ec2f14080b 100644 (file)
          Copyright © 1996,1997,1998 Ian Jackson
          and Christian Schwarz.
        </copyrightsummary>
+       <p>
+         These are the copyright dates of the original Policy manual.
+         Since then, this manual has been updated by many others.  No
+         comprehensive collection of copyright notices for subsequent
+         work exists.
+       </p>
+
        <p>
          This manual is free software; you may redistribute it and/or
          modify it under the terms of the GNU General Public License
        </p>
       </sect>
 
+      <sect id="definitions">
+       <heading>Definitions</heading>
+
+       <p>
+         The following terms are used in this Policy Manual:
+         <taglist>
+           <tag>ASCII</tag>
+           <item>
+             The character encoding specified by ANSI X3.4-1986 and its
+             predecessor standards, referred to in MIME as US-ASCII, and
+             corresponding to an encoding in eight bits per character of
+             the first 128 <url id="http://www.unicode.org/"
+             name="Unicode"> characters, with the eighth bit always zero.
+           </item>
+           <tag>UTF-8</tag>
+           <item>
+             The transformation format (sometimes called encoding) of
+             <url id="http://www.unicode.org/" name="Unicode"> defined by
+             <url id="http://www.rfc-editor.org/rfc/rfc3629.txt"
+             name="RFC 3629">.  UTF-8 has the useful property of having
+             ASCII as a subset, so any text encoded in ASCII is trivially
+             also valid UTF-8.
+           </item>
+         </taglist>
+       </p>
+      </sect>
     </chapt>
 
 
        system, but not every package we want to make accessible is
        <em>free</em> in our sense (see the Debian Free Software
        Guidelines, below), or may be imported/exported without
-       restrictions. Thus, the archive is split into the distribution
-       areas or categories based on their licenses and other restrictions.
+       restrictions. Thus, the archive is split into areas<footnote>
+         The Debian archive software uses the term "component" internally
+         and in the Release file format to refer to the division of an
+         archive.  The Debian Social Contract simply refers to "areas."
+         This document uses terminology similar to the Social Contract.
+       </footnote> based on their licenses and other restrictions.
       </p>
 
       <p>
       </p>
 
       <p>
-       The <em>main</em> category  forms the
-       <em>Debian GNU/Linux distribution</em>.
+       The <em>main</em> archive area forms the <em>Debian GNU/Linux
+       distribution</em>.
       </p>
 
       <p>
-       Packages in the other distribution areas (<tt>contrib</tt>,
+       Packages in the other archive areas (<tt>contrib</tt>,
        <tt>non-free</tt>) are not considered to be part of the Debian
        distribution, although we support their use and provide
        infrastructure for them (such as our bug-tracking system and
       </sect>
 
       <sect id="sections">
-       <heading>Categories</heading>
+       <heading>Archive areas</heading>
 
        <sect1 id="main">
-         <heading>The main category</heading>
+         <heading>The main archive area</heading>
 
          <p>
            Every package in <em>main</em> must comply with the DFSG
        </sect1>
 
        <sect1 id="contrib">
-         <heading>The contrib category</heading>
+         <heading>The contrib archive area</heading>
 
          <p>
            Every package in <em>contrib</em> must comply with the DFSG.
        </sect1>
 
        <sect1 id="non-free">
-         <heading>The non-free category</heading>
+         <heading>The non-free archive area</heading>
 
          <p>
            Packages must be placed in <em>non-free</em> if they are
        <heading>Sections</heading>
 
        <p>
-         The packages in the categories <em>main</em>,
-         <em>contrib</em> and <em>non-free</em> are grouped further
-         into <em>sections</em> to simplify handling.
+         The packages in the archive areas <em>main</em>,
+         <em>contrib</em> and <em>non-free</em> are grouped further into
+         <em>sections</em> to simplify handling.
        </p>
 
        <p>
-         The category and section for each package should be
-         specified in the package's <tt>Section</tt> control record
-         (see <ref id="f-Section">).  However, the maintainer of the
-         Debian archive may override this selection to ensure the
-         consistency of the Debian distribution.  The
-         <tt>Section</tt> field should be of the form:
+         The archive area and section for each package should be
+         specified in the package's <tt>Section</tt> control record (see
+         <ref id="f-Section">).  However, the maintainer of the Debian
+         archive may override this selection to ensure the consistency of
+         the Debian distribution.  The <tt>Section</tt> field should be
+         of the form:
          <list compact="compact">
            <item>
                  <em>section</em> if the package is in the
-                 <em>main</em> category,
+                 <em>main</em> archive area,
            </item>
            <item>
-                 <em>segment/section</em> if the package is in
+                 <em>area/section</em> if the package is in
                  the <em>contrib</em> or <em>non-free</em>
-                 distribution areas.
+                 archive areas.
            </item>
          </list>
        </p>
        <p>
          The Debian archive maintainers provide the authoritative
          list of sections.  At present, they are:
-         <em>admin</em>, <em>comm</em>,
-         <em>devel</em>, <em>doc</em>,
-         <em>editors</em>, <em>electronics</em>, <em>embedded</em>,
-         <em>games</em>, <em>gnome</em>, <em>graphics</em>,
-         <em>hamradio</em>, <em>interpreters</em>, <em>kde</em>,
-         <em>libs</em>, <em>libdevel</em>, <em>mail</em>,
-         <em>math</em>, <em>misc</em>, <em>net</em>, <em>news</em>,
-         <em>oldlibs</em>,
-         <em>otherosfs</em>, <em>perl</em>, <em>python</em>,
-         <em>science</em>, <em>shells</em>,
-         <em>sound</em>, <em>tex</em>, <em>text</em>,
-         <em>utils</em>, <em>web</em>, <em>x11</em>.
+         <em>admin</em>, <em>cli-mono</em>, <em>comm</em>, <em>database</em>,
+         <em>devel</em>, <em>debug</em>, <em>doc</em>, <em>editors</em>,
+         <em>electronics</em>, <em>embedded</em>, <em>fonts</em>,
+         <em>games</em>, <em>gnome</em>, <em>graphics</em>, <em>gnu-r</em>,
+         <em>gnustep</em>, <em>hamradio</em>, <em>haskell</em>,
+         <em>httpd</em>, <em>interpreters</em>, <em>java</em>, <em>kde</em>,
+         <em>kernel</em>, <em>libs</em>, <em>libdevel</em>, <em>lisp</em>,
+         <em>localization</em>, <em>mail</em>, <em>math</em>, <em>misc</em>,
+         <em>net</em>, <em>news</em>, <em>ocaml</em>, <em>oldlibs</em>,
+         <em>otherosfs</em>, <em>perl</em>, <em>php</em>, <em>python</em>,
+         <em>ruby</em>, <em>science</em>, <em>shells</em>, <em>sound</em>,
+         <em>tex</em>, <em>text</em>, <em>utils</em>, <em>vcs</em>,
+         <em>video</em>, <em>web</em>, <em>x11</em>, <em>xfce</em>,
+         <em>zope</em>.
        </p>
       </sect>
 
                with required, important, standard or optional
                priorities, or are only likely to be useful if you
                already know what they are or have specialized
-               requirements.
+               requirements (such as packages containing only detached
+               debugging symbols).
            </item>
          </taglist>
        </p>
          (see below), and should not do so unless they depend on a
          particular version of that package.<footnote>
             <p>
-              Essential is defined as the minimal set of functionality
-              that must be available and usable on the system even
-              when packages are in an unconfigured (but unpacked)
-              state.  This is needed to avoid unresolvable dependency
-              loops on upgrade.  If packages add unnecessary
-              dependencies on packages in this set, the chances that
-              there <strong>will</strong> be an unresolvable
-              dependency loop caused by forcing these Essential
-              packages to be configured first before they need to be
-              is greatly increased.  It also increases the chances
-              that frontends will be unable to
-              <strong>calculate</strong> an upgrade path, even if one
-              exists.
+             Essential is needed in part to avoid unresolvable dependency
+             loops on upgrade.  If packages add unnecessary dependencies
+             on packages in this set, the chances that there
+             <strong>will</strong> be an unresolvable dependency loop
+             caused by forcing these Essential packages to be configured
+             first before they need to be is greatly increased.  It also
+             increases the chances that frontends will be unable to
+             <strong>calculate</strong> an upgrade path, even if one
+             exists.
             </p>
             <p>
-              Also, it's pretty unlikely that functionality from
-              Essential shall ever be removed (which is one reason why
-              care must be taken before adding to the Essential
-              packages set), but <em>packages</em> have been removed
-              from the Essential set when the functionality moved to a
-              different package. So depending on these packages
-              <em>just in case</em> they stop being essential does way
-              more harm than good.
+             Also, functionality is rarely ever removed from the
+             Essential set, but <em>packages</em> have been removed from
+             the Essential set when the functionality moved to a
+             different package. So depending on these packages <em>just
+             in case</em> they stop being essential does way more harm
+             than good.
             </p>
           </footnote>
        </p>
        <heading>Essential packages</heading>
 
        <p>
-         Some 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 is
-         described in <ref id="f-Essential">.
+         Essential is defined as the minimal set of functionality that
+         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 is described in <ref
+         id="f-Essential">.
        </p>
 
        <p>
             appropriate.
        </p>
 
+       <p>
+         Maintainers should take great care in adding any programs,
+         interfaces, or functionality to <tt>essential</tt> packages.
+         Packages may assume that functionality provided by
+         <tt>essential</tt> packages is always available without
+         declaring explicit dependencies, which means that removing
+         functionality from the Essential set is very difficult and is
+         almost never done.  Any capability added to an
+         <tt>essential</tt> package therefore creates an obligation to
+         support that capability as part of the Essential set in
+         perpetuity.
+       </p>
+
        <p>
          You must not tag any packages <tt>essential</tt> before
          this has been discussed on the <tt>debian-devel</tt>
          <heading>Prompting in maintainer scripts</heading>
          <p>
            Package maintainer scripts may prompt the user if
-           necessary. Prompting should be done by communicating
+           necessary. Prompting must be done by communicating
            through a program, such as <prgn>debconf</prgn>, which
-           conforms to the Debian Configuration management
-           specification, version 2 or higher.  Prompting the user by
-           other means, such as by hand<footnote>
-                From the Jargon file: by hand 2. By extension,
-                writing code which does something in an explicit or
-                low-level way for which a presupplied library
-                (<em>debconf, in this instance</em>) routine ought
-                to have been available.
-            </footnote>, is now deprecated.
+           conforms to the Debian Configuration Management
+           Specification, version 2 or higher.
          </p>
 
          <p>
-           The Debian Configuration management specification is included
+           Packages which are essential, or which are dependencies of
+           essential packages, may fall back on another prompting method
+           if no such interface is available when they are executed.
+         </p>
+
+         <p>
+           The Debian Configuration Management Specification is included
            in the <file>debconf_specification</file> files in the
            <package>debian-policy</package> package.
            It is also available from the Debian web mirrors at
          </p>
 
          <p>
-           Packages which use the Debian Configuration management
-           specification may contain an additional
+           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.
            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
+                 implements the Debian Configuration Management
+                 Specification will also be installed, and any
                  versioned dependencies on it will be satisfied
                  before preconfiguration begins.
            </footnote>
          </p>
 
          <p>
-           Packages which use the Debian Configuration management
-           specification must allow for translation of their messages
-           by using a gettext-based system such as the one provided by
-           the <package>po-debconf</package> package.
+           Packages which use the Debian Configuration Management
+           Specification must allow for translation of their user-visible
+           messages by using a gettext-based system such as the one
+           provided by the <package>po-debconf</package> package.
          </p>
 
          <p>
          </footnote>
        </p>
 
-        <p>
-          
-        </p>
-
         <p>
           The format of the <file>debian/changelog</file> allows the
          package building tools to discover which version of the package
 /closes:\s*(?:bug)?\#?\s?\d+(?:,\s*(?:bug)?\#?\s?\d+)*/i
              </example>
              Then all of the bug numbers listed will be closed by the
-             archive maintenance script (<prgn>katie</prgn>), or in
-             the case of an NMU, marked as fixed.
+             archive maintenance script (<prgn>katie</prgn>) using the
+             <var>version</var> of the changelog entry.
          </footnote>
          This information is conveyed via the <tt>Closes</tt> field
          in the <tt>.changes</tt> file (see <ref id="f-Closes">).
        </p>
 
        <p>
-         The <var>date</var> should be in RFC822 format<footnote>
+         The <var>date</var> must be in RFC822 format<footnote>
              This is generated by <tt>date -R</tt>.
-         </footnote>; it should include the time zone specified
+         </footnote>; it must include the time zone specified
          numerically, with the time zone name or abbreviation
          optionally present as a comment in parentheses.
        </p>
 
        <p>
-         The first "title" line with the package name should start
-         at the left hand margin; the "trailer" line with the
-         maintainer and date details should be preceded by exactly
+         The first "title" line with the package name must start
+         at the left hand margin.  The "trailer" line with the
+         maintainer and date details must be preceded by exactly
          one space.  The maintainer details and the date must be
          separated by exactly two spaces.
        </p>
 
+       <p>
+         The entire changelog must be encoded in UTF-8.
+       </p>
+
        <p>
          For more information on placement of the changelog files
          within binary packages, please see <ref id="changelogs">.
        </p>
-
-       <sect1><heading>Alternative changelog formats</heading>
-
-         <p>
-           In non-experimental packages you must use a format for
-           <file>debian/changelog</file> which is supported by the most
-           recent released version of <prgn>dpkg</prgn>.
-         </p>
-
-         <p>
-           It is possible to use a format different from the standard
-           one by providing a changelog parser for the format you wish
-           to use. The parser must have an API compatible with that
-           expected by <prgn>dpkg-genchanges</prgn> and
-           <prgn>dpkg-gencontrol</prgn>, and it must not interact with
-           the user at all.
-           <footnote>
-             If there is general interest in the new format, you should
-             contact the <package>dpkg</package> maintainer to have the
-             parser script for it included in the <prgn>dpkg</prgn>
-             package.  (You will need to agree that the parser and its
-             man page may be distributed under the GNU GPL, just as the rest
-             of <prgn>dpkg</prgn> is.)
-           </footnote>
-         </p>
-       </sect1>
       </sect>
+
       <sect id="dpkgcopyright">
        <heading>Copyright: <file>debian/copyright</file></heading>
         <p>
                possible is a good idea.
              </p>
            </item>
+
+           <tag><tt>patch</tt> (optional)</tag>
+           <item>
+             <p>
+               This target performs whatever additional actions are
+               required to make the source ready for editing (unpacking
+               additional upstream archives, applying patches, etc.).
+               It is recommended to be implemented for any package where
+               <tt>dpkg-source -x</tt> does not result in source ready
+               for additional modification.  See
+               <ref id="readmesource">.
+             </p>
+           </item>
          </taglist>
 
        <p>
            <item>
                <tt>DEB_*_ARCH</tt> (the Debian architecture)
            </item>
+           <item>
+               <tt>DEB_*_ARCH_CPU</tt> (the Debian CPU name)
+           </item>
+           <item>
+               <tt>DEB_*_ARCH_OS</tt> (the Debian System name)
+           </item>
            <item>
                <tt>DEB_*_GNU_TYPE</tt> (the GNU style architecture
                specification string)
          It is important to understand that the <tt>DEB_*_ARCH</tt>
          string only determines which Debian architecture we are
          building on or for. It should not be used to get the CPU
-         or system information; the GNU style variables should be
-         used for that.
-       </p>
+         or system information; the <tt>DEB_*_ARCH_CPU</tt> and
+         <tt>DEB_*_ARCH_OS</tt> variables should be used for that.
+         GNU style variables should generally only be used with upstream
+         build systems.
+       </p>
+
+       <sect1 id="debianrules-options">
+         <heading><file>debian/rules</file> and
+           <tt>DEB_BUILD_OPTIONS</tt></heading>
+
+         <p>
+           Supporting the standardized environment variable
+           <tt>DEB_BUILD_OPTIONS</tt> is recommended.  This variable can
+           contain several flags to change how a package is compiled and
+           built.  Each flag must be in the form <var>flag</var> or
+           <var>flag</var>=<var>options</var>.  If multiple flags are
+           given, they must be separated by whitespace.<footnote>
+             Some packages support any delimiter, but whitespace is the
+             easiest to parse inside a makefile and avoids ambiguity with
+             flag values that contain commas.
+           </footnote>
+           <var>flag</var> must start with a lowercase letter
+           (<tt>a-z</tt>) and consist only of lowercase letters,
+           numbers (<tt>0-9</tt>), and the characters
+           <tt>-</tt> and <tt>_</tt> (hyphen and underscore).
+           <var>options</var> must not contain whitespace.  The same
+           tag should not be given multiple times with conflicting
+           values.  Package maintainers may assume that
+           <tt>DEB_BUILD_OPTIONS</tt> will not contain conflicting tags.
+         </p>
+
+         <p>
+           The meaning of the following tags has been standardized:
+           <taglist>
+             <tag>nocheck</tag>
+             <item>
+                 This tag says to not run any build-time test suite
+                 provided by the package.
+             </item>
+             <tag>noopt</tag>
+             <item>
+                 The presence of this tag means that the package should
+                 be compiled with a minimum of optimization.  For C
+                 programs, it is best to add <tt>-O0</tt> to
+                 <tt>CFLAGS</tt> (although this is usually the default).
+                 Some programs might fail to build or run at this level
+                 of optimization; it may be necessary to use
+                 <tt>-O1</tt>, for example.
+             </item>
+             <tag>nostrip</tag>
+             <item>
+                 This tag means that the debugging symbols should not be
+                 stripped from the binary during installation, so that
+                 debugging information may be included in the package.
+             </item>
+             <tag>parallel=n</tag>
+             <item>
+                 This tag means that the package should be built using up
+                 to <tt>n</tt> parallel processes if the package build
+                 system supports this.<footnote>
+                     Packages built with <tt>make</tt> can often implement
+                     this by passing the <tt>-j</tt><var>n</var> option to
+                     <tt>make</tt>.
+                 </footnote>
+                 If the package build system does not support parallel
+                 builds, this string must be ignored.  If the package
+                 build system only supports a lower level of concurrency
+                 than <var>n</var>, the package should be built using as
+                 many parallel processes as the package build system
+                 supports.  It is up to the package maintainer to decide
+                 whether the package build times are long enough and the
+                 package build system is robust enough to make supporting
+                 parallel builds worthwhile.
+              </item>
+           </taglist>
+         </p>
+
+         <p>
+           Unknown flags must be ignored by <file>debian/rules</file>.
+         </p>
+
+         <p>
+           The following makefile snippet is an example of how one may
+           implement the build options; you will probably have to
+           massage this example in order to make it work for your
+           package.
+           <example compact="compact">
+CFLAGS = -Wall -g
+INSTALL = install
+INSTALL_FILE    = $(INSTALL) -p    -o root -g root  -m  644
+INSTALL_PROGRAM = $(INSTALL) -p    -o root -g root  -m  755
+INSTALL_SCRIPT  = $(INSTALL) -p    -o root -g root  -m  755
+INSTALL_DIR     = $(INSTALL) -p -d -o root -g root  -m  755
+
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+    CFLAGS += -O0
+else
+    CFLAGS += -O2
+endif
+ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
+    INSTALL_PROGRAM += -s
+endif
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+    NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+    MAKEFLAGS += -j$(NUMJOBS)
+endif
+
+build:
+       # ...
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+       # Code to run the package test suite.
+endif
+           </example>
+         </p>
+       </sect1>
       </sect>
 
 <!-- FIXME: section pkg-srcsubstvars is the same as substvars -->
        </p>
 
        <p>
-         See <manref name="dpkg-source" section="1"> for full
+         See <manref name="deb-substvars" section="5"> for full
          details about source variable substitutions, including the
          format of <file>debian/substvars</file>.</p>
       </sect>
        </p>
       </sect>
 
+      <sect id="readmesource">
+       <heading>Source package handling:
+         <file>debian/README.source</file></heading>
+
+       <p>
+         If running <prgn>dpkg-source -x</prgn> on a source package
+         doesn't produce the source of the package, ready for editing,
+         and allow one to make changes and run
+         <prgn>dpkg-buildpackage</prgn> to produce a modified package
+         without taking any additional steps, creating a
+         <file>debian/README.source</file> documentation file is
+         recommended.  This file should explain how to do all of the
+         following:
+           <enumlist>
+             <item>Generate the fully patched source, in a form ready for
+             editing, that would be built to create Debian
+             packages.  Doing this with a <tt>patch</tt> target in
+             <file>debian/rules</file> is recommended; see
+             <ref id="debianrules">.</item>
+             <item>Modify the source and save those modifications so that
+             they will be applied when building the package.</item>
+             <item>Remove source modifications that are currently being
+             applied when building the package.</item>
+             <item>Optionally, document what steps are necessary to
+             upgrade the Debian source package to a new upstream version,
+             if applicable.</item>
+           </enumlist>
+         This explanation should include specific commands and mention
+         any additional required Debian packages.  It should not assume
+         familiarity with any specific Debian packaging system or patch
+         management tools.
+       </p>
+
+       <p>
+         This explanation may refer to a documentation file installed by
+         one of the package's build dependencies provided that the
+         referenced documentation clearly explains these tasks and is not
+         a general reference manual.
+       </p>
+
+       <p>
+         <file>debian/README.source</file> may also include any other
+         information that would be helpful to someone modifying the
+         source package.  Even if the package doesn't fit the above
+         description, maintainers are encouraged to document in a
+         <file>debian/README.source</file> file any source package with a
+         particularly complex or unintuitive source layout or build
+         system (for example, a package that builds the same source
+         multiple times to generate different binary packages).
+       </p>
+      </sect>
     </chapt>
 
 
@@ -2181,6 +2387,9 @@ Package: libc6
          would mean a new paragraph.
        </p>
 
+       <p>
+         All control files must be encoded in UTF-8.
+       </p>
       </sect>
 
       <sect id="sourcecontrolfiles">
@@ -2257,6 +2466,15 @@ Package: libc6
          See <ref id="substvars"> for details.
        </p>
 
+       <p>
+         In addition to the control file syntax described <qref
+         id="controlsyntax">above</qref>, this file may also contain
+         comment lines starting with <tt>#</tt> without any preceding
+         whitespace.  All such lines are ignored, even in the middle of
+         continuation lines for a multiline field, and do not end a
+         multiline field.
+       </p>
+
       </sect>
 
       <sect id="binarycontrolfiles">
@@ -2385,6 +2603,14 @@ Package: libc6
            package control file when the source package has the same
            name and version as the binary package.
          </p>
+
+         <p>
+           Package names must consist only of lower case letters
+           (<tt>a-z</tt>), digits (<tt>0-9</tt>), plus (<tt>+</tt>)
+           and minus (<tt>-</tt>) signs, and periods (<tt>.</tt>).
+           They must be at least two characters long and must start
+           with an alphanumeric character.
+         </p>
        </sect1>
 
        <sect1 id="f-Maintainer">
@@ -2499,7 +2725,7 @@ Package: libc6
            values:
            <list>
                <item>A unique single word identifying a Debian machine
-                     architecture, see <ref id="arch-spec">.
+                     architecture as described in <ref id="arch-spec">.
                <item><tt>all</tt>, which indicates an
                      architecture-independent package.
                <item><tt>any</tt>, which indicates a package available
@@ -2510,31 +2736,53 @@ Package: libc6
 
          <p>
            In the main <file>debian/control</file> file in the source
-           package, or in the source package control file
-           <file>.dsc</file>, one may specify a list of architectures
-           separated by spaces, or the special values <tt>any</tt> or
-           <tt>all</tt>.
+           package, this field may contain the special value
+           <tt>any</tt>, the special value <tt>all</tt>, or a list of
+           architectures separated by spaces.  If <tt>any</tt> or
+           <tt>all</tt> appear, they must be the entire contents of the
+           field.  Most packages will use either <tt>any</tt> or
+           <tt>all</tt>.  Specifying a specific list of architectures is
+           for the minority of cases where a program is not portable or
+           is not useful on some architectures, and where possible the
+           program should be made portable instead.
+         </p>
+
+         <p>
+           In the source package control file <file>.dsc</file>, this
+           field may contain either the special value <tt>any</tt> or a
+           list of architectures separated by spaces. If a list is given,
+           it may include (or consist solely of) the special value
+           <tt>all</tt>.  In other words, in <file>.dsc</file> files
+           unlike the <file>debian/control</file>, <tt>all</tt> may occur
+           in combination with specific architectures.  The
+           <tt>Architecture</tt> field in the source package control file
+           <file>.dsc</file> is generally constructed from the
+           <tt>Architecture</tt> fields in the
+           <file>debian/control</file> in the source package.
          </p>
 
          <p>
            Specifying <tt>any</tt> indicates that the source package
            isn't dependent on any particular architecture and should
            compile fine on any one. The produced binary package(s)
-           will be specific to whatever the current build architecture
-           is.<footnote>
-               This is the most often used setting, and is recommended
-               for new packages that aren't <tt>Architecture: all</tt>.
-           </footnote>
+           will either be specific to whatever the current build
+           architecture is or will be architecture-independent.
+         </p>
+
+         <p>
+           Specifying only <tt>all</tt> indicates that the source package
+           will only build architecture-independent packages.  If this is
+           the case, <tt>all</tt> must be used rather than <tt>any</tt>;
+           <tt>any</tt> implies that the source package will build at
+           least one architecture-dependent package.
          </p>
 
          <p>
            Specifying a list of architectures indicates that the source
            will build an architecture-dependent package, and will only
-           work correctly on the listed architectures.<footnote>
-               This is a setting used for a minority of cases where the
-               program is not portable. Generally, it should not be used
-               for new packages.
-           </footnote>
+           work correctly on the listed architectures.  If the source
+           package also builds at least one architecture-independent
+           package, <tt>all</tt> will also be included in the list.
          </p>
 
          <p>
@@ -2542,7 +2790,11 @@ Package: libc6
            field lists the architecture(s) of the package(s)
            currently being uploaded.  This will be a list; if the
            source for the package is also being uploaded, the special
-           entry <tt>source</tt> is also present.
+           entry <tt>source</tt> is also present.  <tt>all</tt> will be
+           present if any architecture-independent packages are being
+           uploaded.  <tt>any</tt> may never occur in the
+           <tt>Architecture</tt> field in the <file>.changes</file>
+           file.
          </p>
 
          <p>
@@ -2714,19 +2966,22 @@ Package: libc6
                  number apart at the last hyphen in the string (if there
                  is one) to determine the <var>upstream_version</var> and
                  <var>debian_revision</var>.  The absence of a
-                 <var>debian_revision</var> compares earlier than the
-                 presence of one (but note that the
-                 <var>debian_revision</var> is the least significant part
-                 of the version number).
+                 <var>debian_revision</var> is equivalent to a
+                 <var>debian_revision</var> of <tt>0</tt>.
                </p>
              </item>
            </taglist>
          </p>
 
          <p>
-           The <var>upstream_version</var> and <var>debian_revision</var>
+           When comparing two version numbers, first the <var>epoch</var>
+           of each are compared, then the <var>upstream_version</var> if
+           <var>epoch</var> is equal, and then <var>debian_revision</var>
+           if <var>upstream_version</var> is also equal.
+           <var>epoch</var> is compared numerically.  The
+           <var>upstream_version</var> and <var>debian_revision</var>
            parts are compared by the package management system using the
-           same algorithm:
+           following algorithm:
          </p>
 
          <p>
@@ -2870,76 +3125,39 @@ Package: libc6
            distribution(s) where this version of the package should
            be installed.  Valid distributions are determined by the
            archive maintainers.<footnote>
-               Current distribution names are:
+             Example distribution names in the Debian archive used in
+             <file>.changes</file> files are:
                <taglist compact="compact">
-                 <tag><em>stable</em></tag>
-                 <item>
-                     This is the current "released" version of Debian
-                     GNU/Linux.  Once the distribution is
-                     <em>stable</em> only security fixes and other
-                     major bug fixes are allowed. When changes are
-                     made to this distribution, the release number is
-                     increased (for example: 2.2r1 becomes 2.2r2 then
-                     2.2r3, etc).
-                 </item>
-
                  <tag><em>unstable</em></tag>
                  <item>
-                     This distribution value refers to the
-                     <em>developmental</em> part of the Debian
-                     distribution tree. New packages, new upstream
-                     versions of packages and bug fixes go into the
-                     <em>unstable</em> directory tree. Download from
-                     this distribution at your own risk.
-                 </item>
-
-                 <tag><em>testing</em></tag>
-                 <item>
-                     This distribution value refers to the
-                     <em>testing</em> part of the Debian distribution
-                     tree.  It receives its packages from the
-                     unstable distribution after a short time lag to
-                     ensure that there are no major issues with the
-                     unstable packages.  It is less prone to breakage
-                     than unstable, but still risky.  It is not
-                     possible to upload packages directly to
-                     <em>testing</em>.
-                 </item>
-
-                 <tag><em>frozen</em></tag>
-                 <item>
-                     From time to time, the <em>testing</em>
-                     distribution enters a state of "code-freeze" in
-                     anticipation of release as a <em>stable</em>
-                     version. During this period of testing only
-                     fixes for existing or newly-discovered bugs will
-                     be allowed.  The exact details of this stage are
-                     determined by the Release Manager.
+                   This distribution value refers to the
+                   <em>developmental</em> part of the Debian distribution
+                   tree.  Most new packages, new upstream versions of
+                   packages and bug fixes go into the <em>unstable</em>
+                   directory tree.
                  </item>
 
                  <tag><em>experimental</em></tag>
                  <item>
-                     The packages with this distribution value are
-                     deemed by their maintainers to be high
-                     risk. Oftentimes they represent early beta or
-                     developmental packages from various sources that
-                     the maintainers want people to try, but are not
-                     ready to be a part of the other parts of the
-                     Debian distribution tree. Download at your own
-                     risk.
+                   The packages with this distribution value are deemed
+                   by their maintainers to be high risk.  Oftentimes they
+                   represent early beta or developmental packages from
+                   various sources that the maintainers want people to
+                   try, but are not ready to be a part of the other parts
+                   of the Debian distribution tree.
                  </item>
                </taglist>
 
                <p>
-                 You should list <em>all</em> distributions that the
-                 package should be installed into.
-               </p>
-
-               <p>
-                 More information is available in the Debian Developer's
-                 Reference, section "The Debian archive".
+                 Others are used for updating stable releases or for
+                 security uploads.  More information is available in the
+                 Debian Developer's Reference, section "The Debian
+                 archive".
                </p>
            </footnote>
+           The Debian archive software only supports listing a single
+           distribution.  Migration of packages to other distributions is
+           handled outside of the upload process.
          </p>
        </sect1>
 
@@ -3073,15 +3291,17 @@ Package: libc6
          <heading><tt>Installed-Size</tt></heading>
 
          <p>
-           This field appears in the control files of binary
-           packages, and in the <file>Packages</file> files.  It gives
-           the total amount of disk space required to install the
-           named package.
+           This field appears in the control files of binary packages,
+           and in the <file>Packages</file> files.  It gives an
+           estimation the total amount of disk space required to install
+           the named package.  Actual installed size may vary based on
+           block size, file system properties, or actions taken by
+           package maintainer scripts.
          </p>
 
          <p>
-           The disk space is represented in kilobytes as a simple
-           decimal number.
+           The disk space is given as the integer value of the estimated
+           installed size in bytes, divided by 1024 and rounded up.
          </p>
        </sect1>
 
@@ -3244,8 +3464,7 @@ Package: libc6
          scripts this means that you <em>almost always</em> need to
          use <tt>set -e</tt> (this is usually true when writing shell
          scripts, in fact).  It is also important, of course, that
-         they don't exit with a non-zero status if everything went
-         well.
+         they exit with a zero status if everything went well.
        </p>
 
         <p>
@@ -3997,6 +4216,22 @@ Build-Depends-Indep: texinfo
 Build-Depends: kernel-headers-2.2.10 [!hurd-i386],
   hurd-dev [hurd-i386], gnumach-dev [hurd-i386]
          </example>
+         requires <tt>kernel-headers-2.2.10</tt> on all architectures
+         other than hurd-i386 and requires <tt>hurd-dev</tt> and
+         <tt>gnumach-dev</tt> only on hurd-i386.
+       </p>
+
+       <p>
+         If the architecture-restricted dependency is part of a set of
+         alternatives using <tt>|</tt>, that alternative is ignored
+         completely on architectures that do not match the restriction.
+         For example:
+         <example compact="compact">
+Build-Depends: foo [!i386] | bar [!amd64]
+         </example>
+         is equivalent to <tt>bar</tt> on the i386 architecture, to
+         <tt>foo</tt> on the amd64 architecture, and to <tt>foo |
+         bar</tt> on all other architectures.
        </p>
 
        <p>
@@ -4026,6 +4261,9 @@ Build-Depends: kernel-headers-2.2.10 [!hurd-i386],
           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> is described in <ref id="breaks">, and
+          <tt>Conflicts</tt> is described in <ref id="conflicts">.  The
+          rest are described below.
         </p>
 
        <p>
@@ -4213,12 +4451,6 @@ Build-Depends: kernel-headers-2.2.10 [!hurd-i386],
       <sect id="breaks">
        <heading>Packages which break other packages - <tt>Breaks</tt></heading>
 
-       <p>
-         Using <tt>Breaks</tt> may cause problems for upgrades from older
-         versions of Debian and should not be used until the stable
-         release of Debian supports <tt>Breaks</tt>.
-       </p>
-
        <p>
          When one binary package declares that it breaks another,
          <prgn>dpkg</prgn> will refuse to allow the package which
@@ -4303,8 +4535,7 @@ Build-Depends: kernel-headers-2.2.10 [!hurd-i386],
          <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 (once <tt>Breaks</tt> is supported
-         by the stable release of Debian).
+         <tt>Breaks</tt> may be used.
        </p>
       </sect>
 
@@ -4602,21 +4833,6 @@ Replaces: mail-transport-agent
        instead.
       </p>
 
-        <p>                                                                 
-          If your package includes run-time support programs that            
-          do not need to be invoked manually by users, but are               
-          nevertheless required  for the package to function, then it        
-          is recommended that these programs are placed                      
-          (if they are binary) in a subdirectory of                          
-          <file>/usr/lib</file>, preferably under                            
-          <file>/usr/lib/</file><var>package-name</var>.                     
-          If the program is architecture independent, the                    
-          recommendation is for it to be placed in a subdirectory of         
-          <file>/usr/share</file> instead, preferably under                  
-          <file>/usr/share/</file><var>package-name</var>.                     
-        </p>                                                                 
-                                                                            
-
       <p>
        If you have several shared libraries built from the same
        source tree you may lump them all together into a single
@@ -4759,24 +4975,50 @@ Replaces: mail-transport-agent
 
       </sect>
 
-      <sect id="sharedlibs-runtime-progs">
-       <heading>Run-time support programs</heading>
+      <sect id="sharedlibs-support-files">
+       <heading>Shared library support files</heading>
 
-      <p>
-       If your package has some run-time support programs which use
-       the shared library you must not put them in the shared
-       library package.  If you do that then you won't be able to
-       install several versions of the shared library without
-       getting filename clashes.
-      </p>
+       <p>
+         If your package contains files whose names do not change with
+         each change in the library shared object version, you must not
+         put them in the shared library package.  Otherwise, several
+         versions of the shared library cannot be installed at the same
+         time without filename clashes, making upgrades and transitions
+         unnecessarily difficult.
+       </p>
 
-      <p>
-       Instead, either create another package for the runtime binaries
-       (this package might typically be named
-       <package><var>libraryname</var>-runtime</package>; note the absence
-       of the <var>soversion</var> in the package name), or if the
-       development package is small, include them in there.
-      </p>
+       <p>
+         It is recommended that supporting files and run-time support
+         programs that do not need to be invoked manually by users, but
+         are nevertheless required for the package to function, be placed
+         (if they are binary) in a subdirectory of <file>/usr/lib</file>,
+         preferably under <file>/usr/lib/</file><var>package-name</var>.
+         If the program or file is architecture independent, the
+         recommendation is for it to be placed in a subdirectory of
+         <file>/usr/share</file> instead, preferably under
+         <file>/usr/share/</file><var>package-name</var>.  Following the
+         <var>package-name</var> naming convention ensures that the file
+         names change when the shared object version changes.
+       </p>
+
+       <p>
+         Run-time support programs that use the shared library but are
+         not required for the library to function or files used by the
+         shared library that can be used by any version of the shared
+         library package should instead be put in a separate package.
+         This package might typically be named
+         <package><var>libraryname</var>-tools</package>; note the
+         absence of the <var>soversion</var> in the package name.
+       </p>
+
+       <p>
+         Files and support programs only useful when compiling software
+         against the library should be included in the development
+         package for the library.<footnote>
+           For example, a <file><var>package-name</var>-config</file>
+           script or <package>pkg-config</package> configuration files.
+         </footnote>
+       </p>
       </sect>
 
       <sect id="sharedlibs-static">
@@ -5294,23 +5536,16 @@ libbar 1 bar1 (>= 1.0-1)
 
 
        <sect1 id="fhs">
-         <heading>File system Structure</heading>
+         <heading>File System Structure</heading>
 
          <p>
            The location of all installed files and directories must
-           comply with the File system Hierarchy Standard (FHS),
+           comply with the Filesystem Hierarchy Standard (FHS),
            version 2.3, with the exceptions noted below, and except
            where doing so would violate other terms of Debian
            Policy.  The following exceptions to the FHS apply:
 
             <enumlist>
-              <item>
-                <p>
-                  Legacy XFree86 servers are permitted to retain the
-                  configuration file location 
-                  <file>/etc/X11/XF86Config-4</file>.
-                </p>
-              </item>
               <item>
                 <p>
                   The optional rules related to user specific
@@ -5460,7 +5695,7 @@ rmdir /usr/local/share/emacs 2>/dev/null || true
            The <file>/usr/local</file> directory itself and all the
            subdirectories created by the package should (by default) have
            permissions 2775 (group-writable and set-group-id) and be
-           owned by <tt>root.staff</tt>.
+           owned by <tt>root:staff</tt>.
          </p>
        </sect1>
 
@@ -5472,12 +5707,6 @@ rmdir /usr/local/share/emacs 2>/dev/null || true
            by any particular mail agents.  The use of the old
            location <file>/var/spool/mail</file> is deprecated, even
            though the spool may still be physically located there.
-           To maintain partial upgrade compatibility for systems
-           which have <file>/var/spool/mail</file> as their physical mail
-           spool, packages using <file>/var/mail</file> must depend on
-           either <package>libc6</package> (&gt;= 2.1.3-13), or on
-           <package>base-files</package> (&gt;= 2.2.0), or on later
-           versions of either one of these packages.
          </p>
        </sect1>
       </sect>
@@ -5717,13 +5946,6 @@ rmdir /usr/local/share/emacs 2>/dev/null || true
            <tt>K</tt> prefix, but they too are called with the single
            argument <tt>stop</tt>.
          </p>
-
-         <p>
-           Also, if the script name ends in <tt>.sh</tt>, the script
-           will be sourced in runlevel <tt>S</tt> rather than being
-           run in a forked subprocess, but will be explicitly run by
-           <prgn>sh</prgn> in all other runlevels.
-         </p>
        </sect1>
 
        <sect1>
@@ -5767,11 +5989,13 @@ rmdir /usr/local/share/emacs 2>/dev/null || true
 
          <p>
            The <file>init.d</file> scripts must ensure that they will
-           behave sensibly if invoked with <tt>start</tt> when the
-           service is already running, or with <tt>stop</tt> when it
-           isn't, and that they don't kill unfortunately-named user
-           processes.  The best way to achieve this is usually to use
-           <prgn>start-stop-daemon</prgn>.
+           behave sensibly (i.e., returning success and not starting
+           multiple copies of a service) if invoked with <tt>start</tt>
+           when the service is already running, or with <tt>stop</tt>
+           when it isn't, and that they don't kill unfortunately-named
+           user processes.  The best way to achieve this is usually to
+           use <prgn>start-stop-daemon</prgn> with the <tt>--oknodo</tt>
+           option.
          </p>
 
          <p>
@@ -5845,6 +6069,18 @@ test -f <var>program-executed-later-in-script</var> || exit 0
            script must behave sensibly and not fail if the
            <file>/etc/default</file> file is deleted.
          </p>
+
+         <p>
+           <file>/var/run</file> and <file>/var/lock</file> may be mounted
+           as temporary filesystems<footnote>
+               For example, using the <tt>RAMRUN</tt> and <tt>RAMLOCK</tt>
+               options in <file>/etc/default/rcS</file>.
+           </footnote>, so the <file>init.d</file> scripts must handle this
+           correctly. This will typically amount to creating any required
+           subdirectories dynamically when the <file>init.d</file> script
+           is run, rather than including them in the package and relying on
+           <prgn>dpkg</prgn> to create them.
+         </p>
        </sect1>
 
        <sect1>
@@ -6225,12 +6461,13 @@ Reloading <var>description</var> configuration...done.
          via cron, it should place a file with the name of the
          package in one or more of the following directories:
          <example compact="compact">
+/etc/cron.hourly
 /etc/cron.daily
 /etc/cron.weekly
 /etc/cron.monthly
          </example>
          As these directory names imply, the files within them are
-         executed on a daily, weekly, or monthly basis,
+         executed on an hourly, daily, weekly, or monthly basis,
          respectively. The exact times are listed in
          <file>/etc/crontab</file>.</p>
 
@@ -6238,13 +6475,12 @@ Reloading <var>description</var> configuration...done.
          All files installed in any of these directories must be
          scripts (e.g., shell scripts or Perl scripts) so that they
          can easily be modified by the local system administrator.
-         In addition, they should be treated as configuration
-         files.
+         In addition, they must be treated as configuration files.
        </p>
 
        <p>
-         If a certain job has to be executed more frequently than
-         daily, the package should install a file
+         If a certain job has to be executed at some other frequency or
+         at a specific time, the package should install a file
          <file>/etc/cron.d/<var>package</var></file>. This file uses the
          same syntax as <file>/etc/crontab</file> and is processed by
          <prgn>cron</prgn> automatically. The file must also be
@@ -6597,58 +6833,12 @@ INSTALL = install -s # (or use strip on the files in debian/tmp)
 
        <p>
          Although binaries in the build tree should be compiled with
-         debugging information by default, it can often be difficult
-         to debug programs if they are also subjected to compiler
-         optimization.  For this reason, it is recommended to support
-         the standardized environment
-         variable <tt>DEB_BUILD_OPTIONS</tt>.  This variable can
-         contain several flags to change how a package is compiled
-         and built.
-       </p>
-
-       <p>
-         <taglist>
-           <tag>noopt</tag>
-           <item>
-               The presence of this string means that the package
-               should be compiled with a minimum of optimization.
-               For C programs, it is best to add <tt>-O0</tt>
-               to <tt>CFLAGS</tt> (although this is usually the
-               default).  Some programs might fail to build or run at
-               this level of optimization; it may be necessary to
-               use <tt>-O1</tt>, for example.
-           </item>
-           <tag>nostrip</tag>
-           <item>
-               This string means that the debugging symbols should
-               not be stripped from the binary during installation,
-               so that debugging information may be included in the package.
-           </item>
-         </taglist>
-       </p>
-
-       <p>
-         The following makefile snippet is an example of how one may
-          implement the build options; you will probably have to
-          massage this example in order to make it work for your
-          package.
-         <example compact="compact">
-CFLAGS = -Wall -g
-INSTALL = install
-INSTALL_FILE    = $(INSTALL) -p    -o root -g root  -m  644
-INSTALL_PROGRAM = $(INSTALL) -p    -o root -g root  -m  755
-INSTALL_SCRIPT  = $(INSTALL) -p    -o root -g root  -m  755
-INSTALL_DIR     = $(INSTALL) -p -d -o root -g root  -m  755
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-CFLAGS += -O0
-else
-CFLAGS += -O2
-endif
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-INSTALL_PROGRAM += -s
-endif
-         </example>
+         debugging information by default, it can often be difficult to
+         debug programs if they are also subjected to compiler
+         optimization.  For this reason, it is recommended to support the
+         standardized environment variable <tt>DEB_BUILD_OPTIONS</tt>
+         (see <ref id="debianrules-options">).  This variable can contain
+         several flags to change how a package is compiled and built.
        </p>
 
        <p>
@@ -6792,17 +6982,6 @@ strip --strip-unneeded <var>your-lib</var>
          </footnote>
        </p>
 
-       <p>
-         Packages containing shared libraries that may be linked to
-         by other packages' binaries, but which for some
-         <em>compelling</em> reason can not be installed in
-         <file>/usr/lib</file> directory, may install the shared library
-         files in subdirectories of the <file>/usr/lib</file> directory,
-         in which case they should arrange to add that directory in
-         <file>/etc/ld.so.conf</file> in the package's post-installation
-         script, and remove it in the package's post-removal script.
-       </p>
-
        <p>
          An ever increasing number of packages are using
          <prgn>libtool</prgn> to do their linking.  The latest GNU
@@ -6909,18 +7088,19 @@ strip --strip-unneeded <var>your-lib</var>
              support <tt>-a</tt> and <tt>-o</tt> as binary logical
              operators.</item>
            <item><tt>local</tt> to create a scoped variable must be
-             supported; however, <tt>local</tt> may or may not preserve
-             the variable value from an outer scope and may or may not
-             support arguments more complex than simple variables.  Only
-             uses such as:
+             supported, including listing multiple variables in a single
+             local command and assigning a value to a variable at the
+             same time as localizing it.  <tt>local</tt> may or
+             may not preserve the variable value from an outer scope if
+             no assignment is present.  Uses such as:
 <example compact>
 fname () {
-    local a
-    a=''
-    # ... use a ...
+    local a b c=delta d
+    # ... use a, b, c, d ...
 }
 </example>
-              must be supported.
+             must be supported and must set the value of <tt>c</tt> to
+             <tt>delta</tt>.
             </item>
          </list>
          If a shell script requires non-SUSv3 features from the shell
@@ -7089,10 +7269,13 @@ ln -fs ../sbin/sendmail debian/tmp/usr/bin/runq
          </p>
 
          <p>
-           Note that a script that embeds configuration information
-           (such as most of the files in <file>/etc/default</file> and
-           <file>/etc/cron.{daily,weekly,monthly}</file>) is de-facto a
-           configuration file and should be treated as such.
+           As noted elsewhere, <file>/etc/init.d</file> scripts,
+           <file>/etc/default</file> files, scripts installed in
+           <file>/etc/cron.{hourly,daily,weekly,monthly}</file>, and cron
+           configuration installed in <file>/etc/cron.d</file> must be
+           treated as configuration files.  In general, any script that
+           embeds configuration information is de-facto a configuration
+           file and should be treated as such.
          </p>
        </sect1>
 
@@ -7409,7 +7592,7 @@ endscript
        </p>
 
        <p>
-         Files should be owned by <tt>root.root</tt>, and made
+         Files should be owned by <tt>root:root</tt>, and made
          writable only by the owner and universally readable (and
          executable, if appropriate), that is mode 644 or 755.
        </p>
@@ -7910,16 +8093,31 @@ http://localhost/doc/<var>package</var>/<var>filename</var>
        </p>
 
        <p>
-         Mailboxes are generally mode 660
-         <tt><var>user</var>.mail</tt> unless the system
-         administrator has chosen otherwise.  A MUA may remove a
-         mailbox (unless it has nonstandard permissions) in which
-         case the MTA or another MUA must recreate it if needed.
-         Mailboxes must be writable by group mail.
-       </p>
-
-       <p>
-         The mail spool is 2775 <tt>root.mail</tt>, and MUAs should
+         Mailboxes are generally either mode 600 and owned by
+         <var>user</var> or mode 660 and owned by
+         <tt><var>user</var>:mail</tt><footnote>
+           There are two traditional permission schemes for mail spools:
+           mode 600 with all mail delivery done by processes running as
+           the destination user, or mode 660 and owned by group mail with
+           mail delivery done by a process running as a system user in
+           group mail.  Historically, Debian required mode 660 mail
+           spools to enable the latter model, but that model has become
+           increasingly uncommon and the principle of least privilege
+           indicates that mail systems that use the first model should
+           use permissions of 600.  If delivery to programs is permitted,
+           it's easier to keep the mail system secure if the delivery
+           agent runs as the destination user.  Debian Policy therefore
+           permits either scheme.
+         </footnote>. The local system administrator may choose a
+         different permission scheme; packages should not make
+         assumptions about the permission and ownership of mailboxes
+         unless required (such as when creating a new mailbox).  A MUA
+         may remove a mailbox (unless it has nonstandard permissions) in
+         which case the MTA or another MUA must recreate it if needed.
+       </p>
+
+       <p>
+         The mail spool is 2775 <tt>root:mail</tt>, and MUAs should
          be setgid mail to do the locking mentioned above (and
          must obviously avoid accessing other users' mailboxes
          using this privilege).</p>
@@ -8214,11 +8412,6 @@ name ["<var>syshostname</var>"]:
                  </list>
              </item>
 
-             <item>
-                 Speedo fonts must be placed in
-                 <file>/usr/share/fonts/X11/Speedo/</file>.
-             </item>
-
              <item>
                  Type 1 fonts must be placed in
                  <file>/usr/share/fonts/X11/Type1/</file>.  If font
@@ -8230,9 +8423,9 @@ name ["<var>syshostname</var>"]:
                  Subdirectories of <file>/usr/share/fonts/X11/</file>
                  other than those listed above must be neither
                  created nor used.  (The <file>PEX</file>, <file>CID</file>,
-                 and <file>cyrillic</file> directories are excepted for
-                 historical reasons, but installation of files into
-                 these directories remains discouraged.)
+                 <file>Speedo</file>, and <file>cyrillic</file> directories
+                 are excepted for historical reasons, but installation of
+                 files into these directories remains discouraged.)
              </item>
 
              <item>
@@ -8351,8 +8544,7 @@ name ["<var>syshostname</var>"]:
            in the <em>X Toolkit Intrinsics - C Language
            Interface</em> manual is also permitted).  They must be
            registered as <tt>conffile</tt>s or handled as
-           configuration files.  Packages must not provide the
-           directory <file>/usr/X11R6/lib/X11/app-defaults/</file>.
+           configuration files.
          </p>
 
          <p>
@@ -8368,12 +8560,6 @@ name ["<var>syshostname</var>"]:
                are stored in the X server and affect all connecting
                clients.
            </footnote>
-           <em>Important:</em> packages that install files into the
-           <file>/etc/X11/Xresources/</file> directory must conflict with
-           <tt>xbase (&lt;&lt; 3.3.2.3a-2)</tt>; if this is not done
-           it is possible for the installing package to destroy a
-           previously-existing <file>/etc/X11/Xresources</file> file
-           which had been customized by the system administrator.
          </p>
        </sect1>
 
@@ -8517,8 +8703,8 @@ name ["<var>syshostname</var>"]:
          Games which require protected, privileged access to
          high-score files, saved games, etc., may be made
          set-<em>group</em>-id (mode 2755) and owned by
-         <tt>root.games</tt>, and use files and directories with
-         appropriate permissions (770 <tt>root.games</tt>, for
+         <tt>root:games</tt>, and use files and directories with
+         appropriate permissions (770 <tt>root:games</tt>, for
          example).  They must not be made
          set-<em>user</em>-id, as this causes security problems. (If
          an attacker can subvert any set-user-id game they can
@@ -8820,9 +9006,10 @@ install-info --quiet --remove /usr/share/info/foobar.info
        </p>
 
        <p>
-         Packages in the <em>contrib</em> or <em>non-free</em> categories
-         should state in the copyright file that the package is not part
-         of the Debian GNU/Linux distribution and briefly explain why.
+         Packages in the <em>contrib</em> or <em>non-free</em> archive
+         areas should state in the copyright file that the package is not
+         part of the Debian GNU/Linux distribution and briefly explain
+         why.
        </p>
 
        <p>
@@ -8843,8 +9030,8 @@ install-info --quiet --remove /usr/share/info/foobar.info
        <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 (version 1.2) should refer to the corresponding
+         (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>
            <p>
              In particular,
@@ -8855,8 +9042,9 @@ install-info --quiet --remove /usr/share/info/foobar.info
               <file>/usr/share/common-licenses/GPL-3</file>,
               <file>/usr/share/common-licenses/LGPL-2</file>,
               <file>/usr/share/common-licenses/LGPL-2.1</file>,
-              <file>/usr/share/common-licenses/LGPL-3</file>, and
-              <file>/usr/share/common-licenses/GFDL-1.2</file>
+              <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.
             </p>
           </footnote> rather than quoting them in the copyright
@@ -9141,7 +9329,7 @@ install-info --quiet --remove /usr/share/info/foobar.info
          </example>
          To view the copyright file for a package you could use this command:
          <example>
-  dpkg --fsys-tarfile <var>filename</var>.deb | tar xOf - \*/copyright | pager
+  dpkg --fsys-tarfile <var>filename</var>.deb | tar xOf - --wildcards \*/copyright | pager
          </example>
        </p>
       </sect>
@@ -9493,13 +9681,8 @@ install-info --quiet --remove /usr/share/info/foobar.info
          </p>
 
          <p>
-           Its arguments are executables.
+           Its arguments are executables and shared libraries
            <footnote>
-             <p>
-               In a forthcoming dpkg version,
-               <prgn>dpkg-shlibdeps</prgn> would be required to be
-               called on shared libraries as well.
-             </p>
              <p>
                They may be specified either in the locations in the
                source tree where they are created or in the locations
@@ -9547,7 +9730,7 @@ install-info --quiet --remove /usr/share/info/foobar.info
            and then in its main control file <file>debian/control</file>:
            <example>
   <var>...</var>
-  Depends: ${shlibs:Pre-Depends}
+  Depends: ${shlibs:Depends}
   Recommends: ${shlibs:Recommends}
   <var>...</var>
            </example>
@@ -9656,8 +9839,8 @@ install-info --quiet --remove /usr/share/info/foobar.info
           <p>
             This program can be used manually, but is also invoked by
             <tt>dpkg-buildpackage</tt> or <file>debian/rules</file> to set
-            to set environment or make variables which specify the build and
-            host architecture for the package building process.
+            environment or make variables which specify the build and host
+            architecture for the package building process.
           </p>
         </sect1>
       </sect>
@@ -9698,36 +9881,6 @@ install-info --quiet --remove /usr/share/info/foobar.info
            See <ref id="dpkgchangelog">.
          </p>
 
-         <p>
-           It is recommended that the entire changelog be encoded in the
-           <url id="http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc2279.html" name="UTF-8">
-           encoding of
-           <url id="http://www.unicode.org/"
-           name="Unicode">.<footnote>
-             <p>
-               I think it is fairly obvious that we need to
-               eventually transition to UTF-8 for our package
-               infrastructure; it is really the only sane char-set in
-               an international environment.  Now, we can't switch to
-               using UTF-8 for package control fields and the like
-               until dpkg has better support, but one thing we can
-               start doing today is requesting that Debian changelogs
-               are UTF-8 encoded. At some point in time, we can start
-               requiring them to do so. 
-             </p>
-             <p>
-               Checking for non-UTF8 characters in a changelog is
-               trivial.  Dump the file through 
-               <example>iconv -f utf-8 -t ucs-4</example>
-                  discard the output, and check the return
-               value.  If there are any characters in the stream
-               which are invalid UTF-8 sequences, iconv will exit
-               with an error code; and this will be the case for the
-               vast majority of other character sets.
-             </p>
-           </footnote>
-         </p>
-
          <sect2><heading>Defining alternative changelog formats
            </heading>
 
@@ -10440,26 +10593,48 @@ install-info --quiet --remove /usr/share/info/foobar.info
        supposing that a <prgn>smailwrapper</prgn> package wishes to
        install a wrapper around <file>/usr/sbin/smail</file>:
        <example>
-  if [ install = "$1"  ]; then
-     dpkg-divert --package smailwrapper --add --rename \
-        --divert /usr/sbin/smail.real /usr/sbin/smail
-  fi
-       </example> Testing <tt>$1</tt> is necessary so that the script
-       doesn't try to add the diversion again when
-       <prgn>smailwrapper</prgn> is upgraded.  The <tt>--package
-       smailwrapper</tt> ensures that <prgn>smailwrapper</prgn>'s
-       copy of <file>/usr/sbin/smail</file> can bypass the diversion and
-       get installed as the true version.
+   dpkg-divert --package smailwrapper --add --rename \
+      --divert /usr/sbin/smail.real /usr/sbin/smail
+       </example> The <tt>--package smailwrapper</tt> ensures that
+       <prgn>smailwrapper</prgn>'s copy of <file>/usr/sbin/smail</file>
+       can bypass the diversion and get installed as the true version.
+       It's safe to add the diversion unconditionally on upgrades since
+       it will be left unchanged if it already exists, but
+       <prgn>dpkg-divert</prgn> will display a message.  To suppress that
+       message, make the command conditional on the version from which
+       the package is being upgraded:
+       <example>
+   if [ upgrade != "$1" ] || dpkg --compare-versions "$2" lt 1.0-2; then
+      dpkg-divert --package smailwrapper --add --rename \
+         --divert /usr/sbin/smail.real /usr/sbin/smail
+   fi
+       </example> where <tt>1.0-2</tt> is the version at which the
+       diversion was first added to the package.  Running the command
+       during abort-upgrade is pointless but harmless.
       </p>
 
       <p>
        The postrm has to do the reverse:
        <example>
-  if [ remove = "$1" ]; then
+  if [ remove = "$1" -o abort-install = "$1" -o disappear = "$1" ]; then
+     dpkg-divert --package smailwrapper --remove --rename \
+        --divert /usr/sbin/smail.real /usr/sbin/smail
+  fi
+       </example> If the diversion was added at a particular version, the
+       postrm should also handle the failure case of upgrading from an
+       older version (unless the older version is so old that direct
+       upgrades are no longer supported):
+       <example>
+  if [ abort-upgrade = "$1" ] && dpkg --compare-versions "$2" lt 1.0-2; then
      dpkg-divert --package smailwrapper --remove --rename \
         --divert /usr/sbin/smail.real /usr/sbin/smail
   fi
-       </example>
+       </example> where <tt>1.02-2</tt> is the version at which the
+       diversion was first added to the package.  The postrm should not
+       remove the diversion on upgrades both because there's no reason to
+       remove the diversion only to immediately re-add it and since the
+       postrm of the old package is run after unpacking so the removal of
+       the diversion will fail.
       </p>
 
       <p>