dpkg-buildpackage.man 20 KB

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