1 .\" dpkg manual page - deb-substvars(5)
3 .\" Copyright © 1995-1996 Ian Jackson <ijackson@chiark.greenend.org.uk>
4 .\" Copyright © 2000 Wichert Akkerman <wakkerma@debian.org>
5 .\" Copyright © 2006-2009,2012-2015 Guillem Jover <guillem@debian.org>
6 .\" Copyright © 2009-2010 Raphaël Hertzog <hertzog@debian.org>
8 .\" This is free software; you can redistribute it and/or modify
9 .\" it under the terms of the GNU General Public License as published by
10 .\" the Free Software Foundation; either version 2 of the License, or
11 .\" (at your option) any later version.
13 .\" This is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 .\" GNU General Public License for more details.
18 .\" You should have received a copy of the GNU General Public License
19 .\" along with this program. If not, see <https://www.gnu.org/licenses/>.
21 .TH deb\-substvars 5 "%RELEASE_DATE%" "%VERSION%" "dpkg suite"
24 deb\-substvars \- Debian source substitution variables
31 .BR dpkg\-source ", " dpkg\-gencontrol " and " dpkg\-genchanges
32 write their control information (to the source control file
36 and to standard output for
37 .BR dpkg\-gencontrol " and " dpkg\-genchanges )
38 they perform some variable substitutions on the output file.
40 A variable substitution has the form
41 .BI ${ variable-name }\fR.
42 Variable names consist of alphanumerics, hyphens and colons and start
43 with an alphanumeric. Variable substitutions are performed repeatedly
44 until none are left; the full text of the field after the substitution
45 is rescanned to look for more substitutions.
47 After all the substitutions have been done each occurrence of the
50 (which is not a legal substitution) is replaced with a
54 While variable substitution is done on all control fields, some of those
55 fields are used and needed during the build when the substitution did not
56 yet occur. That's why you can't use variables in the \fBPackage\fP,
57 \fBSource\fP and \fBArchitecture\fP fields.
59 Variable substitution happens on the content of the fields after they have
60 been parsed, thus if you want a variable to expand over multiple lines you
61 do not have to include a space after the newline. This is done implicitly
62 when the field is output. For example, if the variable
63 \fB${Description}\fP is set to "foo is bar.${Newline}foo is
64 great." and if you have the following field:
66 Description: foo application
73 Description: foo application
79 Variables can be set using the
81 common option. They can be also specified in the file
83 (or whatever other file is specified using the
85 option). This file consists of lines of the form
87 Trailing whitespace on each line, blank lines, and
90 symbol (comments) are ignored.
92 Additionally, the following standard variables are available:
95 The current host architecture (i.e. the architecture the package is being
96 built for, the equivalent of \fBDEB_HOST_ARCH\fP).
99 The source package version (since dpkg 1.13.19).
101 .B source:Upstream\-Version
102 The upstream source package version, including the Debian version epoch if
103 any (since dpkg 1.13.19).
106 The binary package version (which may differ from source:Version in a binNMU
107 for example; since dpkg 1.13.19).
110 The source package version (from the changelog file). This variable is now
111 \fBobsolete\fP and emits an error when used as its meaning is different from
112 its function, please use the \fBsource:Version\fP or \fBbinary:Version\fP as
116 The approximate total size of the package's installed files. This value is
117 copied into the corresponding control file field; setting it will modify
118 the value of that field. If this variable is not set
120 will compute the default value by accumulating the size of each regular
121 file and symlink rounded to 1 KiB used units, and a baseline of 1 KiB for
122 any other filesystem object type.
124 \fBNote:\fP Take into account that this can only ever be an approximation,
125 as the actual size used on the installed system will depend greatly on the
126 filesystem used and its parameters, which might end up using either more
127 or less space than the specified in this field.
130 Additional disk space used when the package is installed. If this
131 variable is set its value is added to that of the
133 variable (whether set explicitly or using the default value) before it
139 The value of the source stanza field
141 (which must be given in the canonical capitalisation; since dpkg 1.18.11).
142 Setting these variables has no effect other than on places where they
143 are expanded explicitly.
144 These variables are only available when generating binary control files.
147 The value of the output field
149 (which must be given in the canonical capitalisation). Setting these
150 variables has no effect other than on places where they are expanded
156 file format version generated by this version of the source packaging
157 scripts. If you set this variable the contents of the
161 file will change too.
163 .BR Newline ", " Space ", " Tab
164 These variables each hold the corresponding character.
166 .BI shlibs: dependencyfield
167 Variable settings with names of this form are generated by
168 .BR dpkg\-shlibdeps .
170 .B dpkg:Upstream\-Version
171 The upstream version of dpkg (since dpkg 1.13.19).
174 The full version of dpkg (since dpkg 1.13.19).
176 If a variable is referred to but not defined it generates a warning
177 and an empty value is assumed.
182 List of substitution variables and values.
187 .BR dpkg\-genchanges (1),
188 .BR dpkg\-gencontrol (1),
189 .BR dpkg\-shlibdeps (1),
190 .BR dpkg\-source (1).