man: Improve description for dpkg-build-api v1 items
[dpkg.git] / man / deb-src-control.pod
blob4342aaa08c7852b76ffe5a86f15bb345e117a7c9
1 # dpkg manual page - deb-src-control(5)
3 # Copyright © 2010 Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
4 # Copyright © 2011 Raphaël Hertzog <hertzog@debian.org>
5 # Copyright © 2011-2015 Guillem Jover <guillem@debian.org>
7 # This is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
20 =encoding utf8
22 =head1 NAME
24 deb-src-control - Debian source packages' master control file format
26 =head1 SYNOPSIS
28 B<debian/control>
30 =head1 DESCRIPTION
32 Each Debian source package contains the master «B<debian/control>» file,
33 and its L<deb822(5)> format is a superset of the B<control> file
34 shipped in Debian binary packages, see L<deb-control(5)>.
36 This file contains at least 2 stanzas, separated by a blank line.
37 The first stanza lists all information about the source package in general,
38 while each following stanza describes exactly one binary package.
39 Each stanza consists of at least one field.
40 A field starts with a field name, such as B<Package> or B<Section>
41 (case insensitive), followed by a colon, the body of the field
42 (case sensitive unless stated otherwise) and a newline.
43 Multi-line fields are also allowed, but each supplementary line, without a
44 field name, should start with at least one space. The content of the multi-line
45 fields is generally joined to a single line by the tools (except in the case of
46 the
47 B<Description>
48 field, see below). To insert empty lines into a multi-line
49 field, insert a dot after the space.
50 Lines starting with a ‘B<#>’ are treated as comments.
52 =head1 SOURCE FIELDS
54 =over
56 =item B<Source:> I<source-package-name> (required)
58 The value of this field is the name of the source package, and should
59 match the name of the source package in the debian/changelog file. A package
60 name must consist only of lowercase letters (a-z), digits (0-9), plus (+) and
61 minus (-) signs, and periods (.). Package names must be at least two characters
62 long and must start with a lowercase alphanumeric character (a-z0-9).
64 =item B<Maintainer:> I<fullname-email> (recommended)
66 Should be in the format «Joe Bloggs E<lt>jbloggs@foo.comE<gt>», and references the
67 person who currently maintains the package, as opposed to the author of the
68 software or the original packager.
70 =item B<Uploaders:> I<fullname-email>
72 Lists all the names and email addresses of co-maintainers of the package, in
73 the same format as the B<Maintainer> field.
74 Multiple co-maintainers should be separated by a comma.
76 =item B<Standards-Version:> I<version-string>
78 This documents the most recent version of the distribution policy standards
79 this package complies with.
81 =item B<Description> I<short-description>
83 =item S< >I<long-description>
85 The format for the source package description is a short brief summary on the
86 first line (after the B<Description> field).
87 The following lines should be used as a longer, more detailed description.
88 Each line of the long description must be preceded by a space, and blank
89 lines in the long description must contain a single ‘B<.>’ following
90 the preceding space.
92 =item B<Homepage:> I<url>
94 The upstream project home page URL.
96 =item B<Bugs:> I<url>
98 The I<url> of the bug tracking system for this package. The current
99 used format is I<bts-type>B<://>I<bts-address>, like
100 B<debbugs://bugs.debian.org>. This field is usually not needed.
102 =item B<Rules-Requires-Root:> B<no>|B<binary-targets>|I<impl-keywords>
104 This field is used to indicate whether the B<debian/rules> file requires
105 (fake)root privileges to run some of its targets, and if so when.
107 =over
109 =item B<no>
111 The binary targets will not require (fake)root at all.
112 This is the default in B<dpkg-build-api> level >= 1.
114 =item B<binary-targets>
116 The binary targets must always be run under (fake)root.
117 This value is the default in B<dpkg-build-api> level 0,
118 when the field is omitted;
119 adding the field with an explicit B<binary-targets>,
120 while not strictly needed,
121 marks it as having been analyzed for this requirement.
123 =item I<impl-keywords>
125 This is a space-separated list of keywords which define when (fake)root
126 is required.
128 Keywords consist of I<namespace>/I<cases>.
129 The I<namespace> part cannot contain "/" or whitespace.
130 The I<cases> part cannot contain whitespace.
131 Furthermore, both parts must consist entirely of printable ASCII characters.
133 Each tool/package will define a namespace named after itself and provide
134 a number of cases where (fake)root is required.
135 (See "Implementation provided keywords" in I<rootless-builds.txt>).
137 When the field is set to one of the I<impl-keywords>, the builder will
138 expose an interface that is used to run a command under (fake)root.
139 (See "Gain Root API" in I<rootless-builds.txt>.)
141 =back
143 =item B<Testsuite:> I<name-list>
145 =item B<Testsuite-Triggers:> I<package-list>
147 These fields are described in the
148 L<dsc(5)>
149 manual page, as they are generated from information inferred from
150 B<debian/tests/control> or copied literally to the source control file.
152 =item B<Vcs-Arch:> I<url>
154 =item B<Vcs-Bzr:> I<url>
156 =item B<Vcs-Cvs:> I<url>
158 =item B<Vcs-Darcs:> I<url>
160 =item B<Vcs-Git:> I<url>
162 =item B<Vcs-Hg:> I<url>
164 =item B<Vcs-Mtn:> I<url>
166 =item B<Vcs-Svn:> I<url>
168 The I<url> of the Version Control System repository used to maintain this
169 package. Currently supported are B<Arch>, B<Bzr> (Bazaar), B<Cvs>,
170 B<Darcs>, B<Git>, B<Hg> (Mercurial), B<Mtn> (Monotone) and
171 B<Svn> (Subversion). Usually this field points to the latest version
172 of the package, such as the main branch or the trunk.
174 =item B<Vcs-Browser:> I<url>
176 The I<url> of a web interface to browse the Version Control System
177 repository.
179 =item B<Origin:> I<name>
181 The name of the distribution this package is originating from. This field is
182 usually not needed.
184 =item B<Section:> I<section>
186 This is a general field that gives the package a category based on the
187 software that it installs.
188 Some common sections are B<utils>, B<net>, B<mail>, B<text>,
189 B<x11>, etc.
191 =item B<Priority:> I<priority>
193 Sets the importance of this package in relation to the system as a whole.
194 Common priorities are B<required>, B<standard>, B<optional>,
195 B<extra>, etc.
198 B<Section>
200 B<Priority>
201 fields usually have a defined set of accepted values based on the specific
202 distribution policy.
204 =item B<Build-Depends:> I<package-list>
206 A list of packages that need to be installed and configured to be able
207 to build from source package.
208 These dependencies need to be satisfied when building binary architecture
209 dependent or independent packages and source packages.
210 Including a dependency in this field does not have the exact same effect as
211 including it in both B<Build-Depends-Arch> and B<Build-Depends-Indep>,
212 because the dependency also needs to be satisfied when building the source
213 package.
215 =item B<Build-Depends-Arch:> I<package-list>
217 Same as B<Build-Depends>, but they are only needed when building the
218 architecture dependent packages. The B<Build-Depends> are also
219 installed in this case. This field is supported since dpkg 1.16.4; in
220 order to build with older dpkg versions, B<Build-Depends>
221 should be used instead.
223 =item B<Build-Depends-Indep:> I<package-list>
225 Same as B<Build-Depends>, but they are only needed when building the
226 architecture independent packages. The B<Build-Depends> are also
227 installed in this case.
229 =item B<Build-Conflicts:> I<package-list>
231 A list of packages that should not be installed when the package is
232 built, for example because they interfere with the build system used.
233 Including a dependency in this list has the same effect as including
234 it in both B<Build-Conflicts-Arch> and
235 B<Build-Conflicts-Indep>, with the additional effect of being
236 used for source-only builds.
238 =item B<Build-Conflicts-Arch:> I<package-list>
240 Same as B<Build-Conflicts>, but only when building the architecture
241 dependent packages. This field is supported since dpkg 1.16.4; in
242 order to build with older dpkg versions, B<Build-Conflicts> should
243 be used instead.
245 =item B<Build-Conflicts-Indep:> I<package-list>
247 Same as B<Build-Conflicts>, but only when building the architecture
248 independent packages.
250 =back
252 The syntax of the
253 B<Build-Depends>,
254 B<Build-Depends-Arch>
256 B<Build-Depends-Indep>
257 fields is a list of groups of alternative packages.
258 Each group is a list of packages separated by vertical bar (or “pipe”)
259 symbols, ‘B<|>’.
260 The groups are separated by commas ‘B<,>’, and can end with a
261 trailing comma that will be eliminated when generating the fields
262 for L<deb-control(5)> (since dpkg 1.10.14).
263 Commas are to be read as “AND”, and pipes as “OR”, with pipes
264 binding more tightly.
265 Each package name is optionally followed by an architecture qualifier
266 appended after a colon ‘B<:>’,
267 optionally followed by a version number specification in parentheses
268 ‘B<(>’ and ‘B<)>’, an
269 architecture specification in square brackets ‘B<[>’ and ‘B<]>’,
270 and a restriction formula
271 consisting of one or more lists of profile names in angle brackets
272 ‘B<E<lt>>’ and ‘B<E<gt>>’.
274 The syntax of the
275 B<Build-Conflicts>,
276 B<Build-Conflicts-Arch>
278 B<Build-Conflicts-Indep>
279 fields is a list of comma-separated package names, where the comma is read
280 as an “AND”, and where the list can end with a trailing comma that will
281 be eliminated when generating the fields for L<deb-control(5)>
282 (since dpkg 1.10.14).
283 Specifying alternative packages using a “pipe” is not supported.
284 Each package name is optionally followed by a version number specification in
285 parentheses, an architecture specification in square brackets, and a
286 restriction formula consisting of one or more lists of profile names in
287 angle brackets.
289 An architecture qualifier name can be a real Debian architecture name
290 (since dpkg 1.16.5), B<any> (since dpkg 1.16.2) or B<native>
291 (since dpkg 1.16.5).
292 If omitted, the default for B<Build-Depends> fields is the current host
293 architecture, the default for B<Build-Conflicts> fields is B<any>.
294 A real Debian architecture name will match exactly that architecture for
295 that package name, B<any> will match any architecture for that package
296 name if the package is marked with B<Multi-Arch: allowed>, and
297 B<native> will match the current build architecture if the package
298 is not marked with B<Multi-Arch: foreign>.
300 A version number may start with a ‘B<E<gt>E<gt>>’, in which case any
301 later version will match, and may specify or omit the Debian packaging
302 revision (separated by a hyphen).
303 Accepted version relationships are ‘B<E<gt>E<gt>>’ for greater than,
304 ‘B<E<lt>E<lt>>’ for less than, ‘B<E<gt>=>’ for greater than or
305 equal to, ‘B<E<lt>=>’ for less than or equal to, and ‘B<=>’
306 for equal to.
308 An architecture specification consists of one or more architecture names,
309 separated by whitespace. Exclamation marks may be prepended to each of the
310 names, meaning “NOT”.
312 A restriction formula consists of one or more restriction lists, separated
313 by whitespace. Each restriction list is enclosed in angle brackets. Items
314 in the restriction list are build profile names, separated by whitespace
315 and can be prefixed with an exclamation mark, meaning “NOT”.
316 A restriction formula represents a disjunctive normal form expression.
318 Note that dependencies on packages in the
319 B<build-essential>
320 set can be omitted and that declaring build conflicts against them is
321 impossible. A list of these packages is in the build-essential package.
323 =head1 BINARY FIELDS
325 Note that the
326 B<Priority>, B<Section>
328 B<Homepage>
329 fields can also be in a binary stanza to override the global value from the
330 source package.
332 =over
334 =item B<Package:> I<binary-package-name> (required)
336 This field is used to name the binary package name. The same restrictions as
337 to a source package name apply.
339 =item B<Package-Type:> B<deb>|B<udeb>|I<type>
341 This field defines the type of the package.
342 B<udeb> is for size-constrained packages used by the debian installer.
343 B<deb> is the default value, it is assumed if the field is absent.
344 More types might be added in the future.
346 =item B<Architecture:> I<arch>|B<all>|B<any> (required)
348 The architecture specifies on which type of hardware this package runs. For
349 packages that run on all architectures, use the
350 B<any>
351 value. For packages that are architecture independent, such as shell and Perl
352 scripts or documentation, use the
353 B<all>
354 value. To restrict the packages to a certain set of architectures, specify the
355 architecture names, separated by a space. It's also possible to put
356 architecture wildcards in that list (see
357 L<dpkg-architecture(1)>
358 for more information about them).
360 =item B<Build-Profiles:> I<restriction-formula>
362 This field specifies the conditions for which this binary package does or
363 does not build.
364 To express that condition, the same restriction formula syntax from the
365 B<Build-Depends> field is used (including the angle brackets).
367 If a binary package stanza does not contain this field, then it implicitly
368 means that it builds with all build profiles (including none at all).
370 In other words, if a binary package stanza is annotated with a non-empty
371 B<Build-Profiles> field, then this binary package is generated if and
372 only if the condition expressed by the conjunctive normal form expression
373 evaluates to true.
375 =item B<Protected:> B<yes>|B<no>
377 =item B<Essential:> B<yes>|B<no>
379 =item B<Build-Essential:> B<yes>|B<no>
381 =item B<Multi-Arch:> B<same>|B<foreign>|B<allowed>|B<no>
383 =item B<Tag:> I<tag-list>
385 =item B<Description:> I<short-description> (recommended)
387 These fields are described in the
388 L<deb-control(5)>
389 manual page, as they are copied literally to the control file of the binary
390 package.
392 =item B<Depends:> I<package-list>
394 =item B<Pre-Depends:> I<package-list>
396 =item B<Recommends:> I<package-list>
398 =item B<Suggests:> I<package-list>
400 =item B<Breaks:> I<package-list>
402 =item B<Enhances:> I<package-list>
404 =item B<Replaces:> I<package-list>
406 =item B<Conflicts:> I<package-list>
408 =item B<Provides:> I<package-list>
410 =item B<Built-Using:> I<package-list>
412 =item B<Static-Built-Using:> I<package-list>
414 These fields declare relationships between packages. They are discussed in
416 L<deb-control(5)>
417 manual page.
418 When these fields are found in I<debian/control> they can also end with
419 a trailing comma (since dpkg 1.10.14), have architecture specifications and
420 restriction formulas which will all get reduced when generating the fields
421 for L<deb-control(5)>.
423 =item B<Subarchitecture:> I<value>
425 =item B<Kernel-Version:> I<value>
427 =item B<Installer-Menu-Item:> I<value>
429 These fields are used by the debian-installer in B<udeb>s and are
430 usually not needed.
431 For more details about them, see
432 L<https://salsa.debian.org/installer-team/debian-installer/-/raw/master/doc/devel/modules.txt>.
434 =back
436 =head1 USER-DEFINED FIELDS
438 It is allowed to add additional user-defined fields to the control file. The
439 tools will ignore these fields. If you want the fields to be copied over to
440 the output files, such as the binary packages, you need to use a custom naming
441 scheme: the fields should start with an B<X>, followed by zero or more of
442 the letters B<SBC> and a hyphen.
444 =over
446 =item B<S>
448 The field will appear in the source package control file, see L<dsc(5)>.
450 =item B<B>
452 The field will appear in the control file in the binary package, see
453 L<deb-control(5)>.
455 =item B<C>
457 The field will appear in the upload control (.changes) file, see
458 L<deb-changes(5)>.
460 =back
462 Note that the B<X>[B<SBC>]B<-> prefixes are stripped when the
463 fields are copied over to the output files. A field B<XC-Approved-By>
464 will appear as B<Approved-By> in the changes file and will not appear
465 in the binary or source package control files.
467 Take into account that these user-defined fields will be using the global
468 namespace, which might at some point in the future collide with officially
469 recognized fields. To avoid such potential situation you can prefix those
470 fields with B<Private->, such as B<XB-Private-New-Field>.
472 =head1 EXAMPLE
474  # Comment
475  Source: dpkg
476  Section: admin
477  Priority: required
478  Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
479  # this field is copied to the binary and source packages
480  XBS-Upstream-Release-Status: stable
481  Homepage: https://wiki.debian.org/Teams/Dpkg
482  Vcs-Browser: https://git.dpkg.org/cgit/dpkg/dpkg.git
483  Vcs-Git: https://git.dpkg.org/git/dpkg/dpkg.git
484  Standards-Version: 3.7.3
485  Build-Depends: pkgconf, debhelper (>= 4.1.81),
486   libselinux1-dev (>= 1.28-4) [!linux-any]
488  Package: dpkg-dev
489  Section: utils
490  Priority: optional
491  Architecture: all
492  # this is a custom field in the binary package
493  XB-Mentoring-Contact: Raphael Hertzog <hertzog@debian.org>
494  Depends: dpkg (>= 1.14.6), perl5, perl-modules, cpio (>= 2.4.2-2),
495   bzip2, lzma, patch (>= 2.2-1), make, binutils, libtimedate-perl
496  Recommends: gcc | c-compiler, build-essential
497  Suggests: gnupg, debian-keyring
498  Conflicts: dpkg-cross (<< 2.0.0), devscripts (<< 2.10.26)
499  Replaces: manpages-pl (<= 20051117-1)
500  Description: Debian package development tools
501   This package provides the development tools (including dpkg-source)
502   required to unpack, build and upload Debian source packages.
503   .
504   Most Debian source packages will require additional tools to build;
505   for example, most packages need make and the C compiler gcc.
507 =head1 SEE ALSO
509 I<%PKGDOCDIR%/spec/rootless-builds.txt>,
510 L<deb822(5)>,
511 L<deb-control(5)>,
512 L<deb-version(7)>,
513 L<dpkg-source(1)>