]> git.donarmstrong.com Git - debian/debian-policy.git/blobdiff - policy.sgml
Merge branch 'master' into bug522217-rra
[debian/debian-policy.git] / policy.sgml
index 127c6a25bffae9661d5d917e1846b08820cacf91..b27c9da5d95f5bd10a033705f1558344e347d994 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
        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>
            <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.
+         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">
@@ -2435,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">
@@ -2563,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">
@@ -2677,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
@@ -2688,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>
@@ -2720,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>
@@ -3051,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>
 
@@ -3261,8 +3298,9 @@ Package: libc6
          </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 installed
+           size divided by 1024 (in other words, the size in kibibytes)
+           and rounded up.
          </p>
        </sect1>
 
@@ -3425,8 +3463,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>
@@ -4178,6 +4215,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>
@@ -4207,6 +4260,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>
@@ -4394,12 +4450,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
@@ -4484,8 +4534,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>
 
@@ -5486,23 +5535,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
@@ -5664,12 +5706,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>
@@ -5909,13 +5945,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>
@@ -6039,6 +6068,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>
@@ -8062,12 +8103,27 @@ 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.
+         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>
@@ -8366,11 +8422,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
@@ -8382,9 +8433,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>
@@ -8526,54 +8577,34 @@ name ["<var>syshostname</var>"]:
          <heading>Installation directory issues</heading>
 
          <p>
-           Packages using the X Window System should not be
-           configured to install files under the
-           <file>/usr/X11R6/</file> directory. The
-           <file>/usr/X11R6/</file> directory hierarchy should be
+           Historically, packages using the X Window System used a
+           separate set of installation directories from other packages.
+           This practice has been discontinued and packages using the X
+           Window System should now generally be installed in the same
+           directories as any other package.  Specifically, packages must
+           not install files under the <file>/usr/X11R6/</file> directory
+           and the <file>/usr/X11R6/</file> directory hierarchy should be
            regarded as obsolete.
          </p>
 
          <p>
-           Programs that use GNU <prgn>autoconf</prgn> and
-           <prgn>automake</prgn> are usually easily configured at
-           compile time to use <file>/usr/</file> instead of
-           <file>/usr/X11R6/</file>, and this should be done whenever
-           possible.  Configuration files for window managers and
-           display managers should be placed in a subdirectory of
-           <file>/etc/X11/</file> corresponding to the package name due
-           to these programs' tight integration with the mechanisms
-           of the X Window System.  Application-level programs should
-           use the <file>/etc/</file> directory unless otherwise mandated
-           by policy.
+           Include files previously installed under
+           <file>/usr/X11R6/include/X11/</file> should be installed into
+           <file>/usr/include/X11/</file>.  For files previously
+           installed into subdirectories of
+           <file>/usr/X11R6/lib/X11/</file>, package maintainers should
+           determine if subdirectories of <file>/usr/lib/</file> and
+           <file>/usr/share/</file> can be used.  If not, a subdirectory
+           of <file>/usr/lib/X11/</file> should be used.
          </p>
 
          <p>
-           The installation of files into subdirectories
-           of <file>/usr/X11R6/include/X11/</file> and
-           <file>/usr/X11R6/lib/X11/</file> is now prohibited;
-           package maintainers should determine if subdirectories of
-           <file>/usr/lib/</file> and <file>/usr/share/</file> can be used
-           instead. 
-         </p>
-
-         <p>
-            Packages should install any relevant files into the
-           directories <file>/usr/include/X11/</file> and
-           <file>/usr/lib/X11/</file>, but if they do so, they must
-           pre-depend on <tt>x11-common (&gt;=
-           1:7.0.0)</tt><footnote>
-              <p>
-                These libraries used to be all symbolic
-                links. However, with <tt>X11R7</tt>,
-                <tt>/usr/include/X11</tt> and <tt>/usr/lib/X11</tt>
-                are now real directories, and packages
-                <strong>should</strong> ship their files here instead
-                of in <tt>/usr/X11R6/{include,lib}/X11</tt>.
-                <tt>x11-common (&gt;= 1:7.0.0) </tt> is the package
-                responsible for converting these symlinks into
-                directories.
-              </p>
-            </footnote>
+           Configuration files for window managers and display managers
+           should be placed in a subdirectory of <file>/etc/X11/</file>
+           corresponding to the package name due to these programs' tight
+           integration with the mechanisms of the X Window System.
+           Application-level programs should use the <file>/etc/</file>
+           directory unless otherwise mandated by policy.
          </p>
        </sect1>
 
@@ -8965,9 +8996,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>
@@ -8988,8 +9020,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,
@@ -9000,8 +9032,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
@@ -9286,7 +9319,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>
@@ -10577,10 +10610,21 @@ install-info --quiet --remove /usr/share/info/foobar.info
      dpkg-divert --package smailwrapper --remove --rename \
         --divert /usr/sbin/smail.real /usr/sbin/smail
   fi
-       </example> 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.
+       </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> 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>