dpkg-buildpackage.man 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. .\" dpkg manual page - dpkg-buildpackage(1)
  2. .\"
  3. .\" Copyright © 1995-1996 Ian Jackson
  4. .\" Copyright © 2000 Wichert Akkerman <wakkerma@debian.org>
  5. .\" Copyright © 2007-2008 Frank Lichtenheld <djpig@debian.org>
  6. .\" Copyright © 2008-2015 Guillem Jover <guillem@debian.org>
  7. .\" Copyright © 2008-2012 Raphaël Hertzog <hertzog@debian.org>
  8. .\"
  9. .\" This is free software; you can redistribute it and/or modify
  10. .\" it under the terms of the GNU General Public License as published by
  11. .\" the Free Software Foundation; either version 2 of the License, or
  12. .\" (at your option) any later version.
  13. .\"
  14. .\" This is distributed in the hope that it will be useful,
  15. .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. .\" GNU General Public License for more details.
  18. .\"
  19. .\" You should have received a copy of the GNU General Public License
  20. .\" along with this program. If not, see <https://www.gnu.org/licenses/>.
  21. .
  22. .TH dpkg\-buildpackage 1 "%RELEASE_DATE%" "%VERSION%" "dpkg suite"
  23. .nh
  24. .SH NAME
  25. dpkg\-buildpackage \- build binary or source packages from sources
  26. .
  27. .SH SYNOPSIS
  28. .B dpkg\-buildpackage
  29. .RI [ option ...]
  30. .
  31. .SH DESCRIPTION
  32. .B dpkg\-buildpackage
  33. is a program that automates the process of building a Debian package. It
  34. consists of the following steps:
  35. .IP \fB1.\fP 3
  36. It prepares the build environment by setting various environment
  37. variables (see \fBENVIRONMENT\fP), runs the \fBinit\fP hook, and calls
  38. \fBdpkg\-source \-\-before\-build\fP (unless \fB\-T\fP or \fB\-\-target\fP
  39. has been used).
  40. .IP \fB2.\fP 3
  41. It checks that the build-dependencies and build-conflicts
  42. are satisfied (unless \fB\-d\fP or \fB\-\-no\-check\-builddeps\fP is specified).
  43. .IP \fB3.\fP 3
  44. If a specific target has been selected with the \fB\-T\fP or \fB\-\-target\fP
  45. option, it calls that target and stops here. Otherwise it runs the
  46. \fBpreclean\fP hook and calls \fBfakeroot debian/rules clean\fP to
  47. clean the build-tree (unless \fB\-nc\fP or \fB\-\-no\-pre\-clean\fP
  48. is specified).
  49. .IP \fB4.\fP 3
  50. It runs the \fBsource\fP hook and calls \fBdpkg\-source \-b\fP to generate
  51. the source package (if a \fBsource\fP build has been requested with
  52. \fB\-\-build\fP or equivalent options).
  53. .IP \fB5.\fP 3
  54. It runs the \fBbuild\fP hook and calls \fBdebian/rules\fP \fIbuild-target\fP,
  55. then runs the \fBbinary\fP hook followed by \fBfakeroot debian/rules\fP
  56. \fIbinary-target\fP (unless a source-only build has been requested with
  57. \fB\-\-build=source\fP or equivalent options).
  58. Note that \fIbuild-target\fR and \fIbinary-target\fP are either \fBbuild\fP
  59. and \fBbinary\fP (default case, or if an \fBany\fP and \fBall\fP build
  60. has been requested with \fB\-\-build\fP or equivalent options), or
  61. \fBbuild\-arch\fP and \fBbinary\-arch\fP (if an \fBany\fP and not \fBall\fP
  62. build has been requested with \fB\-\-build\fP or equivalent options), or
  63. \fBbuild\-indep\fP and \fBbinary\-indep\fP (if an \fBall\fP and not \fBany\fP
  64. build has been requested with \fB\-\-build\fP or equivalent options).
  65. .IP \fB6.\fP 3
  66. Unless a source-only build has been requested, it runs the \fBbuildinfo\fP
  67. hook and calls \fBdpkg\-genbuildinfo\fP to generate a \fB.buildinfo\fP file.
  68. Several \fBdpkg\-buildpackage\fP options are forwarded to
  69. \fBdpkg\-genbuildinfo\fP.
  70. .IP \fB7.\fP 3
  71. It runs the \fBchanges\fP hook and calls \fBdpkg\-genchanges\fP to
  72. generate a \fB.changes\fP file.
  73. The name of the \fB.changes\fP file will depend on the type of build and
  74. will be as specific as necessary but not more;
  75. for a build that includes \fBany\fP the name will be
  76. \fIsource-name\fP\fB_\fP\fIsource-version\fP\fB_\fP\fIarch\fP\fB.changes\fP,
  77. or otherwise for a build that includes \fBall\fP the name will be
  78. \fIsource-name\fP\fB_\fP\fIsource-version\fP\fB_\fP\fBall.changes\fP,
  79. or otherwise for a build that includes \fBsource\fP the name will be
  80. \fIsource-name\fP\fB_\fP\fIsource-version\fP\fB_\fP\fBsource.changes\fP.
  81. Many \fBdpkg\-buildpackage\fP options are forwarded to
  82. \fBdpkg\-genchanges\fP.
  83. .IP \fB8.\fP 3
  84. It runs the \fBpostclean\fP hook and if \fB\-tc\fP or \fB\-\-post\-clean\fP
  85. is specified, it will call \fBfakeroot debian/rules clean\fP again.
  86. .IP \fB9.\fP 3
  87. It calls \fBdpkg\-source \-\-after\-build\fP.
  88. .IP \fB10.\fP 3
  89. It runs the \fBcheck\fP hook and calls a package checker for the
  90. \fB.changes\fP file (if a command is specified in \fBDEB_CHECK_COMMAND\fP or
  91. with \fB\-\-check\-command\fP).
  92. .IP \fB11.\fP 3
  93. It runs the \fBsign\fP hook and calls \fBgpg2\fP or \fBgpg\fP to sign
  94. the \fB.dsc\fP file (if any, unless \fB\-us\fP or \fB\-\-unsigned\-source\fP
  95. is specified or on UNRELEASED builds), and the \fB.changes\fP file
  96. (unless \fB\-uc\fP or \fB\-\-unsigned\-changes\fP is specified or on
  97. UNRELEASED builds).
  98. .IP \fB12.\fP 3
  99. It runs the \fBdone\fP hook.
  100. .
  101. .SH OPTIONS
  102. All long options can be specified both on the command line and in the
  103. \fBdpkg\-buildpackage\fP system and user configuration files.
  104. Each line in the configuration file is either an option (exactly the same
  105. as the command line option but without leading hyphens) or a comment (if
  106. it starts with a ‘\fB#\fP’).
  107. .TP
  108. .BI \-\-build= type
  109. Specifies the build \fItype\fP from a comma-separated list of components
  110. (since dpkg 1.18.5).
  111. Passed to \fBdpkg\-genchanges\fP.
  112. The allowed values are:
  113. .RS
  114. .TP
  115. .B source
  116. Builds the source package.
  117. Note: when using this value standalone and if what you want is simply to
  118. (re-)build the source package, using \fBdpkg\-source\fP is always better
  119. as it does not require any build dependencies to be installed to be able
  120. to call the \fBclean\fP target.
  121. .TP
  122. .B any
  123. Builds the architecture specific binary packages.
  124. .TP
  125. .B all
  126. Builds the architecture independent binary packages.
  127. .TP
  128. .B binary
  129. Builds the architecture specific and independent binary packages.
  130. This is an alias for \fBany,all\fP.
  131. .TP
  132. .B full
  133. Builds everything.
  134. This is an alias for \fBsource,any,all\fP, and the same as the default
  135. case when no build option is specified.
  136. .RE
  137. .TP
  138. .B \-g
  139. Equivalent to \fB\-\-build=source,all\fP (since dpkg 1.17.11).
  140. .TP
  141. .B \-G
  142. Equivalent to \fB\-\-build=source,any\fP (since dpkg 1.17.11).
  143. .TP
  144. .B \-b
  145. Equivalent to \fB\-\-build=binary\fP or \fB\-\-build=any,all\fP.
  146. .TP
  147. .B \-B
  148. Equivalent to \fB\-\-build=any\fP.
  149. .TP
  150. .B \-A
  151. Equivalent to \fB\-\-build=all\fP.
  152. .TP
  153. .B \-S
  154. Equivalent to \fB\-\-build=source\fP.
  155. .TP
  156. .B \-F
  157. Equivalent to \fB\-\-build=full\fP, \fB\-\-build=source,binary\fP or
  158. \fB\-\-build=source,any,all\fP (since dpkg 1.15.8).
  159. .TP
  160. .BI \-\-target= target
  161. .TQ
  162. .BI "\-\-target " target
  163. .TQ
  164. .BR \-T ", " \-\-rules\-target= \fItarget\fP
  165. Calls \fBdebian/rules\fP \fItarget\fP after having setup the build
  166. environment and stops the package build process here (since dpkg 1.15.0,
  167. long option since dpkg 1.18.8).
  168. If \fB\-\-as\-root\fP is also given, then the command is executed
  169. as root (see \fB\-\-root\-command\fP).
  170. Note that known targets that are required to
  171. be run as root do not need this option (i.e. the \fBclean\fP, \fBbinary\fP,
  172. \fBbinary\-arch\fP and \fBbinary\-indep\fP targets).
  173. .TP
  174. .B \-\-as\-root
  175. Only meaningful together with \fB\-\-target\fP (since dpkg 1.15.0).
  176. Requires that the target be run with root rights.
  177. .TP
  178. .B \-si
  179. .TQ
  180. .B \-sa
  181. .TQ
  182. .B \-sd
  183. .TQ
  184. .BI \-v version
  185. .TQ
  186. .BI \-C changes-description
  187. .TQ
  188. .BR \-m ", " \-\-release\-by= \fImaintainer-address\fP
  189. .TQ
  190. .BR \-e ", " \-\-build\-by= \fImaintainer-address\fP
  191. Passed unchanged to \fBdpkg\-genchanges\fP. See its manual page.
  192. .TP
  193. .BR \-a ", " \-\-host\-arch " \fIarchitecture\fP"
  194. Specify the Debian architecture we build for (long option since dpkg 1.17.17).
  195. The architecture of the
  196. machine we build on is determined automatically, and is also the default
  197. for the host machine.
  198. .TP
  199. .BR \-t ", " \-\-host\-type " \fIgnu-system-type\fP"
  200. Specify the GNU system type we build for (long option since dpkg 1.17.17).
  201. It can be used in place
  202. of \fB\-\-host\-arch\fP or as a complement to override the default GNU system type
  203. of the host Debian architecture.
  204. .TP
  205. .BR \-\-target\-arch " \fIarchitecture\fP"
  206. Specify the Debian architecture the binaries built will build for
  207. (since dpkg 1.17.17).
  208. The default value is the host machine.
  209. .TP
  210. .BR \-\-target\-type " \fIgnu-system-type\fP"
  211. Specify the GNU system type the binaries built will build for
  212. (since dpkg 1.17.17).
  213. It can be
  214. used in place of \fB\-\-target\-arch\fP or as a complement to override the
  215. default GNU system type of the target Debian architecture.
  216. .TP
  217. .BR \-P ", " \-\-build\-profiles= \fIprofile\fP[ , ...]
  218. Specify the profile(s) we build, as a comma-separated list (since dpkg 1.17.2,
  219. long option since dpkg 1.18.8).
  220. The default
  221. behavior is to build for no specific profile. Also sets them (as a space
  222. separated list) as the \fBDEB_BUILD_PROFILES\fP environment variable which
  223. allows, for example, \fBdebian/rules\fP files to use this information for
  224. conditional builds.
  225. .TP
  226. .BR \-j ", " \-\-jobs [=\fIjobs\fP|\fBauto\fP]
  227. Number of jobs allowed to be run simultaneously, number of jobs matching
  228. the number of online processors if \fBauto\fP is specified
  229. (since dpkg 1.17.10), or unlimited number if \fIjobs\fP is not specified,
  230. equivalent to the
  231. .BR make (1)
  232. option of the same name (since dpkg 1.14.7, long option since dpkg 1.18.8).
  233. Will add itself to the \fBMAKEFLAGS\fP
  234. environment variable, which should cause all subsequent make
  235. invocations to inherit the option, thus forcing the parallel setting on
  236. the packaging (and possibly the upstream build system if that uses make)
  237. regardless of their support for parallel builds, which might cause build
  238. failures.
  239. Also adds \fBparallel=\fP\fIjobs\fP or
  240. \fBparallel\fP to the \fBDEB_BUILD_OPTIONS\fP environment variable which
  241. allows debian/rules files to use this information for their own purposes.
  242. The \fB\-j\fP value will override the \fBparallel=\fP\fIjobs\fP or
  243. \fBparallel\fP option in the \fBDEB_BUILD_OPTIONS\fP environment variable.
  244. Note that the \fBauto\fP value will get replaced by the actual number of
  245. currently active processors, and as such will not get propagated to any
  246. child process. If the number of online processors cannot be inferred then
  247. the code will fallback to using an unlimited number.
  248. .TP
  249. .BR \-J ", " \-\-jobs\-try [=\fIjobs\fP|\fBauto\fP]
  250. This option (since dpkg 1.18.2, long option since dpkg 1.18.8) is equivalent
  251. to the \fB\-j\fP option except that it does not set the \fBMAKEFLAGS\fP
  252. environment variable, and as such it is safer to use with any package
  253. including those that are not parallel-build safe.
  254. \fBauto\fP is the default behavior (since dpkg 1.18.11).
  255. .TP
  256. .BR \-D ", " \-\-check\-builddeps
  257. Check build dependencies and conflicts; abort if unsatisfied (long option
  258. since dpkg 1.18.8).
  259. This is the default behavior.
  260. .TP
  261. .BR \-d ", " \-\-no\-check\-builddeps
  262. Do not check build dependencies and conflicts (long option since dpkg 1.18.8).
  263. .TP
  264. .B \-\-ignore\-builtin\-builddeps
  265. Do not check built-in build dependencies and conflicts (since dpkg 1.18.2).
  266. These are the distribution specific implicit build dependencies usually
  267. required in a build environment, the so called Build-Essential package set.
  268. .TP
  269. .BR \-nc ", " \-\-no\-pre\-clean
  270. Do not clean the source tree (long option since dpkg 1.18.8).
  271. Implies \fB\-b\fP if nothing else has been selected among \fB\-F\fP,
  272. \fB\-g\fP, \fB\-G\fP, \fB\-B\fP, \fB\-A\fP or \fB\-S\fP.
  273. Implies \fB\-d\fP with \fB\-S\fP (since dpkg 1.18.0).
  274. .TP
  275. .BR \-\-pre\-clean
  276. Clean the source tree before building (since dpkg 1.18.8).
  277. .TP
  278. .BR \-tc ", " \-\-post\-clean
  279. Clean the source tree (using
  280. .I gain-root-command
  281. .BR "debian/rules clean" )
  282. after the package has been built (long option since dpkg 1.18.8).
  283. .TP
  284. .BR \-r ", " \-\-root\-command= \fIgain-root-command\fP
  285. When
  286. .B dpkg\-buildpackage
  287. needs to execute part of the build process as root, it prefixes the
  288. command it executes with
  289. .I gain-root-command
  290. if one has been specified (long option since dpkg 1.18.8).
  291. Otherwise, if none has been specified,
  292. \fBfakeroot\fP will be used by default, if the command is present.
  293. .I gain-root-command
  294. should start with the name of a program on the
  295. .B PATH
  296. and will get as arguments the name of the real command to run and the
  297. arguments it should take.
  298. .I gain-root-command
  299. can include parameters (they must be space-separated) but no shell
  300. metacharacters.
  301. .I gain-root-command
  302. might typically be
  303. .BR fakeroot ", " sudo ", " super " or " really .
  304. .B su
  305. is not suitable, since it can only invoke the user's shell with
  306. .B \-c
  307. instead of passing arguments individually to the command to be run.
  308. .TP
  309. .BR \-R ", " \-\-rules-file= \fIrules-file\fP
  310. Building a Debian package usually involves invoking
  311. .B debian/rules
  312. as a command with several standard parameters (since dpkg 1.14.17,
  313. long option since dpkg 1.18.8).
  314. With this option it's
  315. possible to use another program invocation to build the package (it can
  316. include space separated parameters).
  317. Alternatively it can be used to execute the standard rules file with
  318. another make program (for example by using
  319. .B /usr/local/bin/make \-f debian/rules
  320. as \fIrules-file\fR).
  321. .TP
  322. .BI \-\-check\-command= check-command
  323. Command used to check the \fB.changes\fP file itself and any artifact built
  324. referenced in the file (since dpkg 1.17.6).
  325. The command should take the \fB.changes\fP pathname
  326. as an argument. This command will usually be \fBlintian\fP.
  327. .TP
  328. .BI \-\-check\-option= opt
  329. Pass option \fIopt\fP to the \fIcheck-command\fP specified with
  330. \fBDEB_CHECK_COMMAND\fP or \fB\-\-check\-command\fP (since dpkg 1.17.6).
  331. Can be used multiple times.
  332. .TP
  333. .BI \-\-hook\- hook-name = hook-command
  334. Set the specified shell code \fIhook-command\fP as the hook \fIhook-name\fP,
  335. which will run at the times specified in the run steps (since dpkg 1.17.6).
  336. The hooks will
  337. always be executed even if the following action is not performed (except
  338. for the \fBbinary\fP hook).
  339. Note: Hooks can affect the build process, and cause build failures if
  340. their commands fail, so watch out for unintended consequences.
  341. The current \fIhook-name\fP supported are:
  342. .B init preclean source build binary changes postclean check sign done
  343. The \fIhook-command\fP supports the following substitution format string,
  344. which will get applied to it before execution:
  345. .RS
  346. .TP
  347. .B %%
  348. A single % character.
  349. .TP
  350. .B %a
  351. A boolean value (0 or 1), representing whether the following action is
  352. being performed.
  353. .TP
  354. .B %p
  355. The source package name.
  356. .TP
  357. .B %v
  358. The source package version.
  359. .TP
  360. .B %s
  361. The source package version (without the epoch).
  362. .TP
  363. .B %u
  364. The upstream version.
  365. .RE
  366. .TP
  367. .BI \-\-buildinfo-id= identifier
  368. Specify the identifier part of the \fB.buildinfo\fP file name
  369. (since dpkg 1.18.11).
  370. By default, \fBdpkg\-buildpackage\fP will create an identifier using
  371. the current time and the first characters of the MD5 hash.
  372. An arbitrary identifier can be specified as a replacement.
  373. The identifier has the same restriction as package names: it must consist
  374. only of lower case letters (a-z), digits (0-9), plus (+) and minus (\-)
  375. signs, and periods (.), be at least two characters long and must start
  376. with an alphanumeric character.
  377. .TP
  378. .BI \-\-buildinfo\-option= opt
  379. Pass option \fIopt\fP to \fBdpkg\-genbuildinfo\fP (since dpkg 1.18.11).
  380. Can be used multiple times.
  381. .TP
  382. .BR \-p ", " \-\-sign\-command= \fIsign-command\fP
  383. When \fBdpkg\-buildpackage\fP needs to execute GPG to sign a source
  384. control (\fB.dsc\fP) file or a \fB.changes\fP file it will run
  385. \fIsign-command\fP (searching the \fBPATH\fP if necessary) instead of
  386. \fBgpg2\fP or \fBgpg\fP (long option since dpkg 1.18.8).
  387. \fIsign-command\fP will get all the arguments
  388. that \fBgpg2\fP or \fBgpg\fP would have gotten. \fIsign-command\fP
  389. should not contain spaces or any other shell metacharacters.
  390. .TP
  391. .BR \-k ", " \-\-sign\-key= \fIkey-id\fP
  392. Specify a key-ID to use when signing packages (long option since dpkg 1.18.8).
  393. .TP
  394. .BR \-us ", " \-\-unsigned\-source
  395. Do not sign the source package (long option since dpkg 1.18.8).
  396. .TP
  397. .BR \-uc ", " \-\-unsigned\-changes
  398. Do not sign the \fB.changes\fP file (long option since dpkg 1.18.8).
  399. .TP
  400. .BR \-\-force\-sign
  401. Force the signing of the resulting files (since dpkg 1.17.0), regardless of
  402. \fB\-us\fP, \fB\-\-unsigned\-source\fP, \fB\-uc\fP, \fB\-\-unsigned\-changes\fP
  403. or other internal heuristics.
  404. .TP
  405. .BR \-sn
  406. .TQ
  407. .BR \-ss
  408. .TQ
  409. .BR \-sA
  410. .TQ
  411. .BR \-sk
  412. .TQ
  413. .BR \-su
  414. .TQ
  415. .BR \-sr
  416. .TQ
  417. .BR \-sK
  418. .TQ
  419. .BR \-sU
  420. .TQ
  421. .BR \-sR
  422. .TQ
  423. .BR \-i ", " \-\-diff\-ignore [=\fIregex\fP]
  424. .TQ
  425. .BR \-I ", " \-\-tar\-ignore [=\fIpattern\fP]
  426. .TQ
  427. .BR \-z ", " \-\-compression\-level= \fIlevel\fP
  428. .TQ
  429. .BR \-Z ", " \-\-compression= \fIcompressor\fP
  430. Passed unchanged to \fBdpkg\-source\fP. See its manual page.
  431. .TP
  432. .BI \-\-source\-option= opt
  433. Pass option \fIopt\fP to \fBdpkg\-source\fP (since dpkg 1.15.6).
  434. Can be used multiple times.
  435. .TP
  436. .BI \-\-changes\-option= opt
  437. Pass option \fIopt\fP to \fBdpkg\-genchanges\fP (since dpkg 1.15.6).
  438. Can be used multiple times.
  439. .TP
  440. .BI \-\-admindir= dir
  441. .TQ
  442. .BI "\-\-admindir " dir
  443. Change the location of the \fBdpkg\fR database (since dpkg 1.14.0).
  444. The default location is \fI%ADMINDIR%\fP.
  445. .TP
  446. .BR \-? ", " \-\-help
  447. Show the usage message and exit.
  448. .TP
  449. .BR \-\-version
  450. Show the version and exit.
  451. .
  452. .SH ENVIRONMENT
  453. .SS External environment
  454. .TP
  455. .B DEB_CHECK_COMMAND
  456. If set, it will be used as the command to check the \fB.changes\fP file
  457. (since dpkg 1.17.6).
  458. Overridden by the \fB\-\-check\-command\fP option.
  459. .TP
  460. .B DEB_SIGN_KEYID
  461. If set, it will be used to sign the \fB.changes\fP and \fB.dsc\fP files
  462. (since dpkg 1.17.2).
  463. Overridden by the \fB\-\-sign\-key\fP option.
  464. .TP
  465. .B DEB_BUILD_OPTIONS
  466. If set, and containing \fBnocheck\fP the \fBDEB_CHECK_COMMAND\fP variable
  467. will be ignored.
  468. .TP
  469. .B DEB_BUILD_PROFILES
  470. If set, it will be used as the active build profile(s) for the package
  471. being built (since dpkg 1.17.2).
  472. It is a space separated list of profile names.
  473. Overridden by the \fB\-P\fP option.
  474. .TP
  475. .B DPKG_COLORS
  476. Sets the color mode (since dpkg 1.18.5).
  477. The currently accepted values are: \fBauto\fP, \fBalways\fP and
  478. \fBnever\fP (default).
  479. .SS Internal environment
  480. Even if \fBdpkg\-buildpackage\fP exports some variables, \fBdebian/rules\fP
  481. should not rely on their presence and should instead use the
  482. respective interface to retrieve the needed values, because that
  483. file is the main entry point to build packages and running it
  484. standalone should be supported.
  485. .TP
  486. .B DEB_BUILD_*
  487. .TQ
  488. .B DEB_HOST_*
  489. .TQ
  490. .B DEB_TARGET_*
  491. \fBdpkg\-architecture\fP is called with the \fB\-a\fP and \fB\-t\fP
  492. parameters forwarded. Any variable that is output by its \fB\-s\fP
  493. option is integrated in the build environment.
  494. .TP
  495. .B SOURCE_DATE_EPOCH
  496. This variable is set to the Unix timestamp since the epoch of the
  497. latest entry in \fIdebian/changelog\fP, if it is not already defined.
  498. .
  499. .SH FILES
  500. .TP
  501. .I %PKGCONFDIR%/buildpackage.conf
  502. System wide configuration file
  503. .TP
  504. .IR $XDG_CONFIG_HOME/dpkg/buildpackage.conf " or"
  505. .TQ
  506. .I $HOME/.config/dpkg/buildpackage.conf
  507. User configuration file.
  508. .
  509. .SH NOTES
  510. .SS Compiler flags are no longer exported
  511. Between dpkg 1.14.17 and 1.16.1, \fBdpkg\-buildpackage\fP
  512. exported compiler flags (\fBCFLAGS\fP, \fBCXXFLAGS\fP, \fBFFLAGS\fP,
  513. \fBCPPFLAGS\fP and \fBLDFLAGS\fP) with values as returned
  514. by \fBdpkg\-buildflags\fP. This is no longer the case.
  515. .SS Default build targets
  516. \fBdpkg\-buildpackage\fP is using the \fBbuild\-arch\fP and
  517. \fBbuild\-indep\fP targets since dpkg 1.16.2. Those targets are thus
  518. mandatory. But to avoid breakages of existing packages, and ease
  519. the transition, if the source package does not build both architecture
  520. independent and dependent binary packages (since dpkg 1.18.8) it will
  521. fallback to use the \fBbuild\fP target if \fBmake \-f debian/rules \-qn\fP
  522. \fIbuild-target\fP returns 2 as exit code.
  523. .SH BUGS
  524. It should be possible to specify spaces and shell metacharacters
  525. and initial arguments for
  526. .IR gain-root-command " and " sign-command .
  527. .
  528. .SH SEE ALSO
  529. .ad l
  530. .BR dpkg\-source (1),
  531. .BR dpkg\-architecture (1),
  532. .BR dpkg\-buildflags (1),
  533. .BR dpkg\-genbuildinfo (1),
  534. .BR dpkg\-genchanges (1),
  535. .BR fakeroot (1),
  536. .BR lintian (1),
  537. .BR gpg2 (1),
  538. .BR gpg (1).