deb-substvars.5 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. Variables can be set using the
  36. .B \-V
  37. common option. They can be also specified in the file
  38. .B debian/substvars
  39. (or whatever other file is specified using the
  40. .B \-T
  41. option). This file consists of lines of the form
  42. .IB name = value\fR.
  43. Trailing whitespace on each line, blank lines, and
  44. lines starting with a
  45. .B #
  46. symbol (comments) are ignored.
  47. Additionally, the following standard variables are available:
  48. .TP
  49. .BI Arch
  50. The current build architecture (from
  51. .BR "dpkg \-\-print\-architecture" ).
  52. .TP
  53. .B source:Version
  54. The source package version.
  55. .TP
  56. .B source:Upstream\-Version
  57. The upstream source package version, including the Debian version epoch if
  58. any.
  59. .TP
  60. .B binary:Version
  61. The binary package version (which may differ from source:Version in a binNMU
  62. for example).
  63. .TP
  64. .B Source\-Version
  65. The source package version (from the changelog file). This variable is now
  66. \fBdeprecated\fP as its meaning is different from its function, please use
  67. the \fBsource:Version\fP or \fBbinary:Version\fP as appropriate.
  68. .TP
  69. .B Installed\-Size
  70. The total size of the package's installed files. This value is copied
  71. into the corresponding control file field; setting it will modify the
  72. value of that field. If this variable isn't set
  73. .B dpkg\-gencontrol
  74. will use
  75. .B du \-k debian/tmp
  76. to find the default value.
  77. .TP
  78. .B Extra\-Size
  79. Additional disk space used when the package is installed. If this
  80. variable is set its value is added to that of the
  81. .B Installed\-Size
  82. variable (whether set explicitly or using the default value) before it
  83. is copied into the
  84. .B Installed\-Size
  85. control file field.
  86. .TP
  87. .BI F: fieldname
  88. The value of the output field
  89. .IR fieldname
  90. (which must be given in the canonical capitalisation). Setting these
  91. variables has no effect other than on places where they are expanded
  92. explicitly.
  93. .TP
  94. .B Format
  95. The
  96. .B .changes
  97. file format version generated by this version of the source packaging
  98. scripts. If you set this variable the contents of the
  99. .B Format
  100. field in the
  101. .B .changes
  102. file will change too.
  103. .TP
  104. .BR Newline ", " Space ", " Tab
  105. These variables each hold the corresponding character.
  106. .TP
  107. .BI shlibs: dependencyfield
  108. Variable settings with names of this form are generated by
  109. .BR dpkg\-shlibdeps .
  110. .TP
  111. .B dpkg:Upstream\-Version
  112. The upstream version of dpkg.
  113. .TP
  114. .B dpkg:Version
  115. The full version of dpkg.
  116. .LP
  117. If a variable is referred to but not defined it generates a warning
  118. and an empty value is assumed.
  119. .
  120. .SH FILES
  121. .TP
  122. .B debian/substvars
  123. List of substitution variables and values.
  124. .
  125. .SH BUGS
  126. The point at which field overriding occurs compared to certain
  127. standard output field settings is rather confused.
  128. .SH SEE ALSO
  129. .BR dpkg (1),
  130. .BR dpkg\-genchanges (1),
  131. .BR dpkg\-gencontrol (1),
  132. .BR dpkg\-shlibdeps (1),
  133. .BR dpkg\-source (1).
  134. .
  135. .SH AUTHOR
  136. Copyright \(co 1995-1996 Ian Jackson
  137. .br
  138. Copyright \(co 2000 Wichert Akkerman
  139. .sp
  140. This is free software; see the GNU General Public Licence version 2 or
  141. later for copying conditions. There is NO WARRANTY.