1deb-substvars(5) dpkg suite deb-substvars(5)
2
3
4
6 deb-substvars - Debian source substitution variables
7
9 debian/substvars, debian/binary-package.substvars
10
12 Before dpkg-source, dpkg-gencontrol and dpkg-genchanges write their
13 control information (to the source control file .dsc for dpkg-source
14 and to standard output for dpkg-gencontrol and dpkg-genchanges) they
15 perform some variable substitutions on the output file.
16
17 A variable substitution has the form ${variable-name}. Variable names
18 consist of alphanumerics (a-zA-Z0-9), hyphens (-) and colons (:) and
19 start with an alphanumeric, and are case-sensitive, even though they
20 might refer to other entities which are case-preserving. Variable
21 substitutions are performed repeatedly until none are left; the full
22 text of the field after the substitution is rescanned to look for more
23 substitutions.
24
25 After all the substitutions have been done each occurrence of the
26 string ${} (which is not a legal substitution) is replaced with a $
27 sign.
28
29 While variable substitution is done on all control fields, some of
30 those fields are used and needed during the build when the substitution
31 did not yet occur. That's why you can't use variables in the Package,
32 Source and Architecture fields.
33
34 Variable substitution happens on the content of the fields after they
35 have been parsed, thus if you want a variable to expand over multiple
36 lines you do not have to include a space after the newline. This is
37 done implicitly when the field is output. For example, if the variable
38 ${Description} is set to "foo is bar.${Newline}foo is great." and if
39 you have the following field:
40
41 Description: foo application
42 ${Description}
43 .
44 More text.
45
46 It will result in:
47
48 Description: foo application
49 foo is bar.
50 foo is great.
51 .
52 More text.
53
54 Variables can be set using the -V common option. They can be also
55 specified in the file debian/substvars (or whatever other file is
56 specified using the -T option). This file consists of lines of the form
57 name=value. Trailing whitespace on each line, blank lines, and lines
58 starting with a # symbol (comments) are ignored.
59
60 Additionally, the following standard variables are available:
61
62 Arch
63 The current host architecture (i.e. the architecture the package is
64 being built for, the equivalent of DEB_HOST_ARCH).
65
66 vendor:Name
67 The current vendor name (since dpkg 1.20.0). This value comes from
68 the Vendor field for the current vendor's origin file, as dpkg-
69 vendor(1) would retrieve it.
70
71 vendor:Id
72 The current vendor ID (since dpkg 1.20.0). This is just the
73 lowercase variant of vendor:Name.
74
75 source:Version
76 The source package version (since dpkg 1.13.19).
77
78 source:Upstream-Version
79 The upstream source package version, including the Debian version
80 epoch if any (since dpkg 1.13.19).
81
82 binary:Version
83 The binary package version (which may differ from source:Version in
84 a binNMU for example; since dpkg 1.13.19).
85
86 Source-Version
87 The source package version (from the changelog file). This variable
88 is now obsolete and emits an error when used as its meaning is
89 different from its function, please use the source:Version or
90 binary:Version as appropriate.
91
92 source:Synopsis
93 The source package synopsis, extracted from the source stanza
94 Description field, if it exists (since dpkg 1.19.0).
95
96 source:Extended-Description
97 The source package extended description, extracted from the source
98 stanza Description field, if it exists (since dpkg 1.19.0).
99
100 Installed-Size
101 The approximate total size of the package's installed files. This
102 value is copied into the corresponding control file field; setting
103 it will modify the value of that field. If this variable is not set
104 dpkg-gencontrol will compute the default value by accumulating the
105 size of each regular file and symlink rounded to 1 KiB used units,
106 and a baseline of 1 KiB for any other filesystem object type. With
107 hardlinks only being counted once as a regular file.
108
109 Note: Take into account that this can only ever be an
110 approximation, as the actual size used on the installed system will
111 depend greatly on the filesystem used and its parameters, which
112 might end up using either more or less space than the specified in
113 this field.
114
115 Extra-Size
116 Additional disk space used when the package is installed. If this
117 variable is set its value is added to that of the Installed-Size
118 variable (whether set explicitly or using the default value) before
119 it is copied into the Installed-Size control file field.
120
121 S:fieldname
122 The value of the source stanza field fieldname (which must be given
123 in the canonical capitalisation; since dpkg 1.18.11). Setting
124 these variables has no effect other than on places where they are
125 expanded explicitly. These variables are only available when
126 generating binary control files.
127
128 F:fieldname
129 The value of the output field fieldname (which must be given in the
130 canonical capitalisation). Setting these variables has no effect
131 other than on places where they are expanded explicitly.
132
133 Format
134 The .changes file format version generated by this version of the
135 source packaging scripts. If you set this variable the contents of
136 the Format field in the .changes file will change too.
137
138 Newline, Space, Tab
139 These variables each hold the corresponding character.
140
141 shlibs:dependencyfield
142 Variable settings with names of this form are generated by dpkg-
143 shlibdeps.
144
145 dpkg:Upstream-Version
146 The upstream version of dpkg (since dpkg 1.13.19).
147
148 dpkg:Version
149 The full version of dpkg (since dpkg 1.13.19).
150
151 If a variable is referred to but not defined it generates a warning and
152 an empty value is assumed.
153
155 debian/substvars
156 List of substitution variables and values.
157
159 dpkg(1), dpkg-vendor(1), dpkg-genchanges(1), dpkg-gencontrol(1), dpkg-
160 shlibdeps(1), dpkg-source(1).
161
162
163
1641.20.9 2021-04-13 deb-substvars(5)