dpkg-buildpackage.1 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. .TH dpkg\-buildpackage 1 "2008-03-14" "Debian Project" "dpkg utilities"
  2. .SH NAME
  3. dpkg\-buildpackage \- build binary or source packages from sources
  4. .
  5. .SH SYNOPSIS
  6. .B dpkg\-buildpackage
  7. .RI [ options ]
  8. .
  9. .SH DESCRIPTION
  10. .B dpkg\-buildpackage
  11. is a control script which can be used to help automate the building of
  12. a package.
  13. .
  14. .SH OPTIONS
  15. .TP
  16. .B \-b
  17. Specifies a binary-only build, no source files are to be built and/or
  18. distributed.
  19. .TP
  20. .B \-B
  21. Specifies a binary-only build, no architecture independent binary package
  22. files are to be distributed either.
  23. .TP
  24. .B \-S
  25. Specifies a source-only build, no binary packages need to be made.
  26. .PP
  27. The \fB-s\fP\fIx\fP options control whether the original source archive is
  28. included in the upload if any source is being generated (i.e.
  29. .BR \-b " or " \-B
  30. haven't been used).
  31. .TP
  32. .B \-si
  33. By default, or if specified, the original source will be included if the
  34. version number ends in
  35. .BR \-0 " or " \-1 ,
  36. i.e. if the Debian revision part of the version number is
  37. .BR 0 " or " 1 .
  38. .TP
  39. .B \-sa
  40. Forces the inclusion of the original source.
  41. .TP
  42. .B \-sd
  43. Forces the exclusion of the original source and includes only the diff.
  44. .TP
  45. .BI \-a architecture
  46. Specify the Debian architecture we build for. The architecture of the
  47. machine we build on is determined automatically, and is also the default
  48. for the host machine.
  49. If the host architecture differs from the build architecture (as is the
  50. case for a cross-compilation), and if the environment variable
  51. \fBPKG_CONFIG_LIBDIR\fP is not set, then it is set to a value suitable for
  52. cross-compilation
  53. ("/usr/\fIgnu-system-type\fP/lib/pkgconfig/:/usr/share/pkgconfig").
  54. .TP
  55. .BI \-t gnu-system-type
  56. Specify the GNU system type we build for. It can be used in place
  57. of \-a or as a complement to override the default GNU system type
  58. of the target Debian architecture.
  59. .TP
  60. .BI \-j jobs
  61. Number of jobs allowed to be run simultaneously, equivalent to the
  62. .BR make (1)
  63. option of the same name. Will add itself to the MAKEFLAGS
  64. environment variable, which should cause all subsequent make
  65. invocations to inherit the option. Also adds \fBparallel=\fP\fIjobs\fP
  66. to the DEB_BUILD_OPTIONS environment variable which allows
  67. debian/rules files to use this information for their own purposes.
  68. The \fBparallel=\fP\fIjobs\fP in DEB_BUILD_OPTIONS environment variable
  69. will override the \fB-j\fP value if this option is given.
  70. .TP
  71. .BI \-v version
  72. Use changelog information from all versions strictly later than
  73. .IR version .
  74. .TP
  75. .BI \-C changesdescription
  76. Read the description of the changes from the file
  77. .I changesdescription
  78. rather than using the information from the source tree's changelog file.
  79. .TP
  80. .BI \-m maintaineraddress
  81. Use
  82. .I maintaineraddress
  83. as the name and email address of the maintainer for this package,
  84. rather than using the information from the source tree's control file.
  85. .TP
  86. .BI \-e maintaineraddress
  87. Use
  88. .I maintaineraddress
  89. as the name and email address of the maintainer for this upload,
  90. rather than using the information from the source tree's changelog.
  91. .TP
  92. .B \-D
  93. Check build dependencies and conflicts; abort if unsatisfied.
  94. .TP
  95. .B \-d
  96. Do not check build dependencies and conflicts.
  97. .TP
  98. .B \-E
  99. Turn certain warnings into errors. Only \fBdpkg\-source\fP uses this, but
  100. .BR dpkg\-buildpackage
  101. recognizes it, and passes it thru to
  102. .BR dpkg\-source "."
  103. .TP
  104. .B \-W
  105. Negates a previously set
  106. .BR \-E "."
  107. Only \fBdpkg\-source\fP uses this, but
  108. .BR dpkg\-buildpackage
  109. recognizes it, and passes it thru to
  110. .BR dpkg\-source "."
  111. .TP
  112. .B \-nc
  113. Do not clean the source tree (implies \fB\-b\fP).
  114. .TP
  115. .B \-tc
  116. Clean the source tree (using
  117. .I gain-root-command
  118. .BR "debian/rules clean" )
  119. after the package has been built.
  120. .TP
  121. .BI \-r gain-root-command
  122. When
  123. .B dpkg\-buildpackage
  124. needs to execute part of the build process as root, it prefixes the
  125. command it executes with
  126. .I gain-root-command
  127. if one has been specified. Otherwise, if none has been specified,
  128. \fBfakeroot\fP will be used by default, if the command is present.
  129. .I gain-root-command
  130. should start with the name of a program on the
  131. .B PATH
  132. and will get as arguments the name of the real command to run and the
  133. arguments it should take.
  134. .I gain-root-command
  135. can include parameters (they must be space-separated) but no shell
  136. metacharacters.
  137. .I gain-root-command
  138. might typically be
  139. .BR fakeroot ", " sudo ", " super " or " really .
  140. .B su
  141. is not suitable, since it can only invoke the user's shell with
  142. .B \-c
  143. instead of passing arguments individually to the command to be run.
  144. .TP
  145. .BI \-R rules-file
  146. Building a Debian package usually involves invoking
  147. .B debian/rules
  148. as a command with several standard parameters. With this option it's
  149. possible to use another program invocation to build the package (it can
  150. include space separated parameters).
  151. Alternatively it can be used to execute the standard rules file with
  152. another make program (for example by using
  153. .B /usr/local/bin/make -f debian/rules
  154. as \fIrules-file\fR).
  155. .TP
  156. .BI \-p sign-command
  157. When
  158. .B dpkg\-buildpackage
  159. needs to execute GPG or PGP to sign a source control
  160. .RB ( .dsc )
  161. file or a
  162. .B .changes
  163. file it will run
  164. .I sign-command
  165. (searching the
  166. .B PATH
  167. if necessary) instead of
  168. .BR pgp .
  169. .I sign-command
  170. will get all the arguments that
  171. .B pgp
  172. would have gotten. If
  173. .I sign-command
  174. takes its arguments in GPG rather than PGP style, you should give
  175. the
  176. .B \-sgpg
  177. option.
  178. .I sign-command
  179. should not contain spaces or any other shell metacharacters.
  180. .TP
  181. .BI \-k key-id
  182. Specify a key-ID to use when signing packages.
  183. .TP
  184. .BR \-us
  185. Do not sign the source package.
  186. .TP
  187. .BR \-uc
  188. Do not sign the .changes file.
  189. .TP
  190. .BR \-i [\fIregexp\fP]
  191. Passed unchanged to
  192. .BR dpkg\-source .
  193. .TP
  194. .BI \-I [\fIpattern\fP]
  195. Passed unchanged to
  196. .BR dpkg\-source .
  197. May be repeated multiple times.
  198. .TP
  199. .BR \-s [ nsAkurKUR ]
  200. Passed unchanged to
  201. .BR dpkg\-source .
  202. .TP
  203. .BR \-z ", " \-Z
  204. Passed unchanged to
  205. .BR dpkg\-source .
  206. .TP
  207. .BI \-\-admindir= dir
  208. Change the location of the \fBdpkg\fR database. The default location is
  209. \fI/var/lib/dpkg\fP.
  210. .TP
  211. .BR \-h ", " \-\-help
  212. Show the usage message and exit.
  213. .TP
  214. .BR \-\-version
  215. Show the version and exit.
  216. .
  217. .SH ENVIRONMENT
  218. A set of environment variables for setting compiler and linker options are
  219. set to default values unless already set in the environment. Note that
  220. this mechanism was only introduced in dpkg-dev, version 1.14.17 and
  221. not all \fIrules\fP files and build tools will honour these variables,
  222. yet.
  223. .TP
  224. .B CFLAGS
  225. Optimization options which are passed to the Debian build system and
  226. can/should be overriden by the package build if needed (default value:
  227. .BR "\-g \-O2" ,
  228. or
  229. .BR \-g\ \-O0
  230. if
  231. .BR noopt
  232. is specified in DEB_BUILD_OPTIONS). Overriding options can be
  233. used to explicitely set a
  234. higher optimization level, or work around compiler bugs, which only
  235. can be seen with some optimization levels (the last opt level "wins").
  236. .TP
  237. .B CFLAGS_APPEND
  238. Optimization options appended to the compiler flags, which must not be
  239. overwritten by the package (mostly used to for test builds). Default
  240. value: empty.
  241. .TP
  242. .B CXXFLAGS
  243. Same as
  244. .B CFLAGS
  245. for C++ sources.
  246. .TP
  247. .B CXXFLAGS_APPEND
  248. Same as
  249. .B CFLAGS_APPEND
  250. for C++ sources.
  251. .TP
  252. .B FFLAGS
  253. Same as
  254. .B CFLAGS
  255. for Fortran sources.
  256. .TP
  257. .B FFLAGS_APPEND
  258. Same as
  259. .B CFLAGS_APPEND
  260. for Fortran sources.
  261. .TP
  262. .B CPPFLAGS
  263. Preprocessor flags which are passed to the Debian build system and
  264. can/should be overriden by the package build if needed (default:
  265. empty). This macro is seldom used (most build systems just use
  266. .B CFLAGS
  267. instead of
  268. .BR CPPFLAGS ).
  269. .TP
  270. .B CPPFLAGS_APPEND
  271. Preprocessor flags appended to the preprocessor flags, which must not
  272. be overwritten by the package (mostly used to for test
  273. builds). Default value: empty.
  274. .TP
  275. .B LDFLAGS
  276. Options passed to the compiler when linking executables or shared
  277. objects (if the linker is called directly, then
  278. .B -Wl
  279. and
  280. .B ,
  281. have to be stripped from these options. Default value: empty.
  282. .TP
  283. .B LDFLAGS_APPEND
  284. Optimization options appended to the compiler flags when linking code,
  285. which must not be overwritten by the package (mostly used to for test
  286. builds). Default value: empty.
  287. .
  288. .SH BUGS
  289. It should be possible to specify spaces and shell metacharacters in
  290. and initial arguments for
  291. .IR gain-root-command " and " sign-command .
  292. .
  293. .SH "SEE ALSO"
  294. .BR dpkg\-source (1),
  295. .BR dpkg\-architecture (1),
  296. .BR dpkg\-genchanges (1),
  297. .BR gpg (1),
  298. .BR pgp (1).
  299. .
  300. .SH AUTHORS
  301. Copyright (C) 1995-1996 Ian Jackson
  302. .br
  303. Copyright (C) 2000 Wichert Akkerman
  304. .br
  305. Copyright (C) 2007 Frank Lichtenheld
  306. .sp
  307. This is free software; see the GNU General Public Licence version 2 or later
  308. for copying conditions. There is NO WARRANTY.