Dpkg::OpenPGP::Backend::SOP: Add reference to another gosop blocker
[dpkg.git] / man / deb-src-control.pod
blob65dd027d4dfc6c6155b0a827b521f7d5cc50fc4b
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 package template control file format
26 =head1 SYNOPSIS
28 B<debian/control>
30 =head1 DESCRIPTION
32 Each Debian source package contains the «B<debian/control>» template source
33 control file,
34 and its L<deb822(5)> format is a superset of the B<control> file
35 shipped in Debian binary packages, see L<deb-control(5)>.
37 This file contains at least 2 stanzas, separated by a blank line.
38 The first stanza is called the source package stanza and lists all
39 information about the source package in general,
40 while each following stanzas are called the binary package stanzas and
41 describe exactly one binary package per stanza.
42 Each stanza consists of at least one field.
43 A field starts with a field name, such as B<Package> or B<Section>
44 (case insensitive), followed by a colon, the body of the field
45 (case sensitive unless stated otherwise) and a newline.
46 Multi-line fields are also allowed, but each supplementary line, without a
47 field name, should start with at least one space. The content of the multi-line
48 fields is generally joined to a single line by the tools (except in the case of
49 the
50 B<Description>
51 field, see below). To insert empty lines into a multi-line
52 field, insert a dot after the space.
53 Lines starting with a ‘B<#>’ are treated as comments.
55 =head1 SOURCE FIELDS
57 =over
59 =item B<Source:> I<source-package-name> (required)
61 The value of this field is the name of the source package, and should
62 match the name of the source package in the debian/changelog file. A package
63 name must consist only of lowercase letters (a-z), digits (0-9), plus (+) and
64 minus (-) signs, and periods (.). Package names must be at least two characters
65 long and must start with a lowercase alphanumeric character (a-z0-9).
67 =item B<Maintainer:> I<fullname-email> (recommended)
69 Should be in the format «Joe Bloggs E<lt>jbloggs@foo.comE<gt>», and references the
70 person who currently maintains the package, as opposed to the author of the
71 software or the original packager.
73 =item B<Uploaders:> I<fullname-email>
75 Lists all the names and email addresses of co-maintainers of the package, in
76 the same format as the B<Maintainer> field.
77 Multiple co-maintainers should be separated by a comma.
79 =item B<Standards-Version:> I<version-string>
81 This documents the most recent version of the distribution policy standards
82 this package complies with.
84 =item B<Description> I<short-description>
86 =item S< >I<long-description>
88 The format for the source package description is a short brief summary on the
89 first line (after the B<Description> field).
90 The following lines should be used as a longer, more detailed description.
91 Each line of the long description must be preceded by a space, and blank
92 lines in the long description must contain a single ‘B<.>’ following
93 the preceding space.
95 =item B<Homepage:> I<url>
97 The upstream project home page URL.
99 =item B<Bugs:> I<url>
101 The I<url> of the bug tracking system for this package. The current
102 used format is I<bts-type>B<://>I<bts-address>, like
103 B<debbugs://bugs.debian.org>. This field is usually not needed.
105 =item B<Rules-Requires-Root:> B<no>|B<binary-targets>|I<impl-keywords>
107 This field is used to indicate whether the B<debian/rules> file requires
108 (fake)root privileges to run some of its targets, and if so when.
110 =over
112 =item B<no>
114 The binary targets will not require (fake)root at all.
115 This is the default in B<dpkg-build-api> level >= 1.
117 =item B<binary-targets>
119 The binary targets must always be run under (fake)root.
120 This value is the default in B<dpkg-build-api> level 0,
121 when the field is omitted;
122 adding the field with an explicit B<binary-targets>,
123 while not strictly needed,
124 marks it as having been analyzed for this requirement.
126 =item I<impl-keywords>
128 This is a space-separated list of keywords which define when (fake)root
129 is required.
131 Keywords consist of I<namespace>/I<cases>.
132 The I<namespace> part cannot contain "/" or whitespace.
133 The I<cases> part cannot contain whitespace.
134 Furthermore, both parts must consist entirely of printable ASCII characters.
136 Each tool/package will define a namespace named after itself and provide
137 a number of cases where (fake)root is required.
138 (See "Implementation provided keywords" in I<rootless-builds.txt>).
140 When the field is set to one of the I<impl-keywords>, the builder will
141 expose an interface that is used to run a command under (fake)root.
142 (See "Gain Root API" in I<rootless-builds.txt>.)
144 =back
146 =item B<Testsuite:> I<name-list>
148 =item B<Testsuite-Triggers:> I<package-list>
150 These fields are described in the
151 L<dsc(5)>
152 manual page, as they are generated from information inferred from
153 B<debian/tests/control> or copied literally to the source control file.
155 =item B<Vcs-Arch:> I<url>
157 =item B<Vcs-Bzr:> I<url>
159 =item B<Vcs-Cvs:> I<url>
161 =item B<Vcs-Darcs:> I<url>
163 =item B<Vcs-Git:> I<url>
165 =item B<Vcs-Hg:> I<url>
167 =item B<Vcs-Mtn:> I<url>
169 =item B<Vcs-Svn:> I<url>
171 The I<url> of the Version Control System repository used to maintain this
172 package. Currently supported are B<Arch>, B<Bzr> (Bazaar), B<Cvs>,
173 B<Darcs>, B<Git>, B<Hg> (Mercurial), B<Mtn> (Monotone) and
174 B<Svn> (Subversion). Usually this field points to the latest version
175 of the package, such as the main branch or the trunk.
177 =item B<Vcs-Browser:> I<url>
179 The I<url> of a web interface to browse the Version Control System
180 repository.
182 =item B<Origin:> I<name>
184 The name of the distribution this package is originating from. This field is
185 usually not needed.
187 =item B<Section:> I<section>
189 This is a general field that gives the package a category based on the
190 software that it installs.
191 Some common sections are B<utils>, B<net>, B<mail>, B<text>,
192 B<x11>, etc.
194 =item B<Priority:> I<priority>
196 Sets the importance of this package in relation to the system as a whole.
197 Common priorities are B<required>, B<standard>, B<optional>,
198 B<extra>, etc.
201 B<Section>
203 B<Priority>
204 fields usually have a defined set of accepted values based on the specific
205 distribution policy.
207 =item B<Build-Depends:> I<package-list>
209 A list of packages that need to be installed and configured to be able
210 to build from source package.
211 These dependencies need to be satisfied when building binary architecture
212 dependent or independent packages and source packages.
213 Including a dependency in this field does not have the exact same effect as
214 including it in both B<Build-Depends-Arch> and B<Build-Depends-Indep>,
215 because the dependency also needs to be satisfied when building the source
216 package.
218 =item B<Build-Depends-Arch:> I<package-list>
220 Same as B<Build-Depends>, but they are only needed when building the
221 architecture dependent packages. The B<Build-Depends> are also
222 installed in this case. This field is supported since dpkg 1.16.4; in
223 order to build with older dpkg versions, B<Build-Depends>
224 should be used instead.
226 =item B<Build-Depends-Indep:> I<package-list>
228 Same as B<Build-Depends>, but they are only needed when building the
229 architecture independent packages. The B<Build-Depends> are also
230 installed in this case.
232 =item B<Build-Conflicts:> I<package-list>
234 A list of packages that should not be installed when the package is
235 built, for example because they interfere with the build system used.
236 Including a dependency in this list has the same effect as including
237 it in both B<Build-Conflicts-Arch> and
238 B<Build-Conflicts-Indep>, with the additional effect of being
239 used for source-only builds.
241 =item B<Build-Conflicts-Arch:> I<package-list>
243 Same as B<Build-Conflicts>, but only when building the architecture
244 dependent packages. This field is supported since dpkg 1.16.4; in
245 order to build with older dpkg versions, B<Build-Conflicts> should
246 be used instead.
248 =item B<Build-Conflicts-Indep:> I<package-list>
250 Same as B<Build-Conflicts>, but only when building the architecture
251 independent packages.
253 =back
255 The syntax of the
256 B<Build-Depends>,
257 B<Build-Depends-Arch>
259 B<Build-Depends-Indep>
260 fields is a list of groups of alternative packages.
261 Each group is a list of packages separated by vertical bar (or “pipe”)
262 symbols, ‘B<|>’.
263 The groups are separated by commas ‘B<,>’, and can end with a
264 trailing comma that will be eliminated when generating the fields
265 for L<deb-control(5)> (since dpkg 1.10.14).
266 Commas are to be read as “AND”, and pipes as “OR”, with pipes
267 binding more tightly.
268 Each package name is optionally followed by an architecture qualifier
269 appended after a colon ‘B<:>’,
270 optionally followed by a version number specification in parentheses
271 ‘B<(>’ and ‘B<)>’, an
272 architecture specification in square brackets ‘B<[>’ and ‘B<]>’,
273 and a restriction formula
274 consisting of one or more lists of profile names in angle brackets
275 ‘B<E<lt>>’ and ‘B<E<gt>>’.
277 The syntax of the
278 B<Build-Conflicts>,
279 B<Build-Conflicts-Arch>
281 B<Build-Conflicts-Indep>
282 fields is a list of comma-separated package names, where the comma is read
283 as an “AND”, and where the list can end with a trailing comma that will
284 be eliminated when generating the fields for L<deb-control(5)>
285 (since dpkg 1.10.14).
286 Specifying alternative packages using a “pipe” is not supported.
287 Each package name is optionally followed by a version number specification in
288 parentheses, an architecture specification in square brackets, and a
289 restriction formula consisting of one or more lists of profile names in
290 angle brackets.
292 An architecture qualifier name can be a real Debian architecture name
293 (since dpkg 1.16.5), B<any> (since dpkg 1.16.2) or B<native>
294 (since dpkg 1.16.5).
295 If omitted, the default for B<Build-Depends> fields is the current host
296 architecture, the default for B<Build-Conflicts> fields is B<any>.
297 A real Debian architecture name will match exactly that architecture for
298 that package name, B<any> will match any architecture for that package
299 name if the package is marked with B<Multi-Arch: allowed>, and
300 B<native> will match the current build architecture if the package
301 is not marked with B<Multi-Arch: foreign>.
303 A version number may start with a ‘B<E<gt>E<gt>>’, in which case any
304 later version will match, and may specify or omit the Debian packaging
305 revision (separated by a hyphen).
306 Accepted version relationships are ‘B<E<gt>E<gt>>’ for greater than,
307 ‘B<E<lt>E<lt>>’ for less than, ‘B<E<gt>=>’ for greater than or
308 equal to, ‘B<E<lt>=>’ for less than or equal to, and ‘B<=>’
309 for equal to.
311 An architecture specification consists of one or more architecture names,
312 separated by whitespace. Exclamation marks may be prepended to each of the
313 names, meaning “NOT”.
315 A restriction formula consists of one or more restriction lists, separated
316 by whitespace. Each restriction list is enclosed in angle brackets. Items
317 in the restriction list are build profile names, separated by whitespace
318 and can be prefixed with an exclamation mark, meaning “NOT”.
319 A restriction formula represents a disjunctive normal form expression.
321 Note that dependencies on packages in the
322 B<build-essential>
323 set can be omitted and that declaring build conflicts against them is
324 impossible. A list of these packages is in the build-essential package.
326 =head1 BINARY FIELDS
328 Note that the
329 B<Priority>, B<Section>
331 B<Homepage>
332 fields can also be in a binary stanza to override the global value from the
333 source package.
335 =over
337 =item B<Package:> I<binary-package-name> (required)
339 This field is used to name the binary package name. The same restrictions as
340 to a source package name apply.
342 =item B<Package-Type:> B<deb>|B<udeb>|I<type>
344 This field defines the type of the package.
345 B<udeb> is for size-constrained packages used by the debian installer.
346 B<deb> is the default value, it is assumed if the field is absent.
347 More types might be added in the future.
349 =item B<Architecture:> I<arch>|B<all>|B<any> (required)
351 The architecture specifies on which type of hardware this package runs. For
352 packages that run on all architectures, use the
353 B<any>
354 value. For packages that are architecture independent, such as shell and Perl
355 scripts or documentation, use the
356 B<all>
357 value. To restrict the packages to a certain set of architectures, specify the
358 architecture names, separated by a space. It's also possible to put
359 architecture wildcards in that list (see
360 L<dpkg-architecture(1)>
361 for more information about them).
363 =item B<Build-Profiles:> I<restriction-formula>
365 This field specifies the conditions for which this binary package does or
366 does not build.
367 To express that condition, the same restriction formula syntax from the
368 B<Build-Depends> field is used (including the angle brackets).
370 If a binary package stanza does not contain this field, then it implicitly
371 means that it builds with all build profiles (including none at all).
373 In other words, if a binary package stanza is annotated with a non-empty
374 B<Build-Profiles> field, then this binary package is generated if and
375 only if the condition expressed by the conjunctive normal form expression
376 evaluates to true.
378 =item B<Protected:> B<yes>|B<no>
380 =item B<Essential:> B<yes>|B<no>
382 =item B<Build-Essential:> B<yes>|B<no>
384 =item B<Multi-Arch:> B<same>|B<foreign>|B<allowed>|B<no>
386 =item B<Tag:> I<tag-list>
388 =item B<Description:> I<short-description> (recommended)
390 These fields are described in the
391 L<deb-control(5)>
392 manual page, as they are copied literally to the control file of the binary
393 package.
395 =item B<Depends:> I<package-list>
397 =item B<Pre-Depends:> I<package-list>
399 =item B<Recommends:> I<package-list>
401 =item B<Suggests:> I<package-list>
403 =item B<Breaks:> I<package-list>
405 =item B<Enhances:> I<package-list>
407 =item B<Replaces:> I<package-list>
409 =item B<Conflicts:> I<package-list>
411 =item B<Provides:> I<package-list>
413 =item B<Built-Using:> I<package-list>
415 =item B<Static-Built-Using:> I<package-list>
417 These fields declare relationships between packages. They are discussed in
419 L<deb-control(5)>
420 manual page.
421 When these fields are found in I<debian/control> they can also end with
422 a trailing comma (since dpkg 1.10.14), have architecture specifications and
423 restriction formulas which will all get reduced when generating the fields
424 for L<deb-control(5)>.
426 =item B<Subarchitecture:> I<value>
428 =item B<Kernel-Version:> I<value>
430 =item B<Installer-Menu-Item:> I<value>
432 These fields are used by the debian-installer in B<udeb>s and are
433 usually not needed.
434 For more details about them, see
435 L<https://salsa.debian.org/installer-team/debian-installer/-/raw/master/doc/devel/modules.txt>.
437 =back
439 =head1 USER-DEFINED FIELDS
441 It is allowed to add additional user-defined fields to the control file. The
442 tools will ignore these fields. If you want the fields to be copied over to
443 the output files, such as the binary packages, you need to use a custom naming
444 scheme: the fields should start with an B<X>, followed by zero or more of
445 the letters B<SBC> and a hyphen.
447 =over
449 =item B<S>
451 The field will appear in the source package control file, see L<dsc(5)>.
453 =item B<B>
455 The field will appear in the control file in the binary package, see
456 L<deb-control(5)>.
458 =item B<C>
460 The field will appear in the upload control (.changes) file, see
461 L<deb-changes(5)>.
463 =back
465 Note that the B<X>[B<SBC>]B<-> prefixes are stripped when the
466 fields are copied over to the output files. A field B<XC-Approved-By>
467 will appear as B<Approved-By> in the changes file and will not appear
468 in the binary or source package control files.
470 Take into account that these user-defined fields will be using the global
471 namespace, which might at some point in the future collide with officially
472 recognized fields. To avoid such potential situation you can prefix those
473 fields with B<Private->, such as B<XB-Private-New-Field>.
475 =head1 EXAMPLE
477  # Comment
478  Source: dpkg
479  Section: admin
480  Priority: required
481  Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
482  # this field is copied to the binary and source packages
483  XBS-Upstream-Release-Status: stable
484  Homepage: https://wiki.debian.org/Teams/Dpkg
485  Vcs-Browser: https://git.dpkg.org/cgit/dpkg/dpkg.git
486  Vcs-Git: https://git.dpkg.org/git/dpkg/dpkg.git
487  Standards-Version: 3.7.3
488  Build-Depends: pkgconf, debhelper (>= 4.1.81),
489   libselinux1-dev (>= 1.28-4) [!linux-any]
491  Package: dpkg-dev
492  Section: utils
493  Priority: optional
494  Architecture: all
495  # this is a custom field in the binary package
496  XB-Mentoring-Contact: Raphael Hertzog <hertzog@debian.org>
497  Depends: dpkg (>= 1.14.6), perl5, perl-modules, cpio (>= 2.4.2-2),
498   bzip2, lzma, patch (>= 2.2-1), make, binutils, libtimedate-perl
499  Recommends: gcc | c-compiler, build-essential
500  Suggests: gnupg, debian-keyring
501  Conflicts: dpkg-cross (<< 2.0.0), devscripts (<< 2.10.26)
502  Replaces: manpages-pl (<= 20051117-1)
503  Description: Debian package development tools
504   This package provides the development tools (including dpkg-source)
505   required to unpack, build and upload Debian source packages.
506   .
507   Most Debian source packages will require additional tools to build;
508   for example, most packages need make and the C compiler gcc.
510 =head1 SEE ALSO
512 I<%PKGDOCDIR%/spec/rootless-builds.txt>,
513 L<deb822(5)>,
514 L<deb-control(5)>,
515 L<deb-version(7)>,
516 L<dpkg-source(1)>