deb-substvars.5 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. .\" dpkg manual page - deb-substvars(5)
  2. .\"
  3. .\" Copyright © 1995-1996 Ian Jackson <ian@chiark.chu.cam.ac.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>
  7. .\"
  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.
  12. .\"
  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.
  17. .\"
  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/>.
  20. .
  21. .TH deb\-substvars 5 "2015-01-20" "Debian Project" "dpkg utilities"
  22. .SH NAME
  23. deb\-substvars \- Debian source substitution variables
  24. .
  25. .SH SYNOPSIS
  26. substvars
  27. .
  28. .SH DESCRIPTION
  29. Before
  30. .BR dpkg\-source ", " dpkg\-gencontrol " and " dpkg\-genchanges
  31. write their control information (to the source control file
  32. .B .dsc
  33. for
  34. .B dpkg\-source
  35. and to standard output for
  36. .BR dpkg\-gencontrol " and " dpkg\-genchanges )
  37. they perform some variable substitutions on the output file.
  38. A variable substitution has the form
  39. .BI ${ variable-name }\fR.
  40. Variable names consist of alphanumerics, hyphens and colons and start
  41. with an alphanumeric. Variable substitutions are performed repeatedly
  42. until none are left; the full text of the field after the substitution
  43. is rescanned to look for more substitutions.
  44. After all the substitutions have been done each occurrence of the
  45. string
  46. .B ${}
  47. (which is not a legal substitution) is replaced with a
  48. .B $
  49. sign.
  50. While variable substitution is done on all control fields, some of those
  51. fields are used and needed during the build when the substitution did not
  52. yet occur. That's why you can't use variables in the \fBPackage\fP,
  53. \fBSource\fP and \fBArchitecture\fP fields.
  54. Variable substitution happens on the content of the fields after they have
  55. been parsed, thus if you want a variable to expand over multiple lines you
  56. do not have to include a space after the newline. This is done implicitly
  57. when the field is output. For example, if the variable
  58. \fB${Description}\fP is set to "foo is bar.${Newline}foo is
  59. great." and if you have the following field:
  60. Description: foo application
  61. ${Description}
  62. .
  63. More text.
  64. It will result in:
  65. Description: foo application
  66. foo is bar.
  67. foo is great.
  68. .
  69. More text.
  70. Variables can be set using the
  71. .B \-V
  72. common option. They can be also specified in the file
  73. .B debian/substvars
  74. (or whatever other file is specified using the
  75. .B \-T
  76. option). This file consists of lines of the form
  77. .IB name = value\fR.
  78. Trailing whitespace on each line, blank lines, and
  79. lines starting with a
  80. .B #
  81. symbol (comments) are ignored.
  82. Additionally, the following standard variables are available:
  83. .TP
  84. .BI Arch
  85. The current host architecture (i.e. the architecture the package is being
  86. built for, the equivalent of \fBDEB_HOST_ARCH\fP).
  87. .TP
  88. .B source:Version
  89. The source package version.
  90. .TP
  91. .B source:Upstream\-Version
  92. The upstream source package version, including the Debian version epoch if
  93. any.
  94. .TP
  95. .B binary:Version
  96. The binary package version (which may differ from source:Version in a binNMU
  97. for example).
  98. .TP
  99. .B Source\-Version
  100. The source package version (from the changelog file). This variable is now
  101. \fBdeprecated\fP as its meaning is different from its function, please use
  102. the \fBsource:Version\fP or \fBbinary:Version\fP as appropriate.
  103. .TP
  104. .B Installed\-Size
  105. The approximate total size of the package's installed files. This value is
  106. copied into the corresponding control file field; setting it will modify
  107. the value of that field. If this variable is not set
  108. .B dpkg\-gencontrol
  109. will compute the default value by accumulating the size of each regular
  110. file and symlink rounded to 1 KiB used units, and a baseline of 1 KiB for
  111. any other filesystem object type.
  112. \fBNote:\fP Take into account that this can only ever be an approximation,
  113. as the actual size used on the installed system will depend greatly on the
  114. filesystem used and its parameters, which might end up using either more
  115. or less space than the specified in this field.
  116. .TP
  117. .B Extra\-Size
  118. Additional disk space used when the package is installed. If this
  119. variable is set its value is added to that of the
  120. .B Installed\-Size
  121. variable (whether set explicitly or using the default value) before it
  122. is copied into the
  123. .B Installed\-Size
  124. control file field.
  125. .TP
  126. .BI F: fieldname
  127. The value of the output field
  128. .IR fieldname
  129. (which must be given in the canonical capitalisation). Setting these
  130. variables has no effect other than on places where they are expanded
  131. explicitly.
  132. .TP
  133. .B Format
  134. The
  135. .B .changes
  136. file format version generated by this version of the source packaging
  137. scripts. If you set this variable the contents of the
  138. .B Format
  139. field in the
  140. .B .changes
  141. file will change too.
  142. .TP
  143. .BR Newline ", " Space ", " Tab
  144. These variables each hold the corresponding character.
  145. .TP
  146. .BI shlibs: dependencyfield
  147. Variable settings with names of this form are generated by
  148. .BR dpkg\-shlibdeps .
  149. .TP
  150. .B dpkg:Upstream\-Version
  151. The upstream version of dpkg.
  152. .TP
  153. .B dpkg:Version
  154. The full version of dpkg.
  155. .LP
  156. If a variable is referred to but not defined it generates a warning
  157. and an empty value is assumed.
  158. .
  159. .SH FILES
  160. .TP
  161. .B debian/substvars
  162. List of substitution variables and values.
  163. .
  164. .SH SEE ALSO
  165. .ad l
  166. .nh
  167. .BR dpkg (1),
  168. .BR dpkg\-genchanges (1),
  169. .BR dpkg\-gencontrol (1),
  170. .BR dpkg\-shlibdeps (1),
  171. .BR dpkg\-source (1).