dpkg-source.1 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  1. .\" dpkg manual page - dpkg-source(1)
  2. .\"
  3. .\" Copyright © 1995-1996 Ian Jackson <ian@chiark.chu.cam.ac.uk>
  4. .\" Copyright © 2000 Wichert Akkerman <wakkerma@debian.org>
  5. .\" Copyright © 2006-2007 Frank Lichtenheld <djpig@debian.org>
  6. .\" Copyright © 2006-2013 Guillem Jover <guillem@debian.org>
  7. .\" Copyright © 2008-2011 Raphaël Hertzog <hertzog@debian.org>
  8. .\" Copyright © 2010 Joey Hess <joeyh@debian.org>
  9. .\"
  10. .\" This is free software; you can redistribute it and/or modify
  11. .\" it under the terms of the GNU General Public License as published by
  12. .\" the Free Software Foundation; either version 2 of the License, or
  13. .\" (at your option) any later version.
  14. .\"
  15. .\" This is distributed in the hope that it will be useful,
  16. .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. .\" GNU General Public License for more details.
  19. .\"
  20. .\" You should have received a copy of the GNU General Public License
  21. .\" along with this program. If not, see <https://www.gnu.org/licenses/>.
  22. .
  23. .TH dpkg\-source 1 "2013-12-05" "Debian Project" "dpkg utilities"
  24. .SH NAME
  25. dpkg\-source \- Debian source package (.dsc) manipulation tool
  26. .
  27. .SH SYNOPSIS
  28. .B dpkg\-source
  29. .RI [ option "...] " command
  30. .
  31. .SH DESCRIPTION
  32. .B dpkg\-source
  33. packs and unpacks Debian source archives.
  34. None of these commands allow multiple options to be combined into one,
  35. and they do not allow the value for an option to be specified in a
  36. separate argument.
  37. .
  38. .SH COMMANDS
  39. .TP
  40. .BI "\-x " filename ".dsc " \fR[\fPoutput-directory\fR]\fP
  41. Extract a source package. One non-option argument must be supplied,
  42. the name of the Debian source control file
  43. .RB ( .dsc ).
  44. An optional second non-option argument may be supplied to specify the
  45. directory to extract the source package to, this must not exist. If
  46. no output directory is specified, the source package is extracted into
  47. a directory named \fIsource\fR-\fIversion\fR under the current working
  48. directory.
  49. .B dpkg\-source
  50. will read the names of the other file(s) making up the source package
  51. from the control file; they are assumed to be in the same directory as
  52. the
  53. .BR .dsc .
  54. The files in the extracted package will have their permissions and
  55. ownerships set to those which would have been expected if the files
  56. and directories had simply been created - directories and executable
  57. files will be 0777 and plain files will be 0666, both modified by the
  58. extractors' umask; if the parent directory is setgid then the
  59. extracted directories will be too, and all the files and directories
  60. will inherit its group ownership.
  61. If the source package uses a non-standard format (currently this means all
  62. formats except "1.0"), its name will be stored in
  63. \fBdebian/source/format\fP so that the following builds of the source
  64. package use the same format by default.
  65. .TP
  66. .RI "\fB\-b\fP " directory " [" format-specific-parameters ]
  67. Build a source package. The first non-option argument is taken as the
  68. name of the directory containing the debianized source tree (i.e. with a
  69. debian sub-directory and maybe changes to the original files).
  70. Depending on the source package format used to build the package,
  71. additional parameters might be accepted.
  72. \fBdpkg\-source\fP will build the source package with the first format
  73. found in this ordered list:
  74. the format indicated with the \fI\-\-format\fP command line option,
  75. the format indicated in \fBdebian/source/format\fP,
  76. "1.0". The fallback to "1.0" is deprecated and will be removed at some
  77. point in the future, you should always document the desired source format
  78. in \fBdebian/source/format\fP. See section \fBSOURCE PACKAGE FORMATS\fP
  79. for an extensive description of the various source package formats.
  80. .TP
  81. .RI "\fB\-\-print\-format\fP " directory
  82. Print the source format that would be used to build the source package if
  83. \fBdpkg\-source \-b \fIdirectory\fR was called (in the same conditions and
  84. with the same parameters).
  85. .TP
  86. .RI "\fB\-\-before\-build\fP " directory
  87. Run the corresponding hook of the source package format. This hook is
  88. called before any build of the package (\fBdpkg\-buildpackage\fP calls it
  89. very early even before \fBdebian/rules clean\fP). This command is
  90. idempotent and can be called multiple times. Not all source formats
  91. implement something in this hook, and those that do usually prepare the
  92. source tree for the build for example by ensuring that the Debian patches
  93. are applied.
  94. .TP
  95. .RI "\fB\-\-after\-build\fP " directory
  96. Run the corresponding hook of the source package format. This hook is
  97. called after any build of the package (\fBdpkg\-buildpackage\fP calls it
  98. last). This command is idempotent and can be called multiple times. Not
  99. all source formats implement something in this hook, and those that do
  100. usually use it to undo what \fB\-\-before\-build\fP has done.
  101. .TP
  102. .RI "\fB\-\-commit\fP [" directory "] ..."
  103. Record changes in the source tree unpacked in \fIdirectory\fP. This
  104. command can take supplementary parameters depending on the source format.
  105. It will error out for formats where this operation doesn't mean anything.
  106. .TP
  107. .BR \-? ", " \-\-help
  108. Show the usage message and exit.
  109. .TP
  110. .BR \-\-version
  111. Show the version and exit.
  112. .
  113. .SH OPTIONS
  114. .SS Generic build options
  115. .TP
  116. .BI \-c control-file
  117. Specifies the main source control file to read information from. The
  118. default is
  119. .BR debian/control .
  120. If given with relative pathname this is interpreted starting at
  121. the source tree's top level directory.
  122. .TP
  123. .BI \-l changelog-file
  124. Specifies the changelog file to read information from. The
  125. default is
  126. .BR debian/changelog .
  127. If given with relative pathname this is interpreted starting at
  128. the source tree's top level directory.
  129. .TP
  130. .BI \-F changelog-format
  131. Specifies the format of the changelog. See \fBdpkg\-parsechangelog\fP(1)
  132. for information about alternative formats.
  133. .TP
  134. .BI \-\-format= value
  135. Use the given format for building the source package. It does
  136. override any format given in \fBdebian/source/format\fP.
  137. .TP
  138. .BI \-V name = value
  139. Set an output substitution variable.
  140. See \fBdeb\-substvars\fP(5) for a discussion of output substitution.
  141. .TP
  142. .BI \-T substvars-file
  143. Read substitution variables in
  144. .IR substvars-file ;
  145. the default is to not read any file. This option can be used multiple
  146. times to read substitution variables from multiple files.
  147. .TP
  148. .BI \-D field = value
  149. Override or add an output control file field.
  150. .TP
  151. .BI \-U field
  152. Remove an output control file field.
  153. .TP
  154. .BR \-Z "\fIcompression\fP, " \-\-compression =\fIcompression\fP
  155. Specify the compression to use for created files (tarballs and diffs).
  156. Note that this option will not cause existing tarballs to be recompressed,
  157. it only affects new files. Supported values are:
  158. .IR gzip ", " bzip2 ", " lzma " and " xz .
  159. The default is \fIxz\fP for formats 2.0 and newer, and \fIgzip\fP for
  160. format 1.0. \fIxz\fP is only supported since dpkg 1.15.5.
  161. .TP
  162. .BR \-z "\fIlevel\fP, " \-\-compression\-level =\fIlevel\fP
  163. Compression level to use. As with \fB\-Z\fP it only affects newly created
  164. files. Supported values are:
  165. .IR 1 " to " 9 ", " best ", and " fast .
  166. The default is \fI9\fP for gzip and bzip2, \fI6\fP for xz and lzma.
  167. .TP
  168. .BR \-i "[\fIregex\fP], " \-\-diff\-ignore [=\fIregex\fP]
  169. You may specify a perl regular expression to match files you want
  170. filtered out of the list of files for the diff. (This list is
  171. generated by a find command.) (If the source package is being built as a
  172. version 3 source package using a VCS, this can be used to ignore
  173. uncommited changes on specific files. Using \-i.* will ignore all of them.)
  174. The \fB\-i\fP option by itself enables this setting with a default regex
  175. (preserving any modification to the default regex done by a previous use
  176. of \fB\-\-extend\-diff\-ignore\fP) that will filter out control files and
  177. directories of the most common revision control systems, backup and swap
  178. files and Libtool build output directories. There can only be one active
  179. regex, of multiple \fB\-i\fP options only the last one will take effect.
  180. This is very helpful in cutting out extraneous files that get included
  181. in the diff, e.g. if you maintain your source in a revision control
  182. system and want to use a checkout to build a source package without
  183. including the additional files and directories that it will usually
  184. contain (e.g. CVS/, .cvsignore, .svn/). The default regex is already
  185. very exhaustive, but if you need to replace it, please note that by
  186. default it can match any part of a path, so if you want to match the
  187. begin of a filename or only full filenames, you will need to provide
  188. the necessary anchors (e.g. '(^|/)', '($|/)') yourself.
  189. .TP
  190. .BR \-\-extend\-diff\-ignore =\fIregex\fP
  191. The perl regular expression specified will extend the default value
  192. used by \fB\-\-diff\-ignore\fP and its current value (if set). It does
  193. this by concatenating "\fB|\fP\fIregex\fP" to the existing value.
  194. This option is convenient to use in \fBdebian/source/options\fP to exclude
  195. some auto-generated files from the automatic patch generation.
  196. .TP
  197. .BR \-I "[\fIfile-pattern\fP], " \-\-tar\-ignore [=\fIfile-pattern\fP]
  198. If this option is specified, the pattern will be passed to
  199. .BR tar (1)'s
  200. .B \-\-exclude
  201. option when it is called to generate a .orig.tar or .tar file. For
  202. example, \fB\-I\fPCVS will make tar skip over CVS directories when generating
  203. a .tar.gz file. The option may be repeated multiple times to list multiple
  204. patterns to exclude.
  205. \fB\-I\fP by itself adds default \fB\-\-exclude\fP options that will
  206. filter out control files and directories of the most common revision
  207. control systems, backup and swap files and Libtool build output
  208. directories.
  209. .PP
  210. .B Note:
  211. While they have similar purposes, \fB\-i\fP and \fB\-I\fP have very
  212. different syntax and semantics. \fB\-i\fP can only be specified once and
  213. takes a perl compatible regular expression which is matched against
  214. the full relative path of each file. \fB\-I\fP can specified
  215. multiple times and takes a filename pattern with shell wildcards.
  216. The pattern is applied to the full relative path but also
  217. to each part of the path individually. The exact semantic of tar's
  218. \fB\-\-exclude\fP option is somewhat complicated, see
  219. https://www.gnu.org/software/tar/manual/tar.html#wildcards for a full
  220. documentation.
  221. The default regex and patterns for both options can be seen
  222. in the output of the \fB\-\-help\fP command.
  223. .SS Generic extract options
  224. .TP
  225. .BI \-\-no\-copy
  226. Do not copy original tarballs near the extracted source package.
  227. .TP
  228. .BI \-\-no\-check
  229. Do not check signatures and checksums before unpacking.
  230. .TP
  231. .BI \-\-require\-valid\-signature
  232. Refuse to unpack the source package if it doesn't contain an OpenPGP
  233. signature that can be verified either with the user's
  234. \fItrustedkeys.gpg\fP keyring, one of the vendor-specific keyrings, or one
  235. of the official Debian keyrings
  236. (\fI/usr/share/keyrings/debian\-keyring.gpg\fP
  237. and \fI/usr/share/keyrings/debian\-maintainers.gpg\fP).
  238. .SH SOURCE PACKAGE FORMATS
  239. If you don't know what source format to use, you should probably pick
  240. either "3.0 (quilt)" or "3.0 (native)". See
  241. https://wiki.debian.org/Projects/DebSrc3.0 for information on the
  242. deployment of those formats within Debian.
  243. .SS Format: 1.0
  244. A source package in this format consists either of a \fB.orig.tar.gz\fP
  245. associated to a \fB.diff.gz\fP or a single \fB.tar.gz\fP (in that case
  246. the package is said to be \fInative\fP).
  247. .B Extracting
  248. Extracting a native package is a simple extraction of the single
  249. tarball in the target directory. Extracting a non-native package
  250. is done by first unpacking the \fB.orig.tar.gz\fP and then applying
  251. the patch contained in the \fB.diff.gz\fP file. The timestamp of
  252. all patched files is reset to the extraction time of the source
  253. package (this avoids timestamp skews leading to problems when
  254. autogenerated files are patched). The diff can create new files (the whole
  255. debian directory is created that way) but can't remove files (empty files
  256. will be left over).
  257. .B Building
  258. Building a native package is just creating a single tarball with
  259. the source directory. Building a non-native package involves
  260. extracting the original tarball in a separate ".orig" directory and
  261. regenerating the \fB.diff.gz\fP by comparing the source package
  262. \fIdirectory\fP with the .orig directory.
  263. .B Build options (with \-b):
  264. If a second non-option argument is supplied it should be the name of the
  265. original source directory or tarfile or the empty string if the package is
  266. a Debian-specific one and so has no Debianisation diffs. If no second
  267. argument is supplied then
  268. .B dpkg\-source
  269. will look for the original source tarfile
  270. .IB package _ upstream-version .orig.tar.gz
  271. or the original source directory
  272. .IB directory .orig
  273. depending on the \fB\-sX\fP arguments.
  274. .BR \-sa ", " \-sp ", " \-sk ", " \-su " and " \-sr
  275. will not overwrite existing tarfiles or directories. If this is
  276. desired then
  277. .BR \-sA ", " \-sP ", " \-sK ", " \-sU " and " \-sR
  278. should be used instead.
  279. .PP
  280. .TP
  281. .BR \-sk
  282. Specifies to expect the original source as a tarfile, by default
  283. .IB package _ upstream-version .orig.tar. extension \fR.
  284. It will leave this original source in place as a tarfile, or copy it
  285. to the current directory if it isn't already there. The
  286. tarball will be unpacked into
  287. .IB directory .orig
  288. for the generation of the diff.
  289. .TP
  290. .B \-sp
  291. Like
  292. .B \-sk
  293. but will remove the directory again afterwards.
  294. .TP
  295. .B \-su
  296. Specifies that the original source is expected as a directory, by
  297. default
  298. .IB package - upstream-version .orig
  299. and
  300. .B dpkg\-source
  301. will create a new original source archive from it.
  302. .TP
  303. .B \-sr
  304. Like
  305. .B \-su
  306. but will remove that directory after it has been used.
  307. .TP
  308. .B \-ss
  309. Specifies that the original source is available both as a directory
  310. and as a tarfile. \fBdpkg\-source\fP will use the directory to create
  311. the diff, but the tarfile to create the
  312. .BR .dsc .
  313. This option must be used with care - if the directory and tarfile do
  314. not match a bad source archive will be generated.
  315. .TP
  316. .B \-sn
  317. Specifies to not look for any original source, and to not generate a diff.
  318. The second argument, if supplied, must be the empty string. This is
  319. used for Debian-specific packages which do not have a separate
  320. upstream source and therefore have no debianisation diffs.
  321. .TP
  322. .BR \-sa " or " \-sA
  323. Specifies to look for the original source archive as a tarfile or as a
  324. directory - the second argument, if any, may be either, or the empty
  325. string (this is equivalent to using
  326. .BR \-sn ).
  327. If a tarfile is found it will unpack it to create the diff and remove
  328. it afterwards (this is equivalent to
  329. .BR \-sp );
  330. if a directory is found it will pack it to create the original source
  331. and remove it afterwards (this is equivalent to
  332. .BR \-sr );
  333. if neither is found it will assume that the package has no
  334. debianisation diffs, only a straightforward source archive (this is
  335. equivalent to
  336. .BR \-sn ).
  337. If both are found then \fBdpkg\-source\fP will ignore the directory,
  338. overwriting it, if
  339. .B \-sA
  340. was specified (this is equivalent to
  341. .BR \-sP )
  342. or raise an error if
  343. .B \-sa
  344. was specified.
  345. .B \-sA
  346. is the default.
  347. .TP
  348. .B \-\-abort\-on\-upstream\-changes
  349. The process fails if the generated diff contains changes to files
  350. outside of the debian sub-directory. This option is not allowed in
  351. \fBdebian/source/options\fP but can be used in
  352. \fBdebian/source/local\-options\fP.
  353. .PP
  354. .B Extract options (with \-x):
  355. In all cases any existing original source tree will be removed.
  356. .TP
  357. .B \-sp
  358. Used when extracting then the original source (if any) will be left
  359. as a tarfile. If it is not already located in the current directory
  360. or if an existing but different file is there it will be copied there.
  361. (\fBThis is the default\fP).
  362. .TP
  363. .B \-su
  364. Unpacks the original source tree.
  365. .TP
  366. .B \-sn
  367. Ensures that the original source is neither copied to the current
  368. directory nor unpacked. Any original source tree that was in the
  369. current directory is still removed.
  370. .PP
  371. All the
  372. .BI \-s X
  373. options are mutually exclusive. If you specify more than one only the
  374. last one will be used.
  375. .TP
  376. .B \-\-skip\-debianization
  377. Skips application of the debian diff on top of the upstream sources.
  378. .
  379. .SS Format: 2.0
  380. Also known as wig&pen. This format is not recommended for wide-spread
  381. usage, the format "3.0 (quilt)" replaces it. Wig&pen was the first
  382. specification of a new-generation source package format.
  383. The behaviour of this format is the same as the "3.0 (quilt)" format
  384. except that it doesn't use an explicit list of patches. All files in
  385. \fBdebian/patches/\fP matching the perl regular expression \fB[\\w\-]+\fP
  386. must be valid patches: they are applied at extraction time.
  387. When building a new source package, any change to the upstream source
  388. is stored in a patch named \fBzz_debian\-diff\-auto\fP.
  389. .
  390. .SS Format: 3.0 (native)
  391. This format is an extension of the native package format as defined
  392. in the 1.0 format. It supports all compression methods and
  393. will ignore by default any VCS specific files and directories
  394. as well as many temporary files (see default value associated to
  395. \fB\-I\fP option in the \fB\-\-help\fP output).
  396. .
  397. .SS Format: 3.0 (quilt)
  398. A source package in this format contains at least
  399. an original tarball (\fB.orig.tar.\fP\fIext\fP where \fIext\fP can be
  400. \fBgz\fP, \fBbz2\fP, \fBlzma\fP and \fBxz\fP) and a debian tarball
  401. (\fB.debian.tar.\fP\fIext\fP). It can also contain additional original
  402. tarballs (\fB.orig\-\fP\fIcomponent\fP\fB.tar.\fP\fIext\fP).
  403. \fIcomponent\fP can only contain alphanumeric characters and hyphens ("\-").
  404. .PP
  405. .B Extracting
  406. .PP
  407. The main original tarball is extracted first, then all additional original
  408. tarballs are extracted in subdirectories named after the \fIcomponent\fP
  409. part of their filename (any pre-existing directory is replaced). The
  410. debian tarball is extracted on top of the source directory after prior
  411. removal of any pre-existing \fBdebian\fP directory. Note that the
  412. debian tarball must contain a \fBdebian\fP sub-directory but it
  413. can also contain binary files outside of that directory (see
  414. \fB\-\-include\-binaries\fP option).
  415. .PP
  416. All patches listed in \fBdebian/patches/debian.series\fP or
  417. \fBdebian/patches/series\fP are then applied.
  418. If the former file is used and the latter one doesn't exist (or is a
  419. symlink), then the latter is replaced with a symlink to the former. This
  420. is meant to simplify usage of \fBquilt\fP to manage the set of patches. Note
  421. however that while \fBdpkg\-source\fP parses correctly series files with
  422. explicit options used for patch application (stored on each line
  423. after the patch filename and one or more spaces), it does ignore those
  424. options and always expect patches that can be applied with the \fB\-p1\fP
  425. option of \fBpatch\fP. It will thus emit a warning when it encounters
  426. such options, and the build is likely to fail.
  427. .PP
  428. Contrary to \fBquilt\fP's default behaviour, patches are expected to apply
  429. without any fuzz. When that is not the case, you should refresh such
  430. patches with \fBquilt\fP, or \fBdpkg\-source\fP will error out while
  431. trying to apply them.
  432. .PP
  433. Similarly to \fBquilt\fP's default behaviour, the patches can remove
  434. files too.
  435. .PP
  436. The file \fB.pc/applied\-patches\fP is created if some
  437. patches have been applied during the extraction.
  438. .PP
  439. .B Building
  440. .PP
  441. All original tarballs found in the current directory are extracted in a
  442. temporary directory by following the same logic as for the unpack, the
  443. debian directory is copied over in the temporary directory, and all
  444. patches except the automatic patch (\fBdebian\-changes\-\fP\fIversion\fP
  445. or \fBdebian\-changes\fP, depending on \fB\-\-single\-debian\-patch\fP) are
  446. applied. The temporary directory is compared to the source package
  447. directory. When the diff is non-empty, the build fails unless
  448. \fB\-\-single\-debian\-patch\fP or \fB\-\-auto\-commit\fP
  449. has been used, in which case the diff is stored in the automatic patch.
  450. If the automatic patch is created/deleted, it's added/removed from the
  451. series file and from the \fBquilt\fP metadata.
  452. Any change
  453. on a binary file is not representable in a diff and will thus lead to a
  454. failure unless the maintainer deliberately decided to include that
  455. modified binary file in the debian tarball (by listing it in
  456. \fBdebian/source/include\-binaries\fP). The build will also fail if it
  457. finds binary files in the debian sub-directory unless they have been
  458. whitelisted through \fBdebian/source/include\-binaries\fP.
  459. The updated debian directory and the list of modified binaries is then
  460. used to generate the debian tarball.
  461. The automatically generated diff doesn't include changes on VCS specific
  462. files as well as many temporary files (see default value associated to
  463. \fB\-i\fP option in the \fB\-\-help\fP output). In particular, the
  464. \fB.pc\fP directory used by \fBquilt\fP is ignored during generation of the
  465. automatic patch.
  466. Note: \fBdpkg\-source\fP \fB\-\-before\-build\fP (and \fB\-b\fP) will
  467. ensure that all patches listed in the series file are applied so that a
  468. package build always has all patches applied. It does this by finding
  469. unapplied patches (they are listed in the \fBseries\fP file but not in
  470. \fB.pc/applied\-patches\fP), and if the first patch in that set can be
  471. applied without errors, it will apply them all. The option
  472. \fB\-\-no\-preparation\fP can be used to disable this
  473. behavior.
  474. .PP
  475. .B Recording changes
  476. .TP
  477. .RI "\fB\-\-commit\fP [" directory "] [" patch-name "] [" patch-file ]
  478. Generates a patch corresponding to the local changes that are not managed
  479. by the \fBquilt\fP patch system and integrates it in the patch system under
  480. the name \fIpatch-name\fP. If the name is missing, it will be asked
  481. interactively. If \fIpatch-file\fP is given, it is used as the patch
  482. corresponding to the local changes to integrate. Once integrated, an
  483. editor is launched so that you can edit the meta-information in the patch
  484. header.
  485. Passing \fIpatch-file\fP is mainly useful after a build failure that
  486. pre-generated this file, and on this ground the given file is removed
  487. after integration. Note also that the changes contained in the patch file
  488. must already be applied on the tree and that the files modified by the
  489. patch must not have supplementary unrecorded changes.
  490. If the patch generation detects modified binary files, they will be
  491. automatically added to \fBdebian/source/include\-binaries\fP so that
  492. they end up in the debian tarball (exactly like \fBdpkg-source
  493. \-\-include\-binaries \-b\fP would do).
  494. .PP
  495. .B Build options
  496. .TP
  497. .BI \-\-allow\-version\-of\-quilt\-db= version
  498. Allow \fBdpkg\-source\fP to build the source package if the version of
  499. the \fBquilt\fP metadata is the one specified, even if \fBdpkg\-source\fP
  500. doesn't know about it. Effectively this says that the given version of the
  501. \fBquilt\fP metadata is compatible with the version 2 that \fBdpkg\-source\fP
  502. currently supports. The version of the \fBquilt\fP metadata is stored in
  503. \fB.pc/.version\fP.
  504. .TP
  505. .B \-\-include\-removal
  506. Do not ignore removed files and include them in the automatically
  507. generated patch.
  508. .TP
  509. .B \-\-include\-timestamp
  510. Include timestamp in the automatically generated patch.
  511. .TP
  512. .B \-\-include\-binaries
  513. Add all modified binaries in the debian tarball. Also add them to
  514. \fBdebian/source/include\-binaries\fP: they will be added by default
  515. in subsequent builds and this option is thus no more needed.
  516. .TP
  517. .B \-\-no\-preparation
  518. Do not try to prepare the build tree by applying patches which are
  519. apparently unapplied.
  520. .TP
  521. .B \-\-single\-debian\-patch
  522. Use \fBdebian/patches/debian\-changes\fP instead of
  523. \fBdebian/patches/debian\-changes\-\fP\fIversion\fP for the name of the
  524. automatic patch generated during build. This option is particularly
  525. useful when the package is maintained in a VCS and a patch set can't reliably
  526. be generated. Instead the current diff with upstream should be stored in a
  527. single patch. The option would be put in \fBdebian/source/local\-options\fP
  528. and would be accompanied by a \fBdebian/source/local\-patch\-header\fP file
  529. explaining how the Debian changes can be best reviewed, for example in the
  530. VCS that is used.
  531. .TP
  532. .B \-\-create\-empty\-orig
  533. Automatically create the main original tarball as empty if it's missing
  534. and if there are supplementary original tarballs. This option is meant to
  535. be used when the source package is just a bundle of multiple upstream
  536. software and where there's no "main" software.
  537. .TP
  538. .B \-\-no\-unapply\-patches, \-\-unapply\-patches
  539. By default, \fBdpkg\-source\fP will automatically unapply the patches in the
  540. \fB\-\-after\-build\fP hook if it did apply them during
  541. \fB\-\-before\-build\fP. Those options allow you to forcefully disable
  542. or enable the patch unapplication process. Those options are only allowed
  543. in \fBdebian/source/local\-options\fP so that all generated source
  544. packages have the same behavior by default.
  545. .TP
  546. .B \-\-abort\-on\-upstream\-changes
  547. The process fails if an automatic patch has been generated. This option
  548. can be used to ensure that all changes were properly recorded in separate
  549. \fBquilt\fP patches prior to the source package build. This option is not
  550. allowed in \fBdebian/source/options\fP but can be used in
  551. \fBdebian/source/local\-options\fP.
  552. .TP
  553. .B \-\-auto\-commit
  554. The process doesn't fail if an automatic patch has been generated, instead
  555. it's immediately recorded in the \fBquilt\fP series.
  556. .PP
  557. .B Extract options
  558. .TP
  559. .B \-\-skip\-debianization
  560. Skips extraction of the debian tarball on top of the upstream sources.
  561. .TP
  562. .B \-\-skip\-patches
  563. Do not apply patches at the end of the extraction.
  564. .
  565. .SS Format: 3.0 (custom)
  566. This format is special. It doesn't represent a real source package
  567. format but can be used to create source packages with arbitrary files.
  568. .PP
  569. .B Build options
  570. .PP
  571. All non-option arguments are taken as files to integrate in the
  572. generated source package. They must exist and are preferably
  573. in the current directory. At least one file must be given.
  574. .TP
  575. .BI \-\-target\-format= value
  576. \fBRequired\fP. Defines the real format of the generated source package.
  577. The generated .dsc file will contain this value in its \fBFormat\fP field
  578. and not "3.0 (custom)".
  579. .
  580. .SS Format: 3.0 (git)
  581. This format is experimental.
  582. .PP
  583. A source package in this format consists of a
  584. single bundle of a git repository \fB.git\fP to hold the source of a package.
  585. There may also be a \fB.gitshallow\fP file listing revisions for a shallow
  586. git clone.
  587. .PP
  588. .B Extracting
  589. .PP
  590. The bundle is cloned as a git repository to the target directory.
  591. If there is a gitshallow file, it is installed as `.git/shallow` inside
  592. the cloned git repository.
  593. .PP
  594. Note that by default the new repository will have the same branch checked
  595. out that was checked out in the original source. (Typically "master", but
  596. it could be anything.) Any other branches will be available under
  597. `remotes/origin/`.
  598. .PP
  599. .B Building
  600. .PP
  601. Before going any further, some checks are done to ensure that we
  602. don't have any non-ignored uncommitted changes.
  603. .PP
  604. \fBgit\-bundle\fP(1) is used to generate a bundle of the git repository.
  605. By default, all branches and tags in the repository are included in the
  606. bundle.
  607. .PP
  608. .B Build options
  609. .TP
  610. .BI \-\-git\-ref= ref
  611. Allows specifying a git ref to include in the git bundle. Use disables
  612. the default behavior of including all branches and tags. May be specified
  613. multiple times. The \fIref\fP can be the name of a branch or tag to
  614. include. It may also be any parameter that can be passed to
  615. \fBgit\-rev\-list\fP(1). For example, to include only
  616. the master branch, use \fB\-\-git\-ref=\fPmaster. To include all tags and
  617. branches, except for the private branch, use \fB\-\-git\-ref=\fP\-\-all
  618. \fB\-\-git\-ref=\fP^private
  619. .TP
  620. .BI \-\-git\-depth= number
  621. Creates a shallow clone with a history truncated to the specified number of
  622. revisions.
  623. .SS Format: 3.0 (bzr)
  624. This format is experimental. It generates a single tarball
  625. containing the bzr repository.
  626. .PP
  627. .B Extracting
  628. .PP
  629. The tarball is unpacked and then bzr is used to checkout the current
  630. branch.
  631. .PP
  632. .B Building
  633. .PP
  634. Before going any further, some checks are done to ensure that we
  635. don't have any non-ignored uncommitted changes.
  636. .PP
  637. Then the VCS specific part of the source directory is copied over to a
  638. temporary directory. Before this temporary directory is packed in a tarball,
  639. various cleanup are done to save space.
  640. .SH DIAGNOSTICS
  641. .SS no source format specified in debian/source/format
  642. The file \fBdebian/source/format\fP should always exist and indicate the
  643. desired source format. For backwards compatibility, format "1.0" is
  644. assumed when the file doesn't exist but you should not rely on this:
  645. at some point in the future \fBdpkg\-source\fP will be modified to fail
  646. when that file doesn't exist.
  647. The rationale is that format "1.0" is no longer the recommended format,
  648. you should usually pick one of the newer formats ("3.0 (quilt)", "3.0
  649. (native)") but \fBdpkg\-source\fP will not do this automatically for you.
  650. If you want to continue using the old format, you should be explicit about
  651. it and put "1.0" in \fBdebian/source/format\fP.
  652. .SS the diff modifies the following upstream files
  653. When using source format "1.0" it is usually a bad idea to modify
  654. upstream files directly as the changes end up hidden and mostly
  655. undocumented in the .diff.gz file. Instead you should store your changes
  656. as patches in the debian directory and apply them at build-time. To avoid
  657. this complexity you can also use the format "3.0 (quilt)" that offers this
  658. natively.
  659. .SS cannot represent change to \fIfile\fP
  660. Changes to upstream sources are usually stored with patch files, but not
  661. all changes can be represented with patches: they can only alter the
  662. content of plain text files. If you try replacing a file with something of
  663. a different type (for example replacing a plain file with a symlink or a
  664. directory), you will get this error message.
  665. .SS newly created empty file \fIfile\fB will not be represented in diff
  666. Empty files can't be created with patch files. Thus this change is not
  667. recorded in the source package and you are warned about it.
  668. .SS executable mode \fIperms\fB of \fIfile\fB will not be represented in diff
  669. Patch files do not record permissions of files and thus executable
  670. permissions are not stored in the source package. This warning reminds you
  671. of that fact.
  672. .SS special mode \fIperms\fB of \fIfile\fB will not be represented in diff
  673. Patch files do not record permissions of files and thus modified
  674. permissions are not stored in the source package. This warning reminds you
  675. of that fact.
  676. .SH FILE FORMATS
  677. .SS debian/source/format
  678. This file contains on a single line the format that should be used to
  679. build the source package (possible formats are described above). No leading
  680. or trailing spaces are allowed.
  681. .SS debian/source/include\-binaries
  682. This file contains a list of binary files (one per line) that should be
  683. included in the debian tarball. Leading and trailing spaces are stripped.
  684. Lines starting with "#" are comments and are skipped. Empty lines are ignored.
  685. .SS debian/source/options
  686. This file contains a list of long options that should be automatically
  687. prepended to the set of command line options of a \fBdpkg\-source \-b\fR
  688. or \fBdpkg\-source \-\-print\-format\fR call. Options like
  689. \fB\-\-compression\fR and \fB\-\-compression\-level\fR are well suited for
  690. this file.
  691. .P
  692. Each option should be put on a separate line. Empty lines and lines
  693. starting with "#" are ignored. The leading "\-\-" should be
  694. stripped and short options are not allowed. Optional spaces are allowed
  695. around the "=" symbol and optional quotes are allowed around the value.
  696. Here's an example of such a file:
  697. .P
  698. # let dpkg\-source create a debian.tar.bz2 with maximal compression
  699. compression = "bzip2"
  700. compression\-level = 9
  701. # use debian/patches/debian\-changes as automatic patch
  702. single\-debian\-patch
  703. # ignore changes on config.{sub,guess}
  704. extend-diff-ignore = "(^|/)(config\.sub|config\.guess)$"
  705. .P
  706. Note: \fBformat\fR options are not accepted in this file, you should
  707. use \fBdebian/source/format\fR instead.
  708. .SS debian/source/local\-options
  709. Exactly like \fBdebian/source/options\fP except that the file is not
  710. included in the generated source package. It can be useful to store
  711. a preference tied to the maintainer or to the VCS repository where
  712. the source package is maintained.
  713. .SS debian/source/local\-patch\-header and debian/source/patch\-header
  714. Free form text that is put on top of the automatic patch generated
  715. in formats "2.0" or "3.0 (quilt)". \fBlocal\-patch\-header\fP is not
  716. included in the generated source package while \fBpatch\-header\fP is.
  717. .SS debian/patches/series
  718. This file lists all patches that have to be applied (in the given order)
  719. on top of the upstream source package. Leading and trailing spaces are
  720. stripped. Lines starting with "#" are comments and are skipped. Empty
  721. lines are ignored. Remaining lines start with a patch filename (relative
  722. to the \fBdebian/patches/\fP directory) up to the first space character or
  723. the end of line. Optional \fBquilt\fP options can follow up to the end of line
  724. or the first "#" preceded by one or more spaces (which marks the start of
  725. a comment up to the end of line).
  726. .SH BUGS
  727. The point at which field overriding occurs compared to certain
  728. standard output field settings is rather confused.
  729. .SH SEE ALSO
  730. .BR dpkg\-deb (1),
  731. .BR dpkg (1),
  732. .BR dselect (1).