deb-substvars.5 4.6 KB

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