deb-src-control(5)
π deb-src-control(5) β the Debian source package template control file format π
okay bestie, so this is a page from the dpkg suite and it's literally all about the deb-src-control file. buckle up, it's giving essential β¨
π SYNOPSIS π
debian/control
πΈ DESCRIPTION πΈ
Every Debian source package has this template source control file called debian/control inside it, and its deb822(5) format is a superset of the control file that ships in Debian binary packages (peep deb-control(5) for that one, iykyk).
This file contains at least 2 stanzas, separated by a blank line. fr fr, minimum two.
- The first stanza is called the source package stanza and it lists literally all the info about the source package in general.
- Each following stanza is called a binary package stanza and describes exactly one binary package per stanza. one per stanza, no cheating π
Each stanza consists of at least one field. A field starts with a field name β like Package or Section, and those are case insensitive β followed by a colon, then the body of the field (which is case sensitive unless stated otherwise), and then a newline.
Multi-line fields are also allowed, but here's the vibe check: each supplementary line, with no field name on it, must start with at least one space. The content of multi-line fields is generally joined to a single line by the tools β except in the case of the Description field, see below π
To insert empty lines into a multi-line field, insert a dot after the space. yes, a literal dot, that's the whole trick π«Ά
And lines starting with a # are treated as comments. periodt. β¨
more parts incoming, don't go anywhere ππ¦
β¨ SOURCE FIELDS β¨
Okay bestie, this is the big source-fields era, and every single one matters. No skimming, no cap. π
π Source: source-package-name (required)
The value of this field is the name of the source package, and it must match the name of the source package in the debian/changelog file.
A package name must consist only of lowercase letters (a-z), digits (0-9), plus (+) and minus (-) signs, and periods (.). Package names must be at least two characters long and must start with a lowercase alphanumeric character (a-z0-9). Periodt. π
πΈ Maintainer: fullname-email (recommended)
Should be in the format Β«Joe Bloggs <jbloggs@foo.com>Β», and references the person who currently maintains the package, as opposed to the author of the software or the original packager.
The format is described in deb-email(7).
π¦ Uploaders: fullname-email
Lists all the names and email addresses of co-maintainers of the package, in the same format as the Maintainer field. Multiple co-maintainers should be separated by a comma.
The format is described in deb-email(7).
β Standards-Version: version-string
This documents the most recent version of the distribution policy standards this package complies with.
π Description: short-description / long-description
The format for the source package description is a short brief summary on the first line (after the Description field). The following lines should be used as a longer, more detailed description.
Each line of the long description must be preceded by a space, and blank lines in the long description must contain a single β.β following the preceding space.
Description: short-description
long-description
π«Ά tiny formatting check, bestie: that leading space and the single β.β blank-line thing are not optional. The vibe check will notice. β¨
π Homepage: url
The upstream project home page URL.
π Bugs: url
The url of the bug tracking system for this package. The current used format is bts-type://bts-address, like debbugs://bugs.debian.org. This field is usually not needed.
π§ Build-Driver: driver-name
This experimental field specifies the name of the build driver to use to build this package. When omitted the driver-name defaults to debian-rules.
Supported since dpkg 1.22.7.
π Rules-Requires-Root: no | binary-targets | impl-keywords
This field is used to indicate whether the debian/rules file requires (fake)root privileges to run some of its targets, and if so when.
Supported since dpkg 1.19.0.
noβ The binary targets will not require (fake)root at all. This is the default indpkg-build-api level >= 1, or since dpkg 1.22.13.binary-targetsβ The binary targets must always be run under (fake)root. This value is the default indpkg-build-api level 0until dpkg 1.22.13, when the field is omitted; adding the field with an explicitbinary-targets, while not strictly needed, marks it as having been analyzed for this requirement.impl-keywordsβ This is a space-separated list of keywords which define when (fake)root is required.- Keywords consist of
namespace/cases. Thenamespacepart cannot contain/or whitespace. Thecasespart cannot contain whitespace. Furthermore, both parts must consist entirely of printable ASCII characters. - Each tool/package will define a namespace named after itself and provide a number of cases where (fake)root is required. (See βImplementation provided keywordsβ in
rootless-builds.txt.) - When the field is set to one of the impl-keywords, the builder will expose an interface that is used to run a command under (fake)root. (See βGain Root APIβ in
rootless-builds.txt.)
- Keywords consist of
π§ͺ Testsuite: name-list and Testsuite-Triggers: package-list
These fields are described in the dsc(5) manual page, as they are generated from information inferred from debian/tests/control or copied literally to the source control file.
π¦ VCS fields β the whole Vcs-* bestie lineup
Vcs-Arch:urlVcs-Bzr:urlVcs-Cvs:urlVcs-Darcs:urlVcs-Git:urlVcs-Hg:urlVcs-Mtn:urlVcs-Svn:url
The url of the Version Control System repository used to maintain this package. Currently supported are Arch, Bzr (Bazaar), Cvs, Darcs, Git, Hg (Mercurial), Mtn (Monotone) and Svn (Subversion). Usually this field points to the latest version of the package, such as the main branch or the trunk.
π Vcs-Browser: url
The url of a web interface to browse the Version Control System repository.
π Origin: name
The name of the distribution this package is originating from. This field is usually not needed.
π Section: section
This is a general field that gives the package a category based on the software that it installs. Some common sections are utils, net, mail, text, x11, etc.
When omitted, the section defaults to unknown (since dpkg 1.22.13).
The accepted values are based on the specific distribution policy.
π Priority: priority
Sets the importance of this package in relation to the system as a whole. The known priorities are required, important, standard, optional, extra, and unknown, but other values can be used as well.
When omitted, the priority defaults to optional (since dpkg 1.22.13).
How to apply these values depends on the specific distribution policy.
π₯ Build-Depends: package-list
A list of packages that need to be installed and configured to be able to build from source package. These dependencies need to be satisfied when building binary architecture dependent or independent packages and source packages.
π tiny but mighty: including a dependency in this field does not have the exact same effect as including it in bothBuild-Depends-ArchandBuild-Depends-Indep, because the dependency also needs to be satisfied when building the source package.
π Build-Depends-Arch: package-list
Same as Build-Depends, but they are only needed when building the architecture dependent packages. The Build-Depends are also installed in this case.
Supported since dpkg 1.16.4; to build with older dpkg versions, Build-Depends should be used instead.
πΈ Build-Depends-Indep: package-list
Same as Build-Depends, but they are only needed when building the architecture independent packages. The Build-Depends are also installed in this case.
π Build-Conflicts: package-list
A list of packages that should not be installed when the package is built, for example because they interfere with the build system used. Including a dependency in this list has the same effect as including it in both Build-Conflicts-Arch and Build-Conflicts-Indep, with the additional effect of being used for source-only builds.
π₯ Build-Conflicts-Arch: package-list
Same as Build-Conflicts, but only when building the architecture dependent packages.
Supported since dpkg 1.16.4; to build with older dpkg versions, Build-Conflicts should be used instead.
π Build-Conflicts-Indep: package-list
Same as Build-Conflicts, but only when building the architecture independent packages.
π§ Dependency syntax, because the group chat has rules
The syntax of the Build-Depends, Build-Depends-Arch and Build-Depends-Indep fields is a list of groups of alternative packages. Each group is a list of packages separated by vertical bar (or βpipeβ) symbols, β|β. The groups are separated by commas β,β, and can end with a trailing comma that will be eliminated when generating the fields for deb-control(5) (since dpkg 1.10.14). Commas are to be read as βANDβ, and pipes as βORβ, with pipes binding more tightly.
Each package name is optionally followed by an architecture qualifier appended after a colon β:β, optionally followed by a version number specification in parentheses β(β and β)β, an architecture specification in square brackets β[β and β]β, and a restriction formula consisting of one or more lists of profile names in angle brackets β<β and β>β.
The syntax of the Build-Conflicts, Build-Conflicts-Arch and Build-Conflicts-Indep fields is a list of comma-separated package names, where the comma is read as an βANDβ, and where the list can end with a trailing comma that will be eliminated when generating the fields for deb-control(5) (since dpkg 1.10.14). Specifying alternative packages using a βpipeβ is not supported.
Each package name is optionally followed by a version number specification in parentheses, an architecture specification in square brackets, and a restriction formula consisting of one or more lists of profile names in angle brackets.
π¦ Architecture qualifiers, version stuff, and restriction formulas
An architecture qualifier name can be a real Debian architecture name (since dpkg 1.16.5), any (since dpkg 1.16.2) or native (since dpkg 1.16.5). If omitted, the default for Build-Depends fields is the current host architecture, the default for Build-Conflicts fields is any.
A real Debian architecture name will match exactly that architecture for that package name, any will match any architecture for that package name if the package is marked with Multi-Arch: allowed, and native will match the current build architecture if the package is not marked with Multi-Arch: foreign.
A version number may start with a β>>β, in which case any later version will match, and may specify or omit the Debian packaging revision (separated by a hyphen). Accepted version relationships are β>>β for greater than, β<<β for less than, β>=β for greater than or equal to, β<=β for less than or equal to, and β=β for equal to.
An architecture specification consists of one or more architecture names, separated by whitespace. Exclamation marks (!) may be prepended to each of the names, meaning βNOTβ.
A restriction formula consists of one or more restriction lists, separated by whitespace. Each restriction list is enclosed in angle brackets (< and >). Items in the restriction list are build profile names, separated by whitespace and can be prefixed with an exclamation mark (!), meaning βNOTβ. A restriction formula represents a disjunctive normal form expression, that is whitespace inside enclosed angle brackets is read as βANDβ, and whitespace between enclosing angle brackets is read as βORβ, such as <foo AND bar> OR <quux AND baz>.
π note time, bestie: dependencies on packages in thebuild-essentialset can be omitted and declaring build conflicts against them is impossible. A list of these packages is in thebuild-essentialpackage.
π BINARY FIELDS π
okay so this whole next chunk is about the stanzas that describe the binary packages β the actual .deb files people install. each stanza gets its own fields, and here's the tea on every single one π«Ά
Package: binary-package-name(required) β names the binary package. same naming restrictions as a source package name apply, so don't get cute with it πPackage-Type: deb|udeb|typeβ defines the type of the package.udebis for size-constrained packages used by the debian installer.debis the default value and it's assumed if the field is absent. more types might get added in the future, so stay tuned β¨Architecture: arch-list(required) β tells you which type of machine this package runs on. the value should be a list of architecture names and/or wildcards separated by spaces.
the special all value, by itself, is meant for packages that are architecture independent (think shell and Perl scripts, or documentation). the special any wildcard value, by itself, is meant for packages that are architecture dependent but run on all architectures β it matches on all specific architecture names, excluding all. most packages will use either all or any. to restrict a package to a certain set of architectures, list one or more architecture names and/or architecture wildcards, separated by spaces π¦
an architecture name or wildcard must start with an alphanumeric character (β0-9a-zA-Zβ), and then gets followed by alphanumeric and dash (β-β) characters.
want more info about architecture names and wildcards? see dpkg-architecture(1) π
Build-Profiles: restriction-formulaβ specifies the conditions for which this binary package does or does not build. to express that condition, it uses the same restriction formula syntax from theBuild-Dependsfield (including the angle brackets, yes, the<>ones).
if a binary package stanza doesn't contain this field, then it implicitly means it builds with all build profiles (including none at all). so no field = no restrictions, easy π
in other words: if a binary package stanza is annotated with a non-empty Build-Profiles field, then this binary package is generated if and only if the condition expressed by the conjunctive normal form expression evaluates to true. iykyk π€
Protected: yes|noEssential: yes|noBuild-Essential: yes|noMulti-Arch: same|foreign|allowed|noTag: tag-listDescription: short-description(recommended)
these fields are described over in the deb-control(5) manual page, because they get copied literally to the control file of the binary package. literally literally. no edits, no glow-up, straight copy-paste π
Section: sectionβ overrides the value from the same field in the source package stanza.
if there is no field in the binary or source stanza, then it defaults to unknown (since dpkg 1.22.13).
Priority: priorityβ overrides the value from the same field in the source package stanza.
if there is no field in the binary or source stanza, then it defaults to optional (since dpkg 1.22.13).
Homepage: urlβ overrides the value from the same field in the source package stanza.Depends: package-listPre-Depends: package-listRecommends: package-listSuggests: package-listBreaks: package-listEnhances: package-listReplaces: package-listConflicts: package-listProvides: package-listBuilt-Using: package-listStatic-Built-Using: package-list
these fields declare relationships between packages, and they're discussed in the deb-control(5) manual page. when these fields are found in debian/control they can also end with a trailing comma (since dpkg 1.10.14), and they can have architecture specifications and restriction formulas β all of which get reduced when generating the fields for deb-control(5). so the fancy version you write is not the version that ships, bestie π₯
Subarchitecture: valueKernel-Version: valueInstaller-Menu-Item: value
these fields are used by the debian-installer in udebs and are usually not needed. for more details about them, see https://salsa.debian.org/installer-team/debian-installer/-/raw/master/doc/devel/modules.txt π§
π USER-DEFINED FIELDS π
it is allowed to add additional user-defined fields to the control file β go off, make it yours β¨ the tools will ignore these fields. but if you want them copied over to the output files (like the binary packages), you need to use a custom naming scheme: the fields should start with an X, followed by zero or more of the letters SBC and a hyphen.
Sβ the field will appear in the source package control file, seedsc(5).
only expected in the source package stanza.
Bβ the field will appear in the control file in the binary package, seedeb-control(5).
allowed in the source package stanza or any binary package stanza.
Cβ the field will appear in the upload control (.changes) file, seedeb-changes(5).
only expected in the source package stanza.
note that the X[SBC]- prefixes are stripped when the fields are copied over to the output files. a field XC-Approved-By will appear as Approved-By in the changes file, and will not appear in the binary or source package control files. so the X is giving secret identity, not main character energy π
take into account that these user-defined fields will be using the global namespace, which might at some point in the future collide with officially recognized fields π to avoid such a potential situation you can prefix those fields withPrivate-, such asXB-Private-New-Field.
πΈ EXAMPLE πΈ
okay here's a whole real example, comments and all β no cap, this is the good stuff:
# Comment.
Source: dpkg
Section: admin
Priority: required
Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
# This field is copied to the binary and source packages.
XBS-Upstream-Release-Status: stable
Homepage: https://wiki.debian.org/Teams/Dpkg
Vcs-Browser: https://git.dpkg.org/cgit/dpkg/dpkg.git
Vcs-Git: https://git.dpkg.org/git/dpkg/dpkg.git
Standards-Version: 4.7.4
Build-Depends:
dpkg-build-api (= 1),
debhelper-compat (= 13),
debhelper (>= 13.10~),
pkgconf,
libselinux1-dev (>= 1.28-4) [!linux-any],
Package: dpkg-dev
Section: utils
Priority: optional
Architecture: all
# This is a custom field in the binary package.
XB-Mentoring-Contact: Raphael Hertzog <hertzog@debian.org>
Depends:
libdpkg-perl (= ${source:Version}),
dpkg (>= 1.14.6),
binutils,
bzip2,
xz-utils,
# This is a comment in the middle of a field value.
make,
patch (>= 2.2-1),
perl-modules,
perl5,
Recommends:
build-essential,
gcc | c-compiler,
Suggests:
debian-keyring,
Conflicts:
devscripts (<< 2.10.26),
Replaces:
manpages-pl (<= 20051117-1),
Provides:
dpkg-build-api (= 0),
dpkg-build-api (= 1),
Description: Debian package development tools
This package provides the development tools (including dpkg-source)
required to unpack, build and upload Debian source packages.
.
Most Debian source packages will require additional tools to build;
for example, most packages need make and the C compiler gcc.
like, notice the # comment sitting right in the middle of the Depends list? that's valid and it's iconic π
π SEE ALSO π
go read these, they're all part of the lore:
/usr/share/doc/dpkg/spec/rootless-builds.txtdeb822(5)deb-control(5)deb-email(7)deb-version(7)dpkg-source(1)
and that's the whole page, bestie!! π you made it to the end, so proud π₯Ή this was deb-src-control(5) from dpkg version 1.23.11-dirty, dated 2026-09-09 β yes the version says dirty, she's a little unhinged but she's our icon πβ¨ go build something slay π¦
π¦ where this page comes from
- arch rolling: dpkg 1.23.11-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms