add another second
[debian-policy.git] / policy / ch-controlfields.rst
blob0ee66849357d8c76c0c2985a0ccc176a3ffce903
1 Control files and their fields
2 ==============================
4 The package management system manipulates data represented in a common
5 format, known as *control data*, stored in *control files*. Control
6 files are used for source packages, binary packages and the ``.changes``
7 files which control the installation of uploaded files.  [#]_
9 .. _s-controlsyntax:
11 Syntax of control files
12 -----------------------
14 A control file consists of one or more paragraphs of fields.  [#]_ The
15 paragraphs are separated by empty lines. Parsers may accept lines
16 consisting solely of spaces and tabs as paragraph separators, but
17 control files should use empty lines. Some control files allow only one
18 paragraph; others allow several, in which case each paragraph usually
19 refers to a different package. (For example, in source packages, the
20 first paragraph refers to the source package, and later paragraphs refer
21 to binary packages generated from the source.) The ordering of the
22 paragraphs in control files is significant.
24 Each paragraph consists of a series of data fields. Each field consists
25 of the field name followed by a colon and then the data/value associated
26 with that field. The field name is composed of US-ASCII characters
27 excluding control characters, space, and colon (i.e., characters in the
28 ranges U+0021 (``!``) through U+0039 (``9``), and U+003B (``;``) through
29 U+007E (``~``), inclusive). Field names must not begin with the comment
30 character (U+0023 ``#``), nor with the hyphen character (U+002D ``-``).
32 The field ends at the end of the line or at the end of the last
33 continuation line (see below). Horizontal whitespace (spaces and tabs)
34 may occur immediately before or after the value and is ignored there; it
35 is conventional to put a single space after the colon. For example, a
36 field might be:
40     Package: libc6
42 the field name is ``Package`` and the field value ``libc6``.
44 Empty field values are only permitted in source package control files
45 (``debian/control``). Such fields are ignored.
47 A paragraph must not contain more than one instance of a particular
48 field name.
50 There are three types of fields:
52 simple
53     The field, including its value, must be a single line. Folding of
54     the field is not permitted. This is the default field type if the
55     definition of the field does not specify a different type.
57 folded
58     The value of a folded field is a logical line that may span several
59     lines. The lines after the first are called continuation lines and
60     must start with a space or a tab. Whitespace, including any
61     newlines, is not significant in the field values of folded fields.  [#]_
63 multiline
64     The value of a multiline field may comprise multiple continuation
65     lines. The first line of the value, the part on the same line as the
66     field name, often has special significance or may have to be empty.
67     Other lines are added following the same syntax as the continuation
68     lines of the folded fields. Whitespace, including newlines, is
69     significant in the values of multiline fields.
71 Whitespace must not appear inside names (of packages, architectures,
72 files or anything else) or version numbers, or between the characters of
73 multi-character version relationships.
75 The presence and purpose of a field, and the syntax of its value may
76 differ between types of control files.
78 Field names are not case-sensitive, but it is usual to capitalize the
79 field names using mixed case as shown below. Field values are
80 case-sensitive unless the description of the field says otherwise.
82 Paragraph separators (empty lines), and lines consisting only of U+0020
83 SPACE and U+0009 TAB, are not allowed within field values or between
84 fields. Empty lines in field values are usually escaped by representing
85 them by a U+0020 SPACE followed by a U+002E (``.``).
87 Lines starting with U+0023 (``#``), without any preceding whitespace,
88 are comment lines that are only permitted in source package control
89 files (``debian/control``). These comment lines are ignored, even
90 between two continuation lines. They do not end logical lines.
92 All control files must be encoded in UTF-8.
94 .. _s-sourcecontrolfiles:
96 Source package control files -- ``debian/control``
97 --------------------------------------------------
99 The ``debian/control`` file contains the most vital (and
100 version-independent) information about the source package and about the
101 binary packages it creates.
103 The first paragraph of the control file contains information about the
104 source package in general. The subsequent paragraphs each describe a
105 binary package that the source tree builds. Each binary package built
106 from this source package has a corresponding paragraph, except for any
107 automatically-generated debug packages that do not require one.
109 The fields in the general paragraph (the first one, for the source
110 package) are:
112 -  :ref:`Source <s-f-Source>` (mandatory)
114 -  :ref:`Maintainer <s-f-Maintainer>` (mandatory)
116 -  :ref:`Uploaders <s-f-Uploaders>`
118 -  :ref:`Section <s-f-Section>` (recommended)
120 -  :ref:`Priority <s-f-Priority>` (recommended)
122 -  :ref:`Build-Depends et al <s-sourcebinarydeps>`
124 -  :ref:`Standards-Version <s-f-Standards-Version>` (recommended)
126 -  :ref:`Homepage <s-f-Homepage>`
128 -  :ref:`Version Control System (VCS) fields <s-f-VCS-fields>`
130 -  :ref:`Testsuite <s-f-Testsuite>`
132 The fields in the binary package paragraphs are:
134 -  :ref:`Package <s-f-Package>` (mandatory)
136 -  :ref:`Architecture <s-f-Architecture>` (mandatory)
138 -  :ref:`Section <s-f-Section>` (recommended)
140 -  :ref:`Priority <s-f-Priority>` (recommended)
142 -  :ref:`Essential <s-f-Essential>`
144 -  :ref:`Depends et al <s-binarydeps>`
146 -  :ref:`Description <s-f-Description>` (mandatory)
148 -  :ref:`Homepage <s-f-Homepage>`
150 -  :ref:`Built-Using <s-built-using>`
152 -  :ref:`Package-Type <s-f-Package-Type>`
154 The syntax and semantics of the fields are described below.
156 These fields are used by ``dpkg-gencontrol`` to generate control files
157 for binary packages (see below), by ``dpkg-genchanges`` to generate the
158 ``.changes`` file to accompany the upload, and by ``dpkg-source`` when
159 it creates the ``.dsc`` source control file as part of a source archive.
160 Some fields are folded in ``debian/control``, but not in any other
161 control file. These tools are responsible for removing the line breaks
162 from such fields when using fields from ``debian/control`` to generate
163 other control files. They are also responsible for discarding empty
164 fields.
166 The fields here may contain variable references - their values will be
167 substituted by ``dpkg-gencontrol``, ``dpkg-genchanges`` or
168 ``dpkg-source`` when they generate output control files. See
169 :ref:`s-substvars` for details.
171 .. _s-binarycontrolfiles:
173 Binary package control files -- ``DEBIAN/control``
174 --------------------------------------------------
176 The ``DEBIAN/control`` file contains the most vital (and
177 version-dependent) information about a binary package. It consists of a
178 single paragraph.
180 The fields in this file are:
182 -  :ref:`Package <s-f-Package>` (mandatory)
184 -  :ref:`Source <s-f-Source>`
186 -  :ref:`Version <s-f-Version>` (mandatory)
188 -  :ref:`Section <s-f-Section>` (recommended)
190 -  :ref:`Priority <s-f-Priority>` (recommended)
192 -  :ref:`Architecture <s-f-Architecture>` (mandatory)
194 -  :ref:`Essential <s-f-Essential>`
196 -  :ref:`Depends et al <s-binarydeps>`
198 -  :ref:`Installed-Size <s-f-Installed-Size>`
200 -  :ref:`Maintainer <s-f-Maintainer>` (mandatory)
202 -  :ref:`Description <s-f-Description>` (mandatory)
204 -  :ref:`Homepage <s-f-Homepage>`
206 -  :ref:`Built-Using <s-built-using>`
208 .. _s-debiansourcecontrolfiles:
210 Debian source control files -- ``.dsc``
211 ---------------------------------------
213 This file consists of a single paragraph, possibly surrounded by a PGP
214 signature. The fields of that paragraph are listed below. Their syntax
215 is described above, in :ref:`s-controlsyntax`.
217 -  :ref:`Format <s-f-Format>` (mandatory)
219 -  :ref:`Source <s-f-Source>` (mandatory)
221 -  :ref:`Binary <s-f-Binary>`
223 -  :ref:`Architecture <s-f-Architecture>`
225 -  :ref:`Version <s-f-Version>` (mandatory)
227 -  :ref:`Maintainer <s-f-Maintainer>` (mandatory)
229 -  :ref:`Uploaders <s-f-Uploaders>`
231 -  :ref:`Homepage <s-f-Homepage>`
233 -  :ref:`Version Control System (VCS) fields <s-f-VCS-fields>`
235 -  :ref:`Testsuite <s-f-Testsuite>`
237 -  :ref:`Dgit <s-f-Dgit>`
239 -  :ref:`Standards-Version <s-f-Standards-Version>` (recommended)
241 -  :ref:`Build-Depends et al <s-sourcebinarydeps>`
243 -  :ref:`Package-List <s-f-Package-List>` (recommended)
245 -  :ref:`Checksums-Sha1 and Checksums-Sha256 <s-f-Checksums>`
246    (mandatory)
248 -  :ref:`Files <s-f-Files>` (mandatory)
250 The Debian source control file is generated by ``dpkg-source`` when it
251 builds the source archive, from other files in the source package,
252 described above. When unpacking, it is checked against the files and
253 directories in the other parts of the source package.
255 .. _s-debianchangesfiles:
257 Debian changes files -- ``.changes``
258 ------------------------------------
260 The ``.changes`` files are used by the Debian archive maintenance
261 software to process updates to packages. They consist of a single
262 paragraph, possibly surrounded by a PGP signature. That paragraph
263 contains information from the ``debian/control`` file and other data
264 about the source package gathered via ``debian/changelog`` and
265 ``debian/rules``.
267 ``.changes`` files have a format version that is incremented whenever
268 the documented fields or their meaning change. This document describes
269 format 1.8.
271 The fields in this file are:
273 -  :ref:`Format <s-f-Format>` (mandatory)
275 -  :ref:`Date <s-f-Date>` (mandatory)
277 -  :ref:`Source <s-f-Source>` (mandatory)
279 -  :ref:`Binary <s-f-Binary>` (mandatory)
281 -  :ref:`Architecture <s-f-Architecture>` (mandatory)
283 -  :ref:`Version <s-f-Version>` (mandatory)
285 -  :ref:`Distribution <s-f-Distribution>` (mandatory)
287 -  :ref:`Urgency <s-f-Urgency>` (recommended)
289 -  :ref:`Maintainer <s-f-Maintainer>` (mandatory)
291 -  :ref:`Changed-By <s-f-Changed-By>`
293 -  :ref:`Description <s-f-Description>` (mandatory)
295 -  :ref:`Closes <s-f-Closes>`
297 -  :ref:`Changes <s-f-Changes>` (mandatory)
299 -  :ref:`Checksums-Sha1 and Checksums-Sha256 <s-f-Checksums>`
300    (mandatory)
302 -  :ref:`Files <s-f-Files>` (mandatory)
304 .. _s-controlfieldslist:
306 List of fields
307 --------------
309 .. _s-f-Source:
311 ``Source``
312 ~~~~~~~~~~
314 This field identifies the source package name.
316 In ``debian/control`` or a ``.dsc`` file, this field must contain only
317 the name of the source package.
319 In a binary package control file or a ``.changes`` file, the source
320 package name may be followed by a version number in parentheses.  [#]_
321 This version number may be omitted (and is, by ``dpkg-gencontrol``) if
322 it has the same value as the ``Version`` field of the binary package in
323 question. The field itself may be omitted from a binary package control
324 file when the source package has the same name and version as the binary
325 package.
327 Package names (both source and binary, see
328 :ref:`s-f-Package`) must consist only of lower case
329 letters (``a-z``), digits (``0-9``), plus (``+``) and minus (``-``)
330 signs, and periods (``.``). They must be at least two characters long
331 and must start with an alphanumeric character.
333 .. _s-f-Maintainer:
335 ``Maintainer``
336 ~~~~~~~~~~~~~~
338 The package maintainer's name and email address. The name must come
339 first, then the email address inside angle brackets ``<>`` (in RFC822
340 format).
342 If the maintainer's name contains a full stop then the whole field will
343 not work directly as an email address due to a misfeature in the syntax
344 specified in RFC822; a program using this field as an address must check
345 for this and correct the problem if necessary (for example by putting
346 the name in round brackets and moving it to the end, and bringing the
347 email address forward).
349 See :ref:`s-maintainer` for additional requirements and
350 information about package maintainers.
352 .. _s-f-Uploaders:
354 ``Uploaders``
355 ~~~~~~~~~~~~~
357 List of the names and email addresses of co-maintainers of the package,
358 if any. If the package has other maintainers besides the one named in
359 the :ref:`Maintainer field <s-f-Maintainer>`, their names and email
360 addresses should be listed here. The format of each entry is the same as
361 that of the Maintainer field, and multiple entries must be comma
362 separated.
364 This is normally an optional field, but if the ``Maintainer`` control
365 field names a group of people and a shared email address, the
366 ``Uploaders`` field must be present and must contain at least one human
367 with their personal email address.
369 The Uploaders field in ``debian/control`` can be folded.
371 .. _s-f-Changed-By:
373 ``Changed-By``
374 ~~~~~~~~~~~~~~
376 The name and email address of the person who prepared this version of
377 the package, usually a maintainer. The syntax is the same as for the
378 :ref:`Maintainer field <s-f-Maintainer>`.
380 .. _s-f-Section:
382 ``Section``
383 ~~~~~~~~~~~
385 This field specifies an application area into which the package has been
386 classified. See :ref:`s-subsections`.
388 When it appears in the ``debian/control`` file, it gives the value for
389 the subfield of the same name in the ``Files`` field of the ``.changes``
390 file. It also gives the default for the same field in the binary
391 packages.
393 .. _s-f-Priority:
395 ``Priority``
396 ~~~~~~~~~~~~
398 This field represents how important it is that the user have the package
399 installed. See :ref:`s-priorities`.
401 When it appears in the ``debian/control`` file, it gives the value for
402 the subfield of the same name in the ``Files`` field of the ``.changes``
403 file. It also gives the default for the same field in the binary
404 packages.
406 .. _s-f-Package:
408 ``Package``
409 ~~~~~~~~~~~
411 The name of the binary package.
413 Binary package names must follow the same syntax and restrictions as
414 source package names. See :ref:`s-f-Source` for the
415 details.
417 .. _s-f-Architecture:
419 ``Architecture``
420 ~~~~~~~~~~~~~~~~
422 Depending on context and the control file used, the ``Architecture``
423 field can include the following sets of values:
425 -  A unique single word identifying a Debian machine architecture as
426    described in :ref:`s-arch-spec`.
428 -  An architecture wildcard identifying a set of Debian machine
429    architectures, see :ref:`s-arch-wildcard-spec`.
430    ``any`` matches all Debian machine architectures and is the most
431    frequently used.
433 -  ``all``, which indicates an architecture-independent package.
435 -  ``source``, which indicates a source package.
437 In the main ``debian/control`` file in the source package, this field
438 may contain the special value ``all``, the special architecture wildcard
439 ``any``, or a list of specific and wildcard architectures separated by
440 spaces. If ``all`` or ``any`` appears, that value must be the entire
441 contents of the field. Most packages will use either ``all`` or ``any``.
443 Specifying a specific list of architectures indicates that the source
444 will build an architecture-dependent package only on architectures
445 included in the list. Specifying a list of architecture wildcards
446 indicates that the source will build an architecture-dependent package
447 on only those architectures that match any of the specified architecture
448 wildcards. Specifying a list of architectures or architecture wildcards
449 other than ``any`` is for the minority of cases where a program is not
450 portable or is not useful on some architectures. Where possible, the
451 program should be made portable instead.
453 In the Debian source control file ``.dsc``, this field contains a list
454 of architectures and architecture wildcards separated by spaces. When
455 the list contains the architecture wildcard ``any``, the only other
456 value allowed in the list is ``all``.
458 The list may include (or consist solely of) the special value ``all``.
459 In other words, in ``.dsc`` files unlike the ``debian/control``, ``all``
460 may occur in combination with specific architectures. The
461 ``Architecture`` field in the Debian source control file ``.dsc`` is
462 generally constructed from the ``Architecture`` fields in the
463 ``debian/control`` in the source package.
465 Specifying only ``any`` indicates that the source package isn't
466 dependent on any particular architecture and should compile fine on any
467 one. The produced binary package(s) will be specific to whatever the
468 current build architecture is.
470 Specifying only ``all`` indicates that the source package will only
471 build architecture-independent packages.
473 Specifying ``any all`` indicates that the source package isn't dependent
474 on any particular architecture. The set of produced binary packages will
475 include at least one architecture-dependent package and one
476 architecture-independent package.
478 Specifying a list of architectures or architecture wildcards indicates
479 that the source will build an architecture-dependent package, and will
480 only work correctly on the listed or matching architectures. If the
481 source package also builds at least one architecture-independent
482 package, ``all`` will also be included in the list.
484 In a ``.changes`` file, the ``Architecture`` field lists the
485 architecture(s) of the package(s) currently being uploaded. This will be
486 a list; if the source for the package is also being uploaded, the
487 special entry ``source`` is also present. ``all`` will be present if any
488 architecture-independent packages are being uploaded. Architecture
489 wildcards such as ``any`` must never occur in the ``Architecture`` field
490 in the ``.changes`` file.
492 See :ref:`s-debianrules` for information on how to get
493 the architecture for the build process.
495 .. _s-f-Essential:
497 ``Essential``
498 ~~~~~~~~~~~~~
500 This is a boolean field which may occur only in the control file of a
501 binary package or in a per-package fields paragraph of a source package
502 control file.
504 If set to ``yes`` then the package management system will refuse to
505 remove the package (upgrading and replacing it is still possible). The
506 other possible value is ``no``, which is the same as not having the
507 field at all.
509 .. _s5.6.10:
511 Package interrelationship fields: ``Depends``, ``Pre-Depends``, ``Recommends``, ``Suggests``, ``Breaks``, ``Conflicts``, ``Provides``, ``Replaces``, ``Enhances``
512 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
514 These fields describe the package's relationships with other packages.
515 Their syntax and semantics are described in
516 :doc:`Declaring relationships between packages <ch-relationships>`.
518 .. _s-f-Standards-Version:
520 ``Standards-Version``
521 ~~~~~~~~~~~~~~~~~~~~~
523 The most recent version of the standards (the policy manual and
524 associated texts) with which the package complies.
526 The version number has four components: major and minor version number
527 and major and minor patch level. When the standards change in a way that
528 requires every package to change the major number will be changed.
529 Significant changes that will require work in many packages will be
530 signaled by a change to the minor number. The major patch level will be
531 changed for any change to the meaning of the standards, however small;
532 the minor patch level will be changed when only cosmetic, typographical
533 or other edits are made which neither change the meaning of the document
534 nor affect the contents of packages.
536 Thus only the first three components of the policy version are
537 significant in the *Standards-Version* control field, and so either
538 these three components or all four components may be specified. [#]_
540 .. _s-f-Version:
542 ``Version``
543 ~~~~~~~~~~~
545 The version number of a package. The format is:
546 ``[epoch:]upstream_version[-debian_revision]``.
548 The three components here are:
550 ``epoch``
551     This is a single (generally small) unsigned integer. It may be
552     omitted, in which case zero is assumed. If it is omitted then the
553     ``upstream_version`` may not contain any colons.
555     It is provided to allow mistakes in the version numbers of older
556     versions of a package, and also a package's previous version
557     numbering schemes, to be left behind.
559 ``upstream_version``
560     This is the main part of the version number. It is usually the
561     version number of the original ("upstream") package from which the
562     ``.deb`` file has been made, if this is applicable. Usually this
563     will be in the same format as that specified by the upstream
564     author(s); however, it may need to be reformatted to fit into the
565     package management system's format and comparison scheme.
567     The comparison behavior of the package management system with
568     respect to the ``upstream_version`` is described below. The
569     ``upstream_version`` portion of the version number is mandatory.
571     The ``upstream_version`` may contain only alphanumerics [#]_ and
572     the characters ``.`` ``+`` ``-`` ``~`` (full stop, plus, hyphen,
573     tilde) and should start with a digit. If there is no
574     ``debian_revision`` then hyphens are not allowed.
576 ``debian_revision`` This part of the version number specifies the
577     version of the Debian package based on the upstream version. It
578     may contain only alphanumerics and the characters ``+`` ``.``
579     ``~`` (plus, full stop, tilde) and is compared in the same way as
580     the ``upstream_version`` is.
582     It is optional; if it isn't present then the ``upstream_version``
583     may not contain a hyphen. This format represents the case where a
584     piece of software was written specifically to be a Debian package,
585     where the Debian package source must always be identical to the
586     pristine source and therefore no revision indication is required.
588     It is conventional to restart the ``debian_revision`` at ``1``
589     each time the ``upstream_version`` is increased.
591     The package management system will break the version number apart
592     at the last hyphen in the string (if there is one) to determine
593     the ``upstream_version`` and ``debian_revision``. The absence of a
594     ``debian_revision`` is equivalent to a ``debian_revision`` of
595     ``0``.
597 When comparing two version numbers, first the epoch of each are
598 compared, then the ``upstream_version`` if epoch is equal, and then
599 ``debian_revision`` if ``upstream_version`` is also equal. epoch is compared
600 numerically. The ``upstream_version`` and ``debian_revision`` parts are
601 compared by the package management system using the following algorithm:
603 The strings are compared from left to right.
605 First the initial part of each string consisting entirely of non-digit
606 characters is determined. These two parts (one of which may be empty)
607 are compared lexically. If a difference is found it is returned. The
608 lexical comparison is a comparison of ASCII values modified so that all
609 the letters sort earlier than all the non-letters and so that a tilde
610 sorts before anything, even the end of a part. For example, the
611 following parts are in sorted order from earliest to latest: ``~~``,
612 ``~~a``, ``~``, the empty part, ``a``. [#]_
614 Then the initial part of the remainder of each string which consists
615 entirely of digit characters is determined. The numerical values of
616 these two parts are compared, and any difference found is returned as
617 the result of the comparison. For these purposes an empty string (which
618 can only occur at the end of one or both version strings being compared)
619 counts as zero.
621 These two steps (comparing and removing initial non-digit strings and
622 initial digit strings) are repeated until a difference is found or both
623 strings are exhausted.
625 Note that the purpose of epochs is to allow us to leave behind mistakes
626 in version numbering, and to cope with situations where the version
627 numbering scheme changes. It is *not* intended to cope with version
628 numbers containing strings of letters which the package management
629 system cannot interpret (such as ``ALPHA`` or ``pre-``), or with silly
630 orderings.  [#]_
632 .. _s-f-Description:
634 ``Description``
635 ~~~~~~~~~~~~~~~
637 In a source or binary control file, the ``Description`` field contains a
638 description of the binary package, consisting of two parts, the synopsis
639 or the short description, and the long description. It is a multiline
640 field with the following format:
644     Description: single line synopsis
645      extended description over several lines
647 The lines in the extended description can have these formats:
649 -  Those starting with a single space are part of a paragraph.
650    Successive lines of this form will be word-wrapped when displayed.
651    The leading space will usually be stripped off. The line must contain
652    at least one non-whitespace character.
654 -  Those starting with two or more spaces. These will be displayed
655    verbatim. If the display cannot be panned horizontally, the
656    displaying program will line wrap them "hard" (i.e., without taking
657    account of word breaks). If it can they will be allowed to trail off
658    to the right. None, one or two initial spaces may be deleted, but the
659    number of spaces deleted from each line will be the same (so that you
660    can have indenting work correctly, for example). The line must
661    contain at least one non-whitespace character.
663 -  Those containing a single space followed by a single full stop
664    character. These are rendered as blank lines. This is the *only* way
665    to get a blank line.  [#]_
667 -  Those containing a space, a full stop and some more characters. These
668    are for future expansion. Do not use them.
670 Do not use tab characters. Their effect is not predictable.
672 See :ref:`s-descriptions` for further information on
673 this.
675 In a ``.changes`` file, the ``Description`` field contains a summary of
676 the descriptions for the packages being uploaded. For this case, the
677 first line of the field value (the part on the same line as
678 ``Description:``) is always empty. It is a multiline field, with one
679 line per package. Each line is indented by one space and contains the
680 name of a binary package, a space, a hyphen (``-``), a space, and the
681 short description line from that package.
683 .. _s-f-Distribution:
685 ``Distribution``
686 ~~~~~~~~~~~~~~~~
688 In a ``.changes`` file or parsed changelog output this contains the
689 (space-separated) name(s) of the distribution(s) where this version of
690 the package should be installed. Valid distributions are determined by
691 the archive maintainers.  [#]_ The Debian archive software only
692 supports listing a single distribution. Migration of packages to other
693 distributions is handled outside of the upload process.
695 .. _s-f-Date:
697 ``Date``
698 ~~~~~~~~
700 This field includes the date the package was built or last edited. It
701 must be in the same format as the date in a ``debian/changelog`` entry.
703 The value of this field is usually extracted from the
704 ``debian/changelog`` file - see :ref:`s-dpkgchangelog`).
706 .. _s-f-Format:
708 ``Format``
709 ~~~~~~~~~~
711 In |changes link|_ files, this field declares the format version of
712 that file. The syntax of the field value is the same as that of a
713 :ref:`package version number <s-f-Version>` except that no epoch or
714 Debian revision is allowed. The format described in this document is
715 1.8.
717 In |dsc link|_ files, this field declares the format of the source
718 package. The field value is used by programs acting on a source
719 package to interpret the list of files in the source package and
720 determine how to unpack it. The syntax of the field value is a numeric
721 major revision, a period, a numeric minor revision, and then an
722 optional subtype after whitespace, which if specified is an
723 alphanumeric word in parentheses. The subtype is optional in the
724 syntax but may be mandatory for particular source format revisions.
725 [#]_
727 .. |changes link| replace:: ``.changes``
728 .. _changes link: #s-debianchangesfiles
729 .. |dsc link| replace:: ``.dsc`` Debian source control
730 .. _dsc link: #s-debiansourcecontrolfiles
732 .. _s-f-Urgency:
734 ``Urgency``
735 ~~~~~~~~~~~
737 This is a description of how important it is to upgrade to this version
738 from previous ones. It consists of a single keyword taking one of the
739 values ``low``, ``medium``, ``high``, ``emergency``, or ``critical``
740 [#]_ (not case-sensitive) followed by an optional commentary
741 (separated by a space) which is usually in parentheses. For example:
745     Urgency: low (HIGH for users of diversions)
747 The value of this field is usually extracted from the
748 ``debian/changelog`` file - see :ref:`s-dpkgchangelog`.
750 .. _s-f-Changes:
752 ``Changes``
753 ~~~~~~~~~~~
755 This multiline field contains the human-readable changes data,
756 describing the differences between the last version and the current one.
758 The first line of the field value (the part on the same line as
759 ``Changes:``) is always empty. The content of the field is expressed as
760 continuation lines, with each line indented by at least one space. Blank
761 lines must be represented by a line consisting only of a space and a
762 full stop (``.``).
764 The value of this field is usually extracted from the
765 ``debian/changelog`` file - see :ref:`s-dpkgchangelog`.
767 Each version's change information should be preceded by a "title" line
768 giving at least the version, distribution(s) and urgency, in a
769 human-readable way.
771 If data from several versions is being returned the entry for the most
772 recent version should be returned first, and entries should be separated
773 by the representation of a blank line (the "title" line may also be
774 followed by the representation of a blank line).
776 .. _s-f-Binary:
778 ``Binary``
779 ~~~~~~~~~~
781 This folded field is a list of binary packages. Its syntax and meaning
782 varies depending on the control file in which it appears.
784 When it appears in the ``.dsc`` file, it lists binary packages which a
785 source package can produce, separated by commas [#]_. The source
786 package does not necessarily produce all of these binary packages for
787 every architecture. The source control file doesn't contain details of
788 which architectures are appropriate for which of the binary packages.
790 When it appears in a ``.changes`` file, it lists the names of the binary
791 packages being uploaded, separated by whitespace (not commas).
793 .. _s-f-Installed-Size:
795 ``Installed-Size``
796 ~~~~~~~~~~~~~~~~~~
798 This field appears in the control files of binary packages, and in the
799 ``Packages`` files. It gives an estimate of the total amount of disk
800 space required to install the named package. Actual installed size may
801 vary based on block size, file system properties, or actions taken by
802 package maintainer scripts.
804 The disk space is given as the integer value of the estimated installed
805 size in bytes, divided by 1024 and rounded up.
807 .. _s-f-Files:
809 ``Files``
810 ~~~~~~~~~
812 This field contains a list of files with information about each one. The
813 exact information and syntax varies with the context.
815 In all cases, Files is a multiline field. The first line of the field
816 value (the part on the same line as ``Files:``) is always empty. The
817 content of the field is expressed as continuation lines, one line per
818 file. Each line must be indented by one space and contain a number of
819 sub-fields, separated by spaces, as described below.
821 In the ``.dsc`` file, each line contains the MD5 checksum, size and
822 filename of the tar file and (if applicable) diff file which make up the
823 remainder of the source package.  [#]_ For example:
827     Files:
828      c6f698f19f2a2aa07dbb9bbda90a2754 571925 example_1.2.orig.tar.gz
829      938512f08422f3509ff36f125f5873ba 6220 example_1.2-1.diff.gz
831 The exact forms of the filenames are described in
832 :ref:`s-pkg-sourcearchives`.
834 In the ``.changes`` file this contains one line per file being uploaded.
835 Each line contains the MD5 checksum, size, section and priority and the
836 filename. For example:
840     Files:
841      4c31ab7bfc40d3cf49d7811987390357 1428 text extra example_1.2-1.dsc
842      c6f698f19f2a2aa07dbb9bbda90a2754 571925 text extra example_1.2.orig.tar.gz
843      938512f08422f3509ff36f125f5873ba 6220 text extra example_1.2-1.diff.gz
844      7c98fe853b3bbb47a00e5cd129b6cb56 703542 text extra example_1.2-1_i386.deb
846 The :ref:`section <s-f-Section>` and :ref:`priority <s-f-Priority>` are the
847 values of the corresponding fields in the main source control file. If
848 no section or priority is specified then ``-`` should be used, though
849 section and priority values must be specified for new packages to be
850 installed properly.
852 The special value ``byhand`` for the section in a ``.changes`` file
853 indicates that the file in question is not an ordinary package file and
854 must be installed by hand by the distribution maintainers. If the
855 section is ``byhand`` the priority should be ``-``.
857 If a new Debian revision of a package is being shipped and no new
858 original source archive is being distributed the ``.dsc`` must still
859 contain the ``Files`` field entry for the original source archive
860 ``package_upstream-version.orig.tar.gz``, but the ``.changes`` file
861 should leave it out. In this case the original source archive on the
862 distribution site must match exactly, byte-for-byte, the original source
863 archive which was used to generate the ``.dsc`` file and diff which are
864 being uploaded.
866 .. _s-f-Closes:
868 ``Closes``
869 ~~~~~~~~~~
871 A space-separated list of bug report numbers that the upload governed by
872 the .changes file closes.
874 .. _s-f-Homepage:
876 ``Homepage``
877 ~~~~~~~~~~~~
879 The URL of the web site for this package, preferably (when applicable)
880 the site from which the original source can be obtained and any
881 additional upstream documentation or information may be found. The
882 content of this field is a simple URL without any surrounding characters
883 such as ``<>``.
885 .. _s-f-Checksums:
887 ``Checksums-Sha1`` and ``Checksums-Sha256``
888 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
890 These multiline fields contain a list of files with a checksum and size
891 for each one. Both ``Checksums-Sha1`` and ``Checksums-Sha256`` have the
892 same syntax and differ only in the checksum algorithm used: SHA-1 for
893 ``Checksums-Sha1`` and SHA-256 for ``Checksums-Sha256``.
895 ``Checksums-Sha1`` and ``Checksums-Sha256`` are multiline fields. The
896 first line of the field value (the part on the same line as
897 ``Checksums-Sha1:`` or ``Checksums-Sha256:``) is always empty. The
898 content of the field is expressed as continuation lines, one line per
899 file. Each line consists of the checksum, a space, the file size, a
900 space, and the file name. For example (from a ``.changes`` file):
904     Checksums-Sha1:
905      1f418afaa01464e63cc1ee8a66a05f0848bd155c 1276 example_1.0-1.dsc
906      a0ed1456fad61116f868b1855530dbe948e20f06 171602 example_1.0.orig.tar.gz
907      5e86ecf0671e113b63388dac81dd8d00e00ef298 6137 example_1.0-1.debian.tar.gz
908      71a0ff7da0faaf608481195f9cf30974b142c183 548402 example_1.0-1_i386.deb
909     Checksums-Sha256:
910      ac9d57254f7e835bed299926fd51bf6f534597cc3fcc52db01c4bffedae81272 1276 example_1.0-1.dsc
911      0d123be7f51e61c4bf15e5c492b484054be7e90f3081608a5517007bfb1fd128 171602 example_1.0.orig.tar.gz
912      f54ae966a5f580571ae7d9ef5e1df0bd42d63e27cb505b27957351a495bc6288 6137 example_1.0-1.debian.tar.gz
913      3bec05c03974fdecd11d020fc2e8250de8404867a8a2ce865160c250eb723664 548402 example_1.0-1_i386.deb
915 In the ``.dsc`` file, these fields list all files that make up the
916 source package. In the ``.changes`` file, these fields list all files
917 being uploaded. The list of files in these fields must match the list of
918 files in the ``Files`` field.
920 .. _s5.6.25:
922 ``DM-Upload-Allowed``
923 ~~~~~~~~~~~~~~~~~~~~~
925 Obsolete, see :ref:`below <s-f-DM-Upload-Allowed>`.
927 .. _s-f-VCS-fields:
929 Version Control System (VCS) fields
930 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
932 Debian source packages are increasingly developed using VCSs. The
933 purpose of the following fields is to indicate a publicly accessible
934 repository where the Debian source package is developed.
936 ``Vcs-Browser``
937     URL of a web interface for browsing the repository.
939 ``Vcs-<type>``
940     The field name identifies the VCS. The field's value uses the version
941     control system's conventional syntax for describing repository
942     locations and should be sufficient to locate the repository used for
943     packaging. Ideally, it also locates the branch used for development of
944     new versions of the Debian package.
946     The following values for <type> are supported, with the corresponding
947     VCS indicated in parentheses if it isn't obvious:
949     - Arch
950     - Bzr (Bazaar)
951     - Cvs (CVS)
952     - Darcs
953     - Git
954     - Hg (Mercurial)
955     - Mtn (Monotone)
956     - Svn (Subversion)
958     In the case of Git, the value consists of a URL, optionally followed
959     by the word ``-b`` and the name of a branch in the indicated
960     repository, following the syntax of the ``git clone`` command. If no
961     branch is specified, the packaging should be on the default branch.
963     More than one different VCS may be specified for the same package.
965 .. _s-f-Package-List:
967 ``Package-List``
968 ~~~~~~~~~~~~~~~~
970 Multiline field listing all the packages that can be built from the
971 source package, considering every architecture. The first line of the
972 field value is empty. Each one of the next lines describes one binary
973 package, by listing its name, type, section and priority separated by
974 spaces. Fifth and subsequent space-separated items may be present and
975 parsers must allow them. See the :ref:`Package-Type <s-f-Package-Type>`
976 field for a list of package types.
978 .. _s-f-Package-Type:
980 ``Package-Type``
981 ~~~~~~~~~~~~~~~~
983 Simple field containing a word indicating the type of package: ``deb``
984 for binary packages and ``udeb`` for micro binary packages. Other types
985 not defined here may be indicated. In source package control files, the
986 ``Package-Type`` field should be omitted instead of giving it a value of
987 ``deb``, as this value is assumed for paragraphs lacking this field.
989 .. _s-f-Dgit:
991 ``Dgit``
992 ~~~~~~~~
994 Folded field containing a single git commit hash, presented in full,
995 followed optionally by whitespace and other data to be defined in future
996 extensions.
998 Declares that the source package corresponds exactly to a referenced
999 commit in a Git repository available at the canonical location called
1000 *dgit-repos*, used by ``dgit``, a bidirectional gateway between the
1001 Debian archive and Git. The commit is reachable from at least one
1002 reference whose name matches ``refs/dgit/*``. See the manual page of
1003 ``dgit`` for further details.
1005 .. _s-f-Testsuite:
1007 ``Testsuite``
1008 ~~~~~~~~~~~~~
1010 Simple field containing a comma-separated list of values allowing test
1011 execution environments to discover packages which provide tests.
1013 This field is automatically added to Debian source control files
1014 (``.dsc``) by ``dpkg``, with the value ``autopkgtest``, when a
1015 ``debian/tests/control`` file is present in the source package. This
1016 field may also be used in source package control files
1017 (``debian/control``) if needed in other situations.
1019 .. _s5.7:
1021 User-defined fields
1022 -------------------
1024 Additional user-defined fields may be added to the source package
1025 control file. Such fields will be ignored, and not copied to (for
1026 example) binary or Debian source control files or upload control files.
1028 If you wish to add additional unsupported fields to these output files
1029 you should use the mechanism described here.
1031 Fields in the main source control information file with names starting
1032 ``X``, followed by one or more of the letters ``BCS`` and a hyphen
1033 ``-``, will be copied to the output files. Only the part of the field
1034 name after the hyphen will be used in the output file. Where the letter
1035 ``B`` is used the field will appear in binary package control files,
1036 where the letter ``S`` is used in Debian source control files and where
1037 ``C`` is used in upload control (``.changes``) files.
1039 For example, if the main source information control file contains the
1040 field
1044     XBS-Comment: I stand between the candle and the star.
1046 then the binary and Debian source control files will contain the field
1050     Comment: I stand between the candle and the star.
1052 .. _s-obsolete-control-data-fields:
1054 Obsolete fields
1055 ---------------
1057 The following fields have been obsoleted and may be found in packages
1058 conforming with previous versions of the Policy.
1060 .. _s-f-DM-Upload-Allowed:
1062 ``DM-Upload-Allowed``
1063 ~~~~~~~~~~~~~~~~~~~~~
1065 Indicates that Debian Maintainers may upload this package to the Debian
1066 archive. The only valid value is ``yes``. This field was used to
1067 regulate uploads by Debian Maintainers, See the General Resolution
1068 `Endorse the concept of Debian
1069 Maintainers <https://www.debian.org/vote/2007/vote_003>`_ for more
1070 details.
1072 .. [#]
1073    ``dpkg``'s internal databases are in a similar format.
1075 .. [#]
1076    The paragraphs are also sometimes referred to as stanzas.
1078 .. [#]
1079    This folding method is similar to RFC 5322, allowing control files
1080    that contain only one paragraph and no multiline fields to be read by
1081    parsers written for RFC 5322.
1083 .. [#]
1084    It is customary to leave a space after the package name if a version
1085    number is specified.
1087 .. [#]
1088    In the past, people specified the full version number in the
1089    Standards-Version field, for example "2.3.0.0". Since minor
1090    patch-level changes don't introduce new policy, it was thought it
1091    would be better to relax policy and only require the first 3
1092    components to be specified, in this example "2.3.0". All four
1093    components may still be used if someone wishes to do so.
1095 .. [#]
1096    Alphanumerics are ``A-Za-z0-9`` only.
1098 .. [#]
1099    One common use of ``~`` is for upstream pre-releases. For example,
1100    ``1.0~beta1~svn1245`` sorts earlier than ``1.0~beta1``, which sorts
1101    earlier than ``1.0``.
1103 .. [#]
1104    The author of this manual has heard of a package whose versions went
1105    ``1.1``, ``1.2``, ``1.3``, ``1``, ``2.1``, ``2.2``, ``2`` and so
1106    forth.
1108 .. [#]
1109    Completely empty lines will not be rendered as blank lines. Instead,
1110    they will cause the parser to think you're starting a whole new
1111    record in the control file, and will therefore likely abort with an
1112    error.
1114 .. [#]
1115    Example distribution names in the Debian archive used in ``.changes``
1116    files are:
1118    *unstable*
1119        This distribution value refers to the *developmental* part of the
1120        Debian distribution tree. Most new packages, new upstream
1121        versions of packages and bug fixes go into the *unstable*
1122        directory tree.
1124    *experimental*
1125        The packages with this distribution value are deemed by their
1126        maintainers to be high risk. Oftentimes they represent early beta
1127        or developmental packages from various sources that the
1128        maintainers want people to try, but are not ready to be a part of
1129        the other parts of the Debian distribution tree.
1131    Others are used for updating stable releases or for security uploads.
1132    More information is available in the Debian Developer's Reference,
1133    section "The Debian archive".
1135 .. [#]
1136    The source formats currently supported by the Debian archive software
1137    are ``1.0``, ``3.0 (native)``, and ``3.0 (quilt)``.
1139 .. [#]
1140    Other urgency values are supported with configuration changes in the
1141    archive software but are not used in Debian. The urgency affects how
1142    quickly a package will be considered for inclusion into the
1143    ``testing`` distribution and gives an indication of the importance of
1144    any fixes included in the upload. ``Emergency`` and ``critical`` are
1145    treated as synonymous.
1147 .. [#]
1148    A space after each comma is conventional.
1150 .. [#]
1151    That is, the parts which are not the ``.dsc``.