deb-substvars.5 5.1 KB

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