dpkg-buildpackage.man 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  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 one or more specific targets have been selected with the \fB\-T\fP or
  45. \fB\-\-target\fP option, it calls those targets and stops here. Otherwise it
  46. runs the \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. .BR \-\-target= \fItarget\fP[,...]
  161. .TQ
  162. .BR "\-\-target " \fItarget\fP[,...]
  163. .TQ
  164. .BR \-T ", " \-\-rules\-target= \fItarget\fP[,...]
  165. Calls \fBdebian/rules\fP \fItarget\fP once per target specified, after
  166. having setup the build environment (except for calling
  167. \fBdpkg\-source \-\-before\-build\fP), and stops the package build process
  168. here (since dpkg 1.15.0, long option since dpkg 1.18.8, multi-target
  169. support since dpkg 1.18.16).
  170. If \fB\-\-as\-root\fP is also given, then the command is executed
  171. as root (see \fB\-\-root\-command\fP).
  172. Note that known targets that are required to
  173. be run as root do not need this option (i.e. the \fBclean\fP, \fBbinary\fP,
  174. \fBbinary\-arch\fP and \fBbinary\-indep\fP targets).
  175. .TP
  176. .B \-\-as\-root
  177. Only meaningful together with \fB\-\-target\fP (since dpkg 1.15.0).
  178. Requires that the target be run with root rights.
  179. .TP
  180. .B \-si
  181. .TQ
  182. .B \-sa
  183. .TQ
  184. .B \-sd
  185. .TQ
  186. .BI \-v version
  187. .TQ
  188. .BI \-C changes-description
  189. .TQ
  190. .BR \-m ", " \-\-release\-by= \fImaintainer-address\fP
  191. .TQ
  192. .BR \-e ", " \-\-build\-by= \fImaintainer-address\fP
  193. Passed unchanged to \fBdpkg\-genchanges\fP. See its manual page.
  194. .TP
  195. .BR \-a ", " \-\-host\-arch " \fIarchitecture\fP"
  196. Specify the Debian architecture we build for (long option since dpkg 1.17.17).
  197. The architecture of the
  198. machine we build on is determined automatically, and is also the default
  199. for the host machine.
  200. .TP
  201. .BR \-t ", " \-\-host\-type " \fIgnu-system-type\fP"
  202. Specify the GNU system type we build for (long option since dpkg 1.17.17).
  203. It can be used in place
  204. of \fB\-\-host\-arch\fP or as a complement to override the default GNU system type
  205. of the host Debian architecture.
  206. .TP
  207. .BR \-\-target\-arch " \fIarchitecture\fP"
  208. Specify the Debian architecture the binaries built will build for
  209. (since dpkg 1.17.17).
  210. The default value is the host machine.
  211. .TP
  212. .BR \-\-target\-type " \fIgnu-system-type\fP"
  213. Specify the GNU system type the binaries built will build for
  214. (since dpkg 1.17.17).
  215. It can be
  216. used in place of \fB\-\-target\-arch\fP or as a complement to override the
  217. default GNU system type of the target Debian architecture.
  218. .TP
  219. .BR \-P ", " \-\-build\-profiles= \fIprofile\fP[ , ...]
  220. Specify the profile(s) we build, as a comma-separated list (since dpkg 1.17.2,
  221. long option since dpkg 1.18.8).
  222. The default
  223. behavior is to build for no specific profile. Also sets them (as a space
  224. separated list) as the \fBDEB_BUILD_PROFILES\fP environment variable which
  225. allows, for example, \fBdebian/rules\fP files to use this information for
  226. conditional builds.
  227. .TP
  228. .BR \-j ", " \-\-jobs [=\fIjobs\fP|\fBauto\fP]
  229. Number of jobs allowed to be run simultaneously, number of jobs matching
  230. the number of online processors if \fBauto\fP is specified
  231. (since dpkg 1.17.10), or unlimited number if \fIjobs\fP is not specified,
  232. equivalent to the
  233. .BR make (1)
  234. option of the same name (since dpkg 1.14.7, long option since dpkg 1.18.8).
  235. Will add itself to the \fBMAKEFLAGS\fP
  236. environment variable, which should cause all subsequent make
  237. invocations to inherit the option, thus forcing the parallel setting on
  238. the packaging (and possibly the upstream build system if that uses make)
  239. regardless of their support for parallel builds, which might cause build
  240. failures.
  241. Also adds \fBparallel=\fP\fIjobs\fP or
  242. \fBparallel\fP to the \fBDEB_BUILD_OPTIONS\fP environment variable which
  243. allows debian/rules files to use this information for their own purposes.
  244. The \fB\-j\fP value will override the \fBparallel=\fP\fIjobs\fP or
  245. \fBparallel\fP option in the \fBDEB_BUILD_OPTIONS\fP environment variable.
  246. Note that the \fBauto\fP value will get replaced by the actual number of
  247. currently active processors, and as such will not get propagated to any
  248. child process. If the number of online processors cannot be inferred then
  249. the code will fallback to using serial execution (since dpkg 1.18.15),
  250. although this should only happen on exotic and unsupported systems.
  251. .TP
  252. .BR \-J ", " \-\-jobs\-try [=\fIjobs\fP|\fBauto\fP]
  253. This option (since dpkg 1.18.2, long option since dpkg 1.18.8) is equivalent
  254. to the \fB\-j\fP option except that it does not set the \fBMAKEFLAGS\fP
  255. environment variable, and as such it is safer to use with any package
  256. including those that are not parallel-build safe.
  257. \fBauto\fP is the default behavior (since dpkg 1.18.11). Setting the number
  258. of jobs to 1 will restore a serial behavior.
  259. .TP
  260. .BR \-D ", " \-\-check\-builddeps
  261. Check build dependencies and conflicts; abort if unsatisfied (long option
  262. since dpkg 1.18.8).
  263. This is the default behavior.
  264. .TP
  265. .BR \-d ", " \-\-no\-check\-builddeps
  266. Do not check build dependencies and conflicts (long option since dpkg 1.18.8).
  267. .TP
  268. .B \-\-ignore\-builtin\-builddeps
  269. Do not check built-in build dependencies and conflicts (since dpkg 1.18.2).
  270. These are the distribution specific implicit build dependencies usually
  271. required in a build environment, the so called Build-Essential package set.
  272. .TP
  273. .BR \-nc ", " \-\-no\-pre\-clean
  274. Do not clean the source tree (long option since dpkg 1.18.8).
  275. Implies \fB\-b\fP if nothing else has been selected among \fB\-F\fP,
  276. \fB\-g\fP, \fB\-G\fP, \fB\-B\fP, \fB\-A\fP or \fB\-S\fP.
  277. Implies \fB\-d\fP with \fB\-S\fP (since dpkg 1.18.0).
  278. .TP
  279. .BR \-\-pre\-clean
  280. Clean the source tree before building (since dpkg 1.18.8).
  281. .TP
  282. .BR \-tc ", " \-\-post\-clean
  283. Clean the source tree (using
  284. .I gain-root-command
  285. .BR "debian/rules clean" )
  286. after the package has been built (long option since dpkg 1.18.8).
  287. .TP
  288. .BR \-r ", " \-\-root\-command= \fIgain-root-command\fP
  289. When
  290. .B dpkg\-buildpackage
  291. needs to execute part of the build process as root, it prefixes the
  292. command it executes with
  293. .I gain-root-command
  294. if one has been specified (long option since dpkg 1.18.8).
  295. Otherwise, if none has been specified,
  296. \fBfakeroot\fP will be used by default, if the command is present.
  297. .I gain-root-command
  298. should start with the name of a program on the
  299. .B PATH
  300. and will get as arguments the name of the real command to run and the
  301. arguments it should take.
  302. .I gain-root-command
  303. can include parameters (they must be space-separated) but no shell
  304. metacharacters.
  305. .I gain-root-command
  306. might typically be
  307. .BR fakeroot ", " sudo ", " super " or " really .
  308. .B su
  309. is not suitable, since it can only invoke the user's shell with
  310. .B \-c
  311. instead of passing arguments individually to the command to be run.
  312. .TP
  313. .BR \-R ", " \-\-rules-file= \fIrules-file\fP
  314. Building a Debian package usually involves invoking
  315. .B debian/rules
  316. as a command with several standard parameters (since dpkg 1.14.17,
  317. long option since dpkg 1.18.8).
  318. With this option it's
  319. possible to use another program invocation to build the package (it can
  320. include space separated parameters).
  321. Alternatively it can be used to execute the standard rules file with
  322. another make program (for example by using
  323. .B /usr/local/bin/make \-f debian/rules
  324. as \fIrules-file\fR).
  325. .TP
  326. .BI \-\-check\-command= check-command
  327. Command used to check the \fB.changes\fP file itself and any artifact built
  328. referenced in the file (since dpkg 1.17.6).
  329. The command should take the \fB.changes\fP pathname
  330. as an argument. This command will usually be \fBlintian\fP.
  331. .TP
  332. .BI \-\-check\-option= opt
  333. Pass option \fIopt\fP to the \fIcheck-command\fP specified with
  334. \fBDEB_CHECK_COMMAND\fP or \fB\-\-check\-command\fP (since dpkg 1.17.6).
  335. Can be used multiple times.
  336. .TP
  337. .BI \-\-hook\- hook-name = hook-command
  338. Set the specified shell code \fIhook-command\fP as the hook \fIhook-name\fP,
  339. which will run at the times specified in the run steps (since dpkg 1.17.6).
  340. The hooks will
  341. always be executed even if the following action is not performed (except
  342. for the \fBbinary\fP hook).
  343. All the hooks will run in the unpacked source directory.
  344. Note: Hooks can affect the build process, and cause build failures if
  345. their commands fail, so watch out for unintended consequences.
  346. The current \fIhook-name\fP supported are:
  347. .B init preclean source build binary changes postclean check sign done
  348. The \fIhook-command\fP supports the following substitution format string,
  349. which will get applied to it before execution:
  350. .RS
  351. .TP
  352. .B %%
  353. A single % character.
  354. .TP
  355. .B %a
  356. A boolean value (0 or 1), representing whether the following action is
  357. being performed.
  358. .TP
  359. .B %p
  360. The source package name.
  361. .TP
  362. .B %v
  363. The source package version.
  364. .TP
  365. .B %s
  366. The source package version (without the epoch).
  367. .TP
  368. .B %u
  369. The upstream version.
  370. .RE
  371. .TP
  372. .BI \-\-buildinfo\-option= opt
  373. Pass option \fIopt\fP to \fBdpkg\-genbuildinfo\fP (since dpkg 1.18.11).
  374. Can be used multiple times.
  375. .TP
  376. .BR \-p ", " \-\-sign\-command= \fIsign-command\fP
  377. When \fBdpkg\-buildpackage\fP needs to execute GPG to sign a source
  378. control (\fB.dsc\fP) file or a \fB.changes\fP file it will run
  379. \fIsign-command\fP (searching the \fBPATH\fP if necessary) instead of
  380. \fBgpg2\fP or \fBgpg\fP (long option since dpkg 1.18.8).
  381. \fIsign-command\fP will get all the arguments
  382. that \fBgpg2\fP or \fBgpg\fP would have gotten. \fIsign-command\fP
  383. should not contain spaces or any other shell metacharacters.
  384. .TP
  385. .BR \-k ", " \-\-sign\-key= \fIkey-id\fP
  386. Specify a key-ID to use when signing packages (long option since dpkg 1.18.8).
  387. .TP
  388. .BR \-us ", " \-\-unsigned\-source
  389. Do not sign the source package (long option since dpkg 1.18.8).
  390. .TP
  391. .BR \-uc ", " \-\-unsigned\-changes
  392. Do not sign the \fB.changes\fP file (long option since dpkg 1.18.8).
  393. .TP
  394. .BR \-\-force\-sign
  395. Force the signing of the resulting files (since dpkg 1.17.0), regardless of
  396. \fB\-us\fP, \fB\-\-unsigned\-source\fP, \fB\-uc\fP, \fB\-\-unsigned\-changes\fP
  397. or other internal heuristics.
  398. .TP
  399. .BR \-sn
  400. .TQ
  401. .BR \-ss
  402. .TQ
  403. .BR \-sA
  404. .TQ
  405. .BR \-sk
  406. .TQ
  407. .BR \-su
  408. .TQ
  409. .BR \-sr
  410. .TQ
  411. .BR \-sK
  412. .TQ
  413. .BR \-sU
  414. .TQ
  415. .BR \-sR
  416. .TQ
  417. .BR \-i ", " \-\-diff\-ignore [=\fIregex\fP]
  418. .TQ
  419. .BR \-I ", " \-\-tar\-ignore [=\fIpattern\fP]
  420. .TQ
  421. .BR \-z ", " \-\-compression\-level= \fIlevel\fP
  422. .TQ
  423. .BR \-Z ", " \-\-compression= \fIcompressor\fP
  424. Passed unchanged to \fBdpkg\-source\fP. See its manual page.
  425. .TP
  426. .BI \-\-source\-option= opt
  427. Pass option \fIopt\fP to \fBdpkg\-source\fP (since dpkg 1.15.6).
  428. Can be used multiple times.
  429. .TP
  430. .BI \-\-changes\-option= opt
  431. Pass option \fIopt\fP to \fBdpkg\-genchanges\fP (since dpkg 1.15.6).
  432. Can be used multiple times.
  433. .TP
  434. .BI \-\-admindir= dir
  435. .TQ
  436. .BI "\-\-admindir " dir
  437. Change the location of the \fBdpkg\fR database (since dpkg 1.14.0).
  438. The default location is \fI%ADMINDIR%\fP.
  439. .TP
  440. .BR \-? ", " \-\-help
  441. Show the usage message and exit.
  442. .TP
  443. .BR \-\-version
  444. Show the version and exit.
  445. .
  446. .SH ENVIRONMENT
  447. .SS External environment
  448. .TP
  449. .B DEB_CHECK_COMMAND
  450. If set, it will be used as the command to check the \fB.changes\fP file
  451. (since dpkg 1.17.6).
  452. Overridden by the \fB\-\-check\-command\fP option.
  453. .TP
  454. .B DEB_SIGN_KEYID
  455. If set, it will be used to sign the \fB.changes\fP and \fB.dsc\fP files
  456. (since dpkg 1.17.2).
  457. Overridden by the \fB\-\-sign\-key\fP option.
  458. .TP
  459. .B DEB_BUILD_OPTIONS
  460. If set, it will contain a space-separated list of options that might
  461. affect the build process in \fIdebian/rules\fP, and the behavior of some
  462. dpkg commands.
  463. With \fBnocheck\fP the \fBDEB_CHECK_COMMAND\fP variable will be ignored.
  464. With \fBparallel=\fP\fIN\fP the parallel jobs will be set to \fIN\fP,
  465. overridden by the \fB\-\-jobs\-try\fP option.
  466. .TP
  467. .B DEB_BUILD_PROFILES
  468. If set, it will be used as the active build profile(s) for the package
  469. being built (since dpkg 1.17.2).
  470. It is a space separated list of profile names.
  471. Overridden by the \fB\-P\fP option.
  472. .TP
  473. .B DPKG_COLORS
  474. Sets the color mode (since dpkg 1.18.5).
  475. The currently accepted values are: \fBauto\fP (default), \fBalways\fP and
  476. \fBnever\fP.
  477. .SS Internal environment
  478. Even if \fBdpkg\-buildpackage\fP exports some variables, \fBdebian/rules\fP
  479. should not rely on their presence and should instead use the
  480. respective interface to retrieve the needed values, because that
  481. file is the main entry point to build packages and running it
  482. standalone should be supported.
  483. .TP
  484. .B DEB_BUILD_*
  485. .TQ
  486. .B DEB_HOST_*
  487. .TQ
  488. .B DEB_TARGET_*
  489. \fBdpkg\-architecture\fP is called with the \fB\-a\fP and \fB\-t\fP
  490. parameters forwarded. Any variable that is output by its \fB\-s\fP
  491. option is integrated in the build environment.
  492. .TP
  493. .B SOURCE_DATE_EPOCH
  494. This variable is set to the Unix timestamp since the epoch of the
  495. latest entry in \fIdebian/changelog\fP, if it is not already defined.
  496. .
  497. .SH FILES
  498. .TP
  499. .I %PKGCONFDIR%/buildpackage.conf
  500. System wide configuration file
  501. .TP
  502. .IR $XDG_CONFIG_HOME/dpkg/buildpackage.conf " or"
  503. .TQ
  504. .I $HOME/.config/dpkg/buildpackage.conf
  505. User configuration file.
  506. .
  507. .SH NOTES
  508. .SS Compiler flags are no longer exported
  509. Between dpkg 1.14.17 and 1.16.1, \fBdpkg\-buildpackage\fP
  510. exported compiler flags (\fBCFLAGS\fP, \fBCXXFLAGS\fP, \fBFFLAGS\fP,
  511. \fBCPPFLAGS\fP and \fBLDFLAGS\fP) with values as returned
  512. by \fBdpkg\-buildflags\fP. This is no longer the case.
  513. .SS Default build targets
  514. \fBdpkg\-buildpackage\fP is using the \fBbuild\-arch\fP and
  515. \fBbuild\-indep\fP targets since dpkg 1.16.2. Those targets are thus
  516. mandatory. But to avoid breakages of existing packages, and ease
  517. the transition, if the source package does not build both architecture
  518. independent and dependent binary packages (since dpkg 1.18.8) it will
  519. fallback to use the \fBbuild\fP target if \fBmake \-f debian/rules \-qn\fP
  520. \fIbuild-target\fP returns 2 as exit code.
  521. .SH BUGS
  522. It should be possible to specify spaces and shell metacharacters
  523. and initial arguments for
  524. .IR gain-root-command " and " sign-command .
  525. .
  526. .SH SEE ALSO
  527. .ad l
  528. .BR dpkg\-source (1),
  529. .BR dpkg\-architecture (1),
  530. .BR dpkg\-buildflags (1),
  531. .BR dpkg\-genbuildinfo (1),
  532. .BR dpkg\-genchanges (1),
  533. .BR fakeroot (1),
  534. .BR lintian (1),
  535. .BR gpg2 (1),
  536. .BR gpg (1).