dpkg-source.1 27 KB

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