dpkg-source.1 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. .\" Authors: Ian Jackson
  2. .TH dpkg\-source 1 "2007-09-24" "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. .TP
  42. .RI "\fB\-b\fP " directory " [" orig-directory | orig-targz |'']
  43. Build a source package. One or two non-option arguments should
  44. be supplied. The first is taken as the name of the directory
  45. containing the unpacked source tree. If a second argument is supplied
  46. it should be the name of the original source directory or tarfile or
  47. the empty string if the package is a Debian-specific one and so has no
  48. Debianisation diffs. If no second argument is supplied then
  49. .B dpkg\-source
  50. will look for the original source tarfile
  51. .IB package _ upstream-version .orig.tar. extension
  52. (where \fIextension\fP is one of
  53. .BR gz ", " bz2 ", and " lzma )
  54. or the original source directory
  55. .IB directory .orig
  56. depending on the \fB\-sX\fP arguments.
  57. If the source package is being built as a version 3 source package using
  58. a VCS, no upstream tarball or original source directory is needed.
  59. .TP
  60. .BR \-h ", " \-\-help
  61. Show the usage message and exit.
  62. .TP
  63. .BR \-\-version
  64. Show the version and exit.
  65. .
  66. .SH OPTIONS
  67. .TP
  68. .BI \-c controlfile
  69. Specifies the main source control file to read information from. The
  70. default is
  71. .BR debian/control .
  72. If given with relative pathname this is interpreted starting at
  73. the source tree's top level directory.
  74. .TP
  75. .BI \-l changelogfile
  76. Specifies the change log file to read information from. The
  77. default is
  78. .BR debian/changelog .
  79. If given with relative pathname this is interpreted starting at
  80. the source tree's top level directory.
  81. .TP
  82. .BI \-F changelogformat
  83. Specifies the format of the changelog. By default the format is read
  84. from a special line near the bottom of the changelog or failing that
  85. defaults to the debian standard format.
  86. .TP
  87. .BI \-V name = value
  88. Set an output substitution variable.
  89. See \fBdeb\-substvars\fP(5) for a discussion of output substitution.
  90. .TP
  91. .BI \-T substvarsfile
  92. Read substitution variables in
  93. .IR substvarsfile ;
  94. the default is
  95. .BR debian/substvars .
  96. .TP
  97. .BI \-D field = value
  98. Override or add an output control file field.
  99. .TP
  100. .BI \-U field
  101. Remove an output control file field.
  102. .TP
  103. .BI \-E
  104. This option turns certain warnings into errors.
  105. .TP
  106. .BI \-W
  107. This option negates a previously set
  108. .BR \-E "."
  109. .TP
  110. .BR \-Z \fIcompression\fP
  111. Specify the compression to use for created files (tarballs and diffs).
  112. Note that this option will not cause existing tarballs to be recompressed,
  113. it only affects new files. Supported values are:
  114. .IR gzip ", " bzip2 ", and " lzma .
  115. \fIgzip\fP is the default.
  116. .TP
  117. .BR \-z \fIlevel\fP
  118. Compression level to use. As with \fB\-Z\fP it only affects newly created
  119. files. Supported values are:
  120. .IR 1 " to " 9 ", " best ", and " fast .
  121. \fI9\fP is the default.
  122. .TP
  123. .BR \-i [\fIregexp\fP]
  124. You may specify a perl regular expression to match files you want
  125. filtered out of the list of files for the diff. (This list is
  126. generated by a find command.) (If the source package is being built as a
  127. version 3 source package using a VCS, this is instead used to
  128. ignore uncommitted files.) \fB\-i\fP by itself enables the option,
  129. with a default that will filter out control files and directories of the
  130. most common revision control systems, backup and swap files and Libtool
  131. build output directories. There can only be one active regexp, of multiple
  132. \fB\-i\fP options only the last one will take effect.
  133. This is very helpful in cutting out extraneous files that get included
  134. in the diff, e.g. if you maintain your source in a revision control
  135. system and want to use a checkout to build a source package without
  136. including the additional files and directories that it will usually
  137. contain (e.g. CVS/, .cvsignore, .svn/). The default regexp is already
  138. very exhaustive, but if you need to replace it, please note that by
  139. default it can match any part of a path, so if you want to match the
  140. begin of a filename or only full filenames, you will need to provide
  141. the neccessary anchors (e.g. '(^|/)', '($|/)') yourself.
  142. .TP
  143. .BR \-I [\fIfile-pattern\fP]
  144. If this option is specified, the pattern will be passed to
  145. .BR tar (1)'s
  146. \-\-exclude
  147. option when it is called to generate a .orig.tar or .tar file. For
  148. example, \-ICVS will make tar skip over CVS directories when generating
  149. a .tar.gz file. The option may be repeated multiple times to list multiple
  150. patterns to exclude.
  151. \fB\-I\fP by itself adds default \-\-exclude options that will
  152. filter out control files and directories of the most common revision
  153. control systems, backup and swap files and Libtool build output
  154. directories.
  155. .PP
  156. .B Note:
  157. While they have similar purposes, \fB-i\fP and \fB-I\fP have very
  158. different syntax and semantics. \fB-i\fP can only be specified once and
  159. takes a perl compatible regular expression which is matched against
  160. the full relative path of each file. \fB-I\fP can specified
  161. multiple times and takes a filename pattern with shell wildcards.
  162. The pattern is applied to the full relative path but also
  163. to each part of the path individually. The exact semantic of tar's
  164. \-\-exclude option is somewhat complicated, see
  165. http://www.gnu.org/software/tar/manual/tar.html#wildcards for a full
  166. documentation.
  167. The default regexp and patterns for both options can be seen
  168. in the output of the \fB\-\-help\fP command.
  169. .TP
  170. .B Build options (with -b):
  171. .PP
  172. .BR \-sa ", " \-sp ", " \-sk ", " \-su " and " \-sr
  173. will not overwrite existing tarfiles or directories. If this is
  174. desired then
  175. .BR \-sA ", " \-sP ", " \-sK ", " \-sU " and " \-sR
  176. should be used instead.
  177. .PP
  178. If the source package is being built as a version 3 source package using
  179. a VCS, these options do not make sense, and will be ignored.
  180. .TP
  181. .BR \-sk
  182. Specifies to expect the original source as a tarfile, by default
  183. .IB package _ upstream-version .orig.tar. extension \fR.
  184. It will leave this original source in place as a tarfile, or copy it
  185. to the current directory if it isn't already there.
  186. .TP
  187. .B \-sp
  188. Like
  189. .B \-sk
  190. but will remove that tarball again afterwards.
  191. .TP
  192. .B \-su
  193. Specifies that the original source is expected as a directory, by
  194. default
  195. .IB package - upstream-version .orig
  196. and
  197. .B dpkg\-source
  198. will create a new original source archive from it.
  199. .TP
  200. .B \-sr
  201. Like
  202. .B \-su
  203. but will remove that directory after it has been used.
  204. .TP
  205. .B \-ss
  206. Specifies that the original source is available both as a directory
  207. and as a tarfile. dpkg-source will use the directory to create the diff, but
  208. the tarfile to create the
  209. .BR .dsc .
  210. This option must be used with care - if the directory and tarfile do
  211. not match a bad source archive will be generated.
  212. .TP
  213. .B \-sn
  214. Specifies to not look for any original source, and to not generate a diff.
  215. The second argument, if supplied, must be the empty string. This is
  216. used for Debian-specific packages which do not have a separate
  217. upstream source and therefore have no debianisation diffs.
  218. .TP
  219. .BR \-sa " or " \-sA
  220. Specifies to look for the original source archive as a tarfile or as a
  221. directory - the second argument, if any, may be either, or the empty
  222. string (this is equivalent to using
  223. .BR \-sn ).
  224. If a tarfile is found it will unpack it to create the diff and remove
  225. it afterwards (this is equivalent to
  226. .BR \-sp );
  227. if a directory is found it will pack it to create the original source
  228. and remove it afterwards (this is equivalent to
  229. .BR \-sr );
  230. if neither is found it will assume that the package has no
  231. debianisation diffs, only a straightforward source archive (this is
  232. equivalent to
  233. .BR \-sn ).
  234. If both are found then \fBdpkg\-source\fP will ignore the directory,
  235. overwriting it, if
  236. .B \-sA
  237. was specified (this is equivalent to
  238. .BR \-sP )
  239. or raise an error if
  240. .B \-sa
  241. was specified.
  242. .B \-sA
  243. is the default.
  244. .TP
  245. .B Extract options (with \-x):
  246. .PP
  247. In all cases any existing original source tree will be removed.
  248. .TP
  249. .B \-sp
  250. Used when extracting then the original source (if any) will be left
  251. as a tarfile. If it is not already located in the current directory
  252. or if an existing but different file is there it will be copied there.
  253. (\fBThis is the default\fP).
  254. .TP
  255. .B \-su
  256. Unpacks the original source tree.
  257. .TP
  258. .B \-sn
  259. Ensures that the original source is neither copied to the current
  260. directory nor unpacked. Any original source tree that was in the
  261. current directory is still removed.
  262. .PP
  263. All the
  264. .BI \-s X
  265. options are mutually exclusive. If you specify more than one only the
  266. last one will be used.
  267. .
  268. .SH BUGS
  269. The point at which field overriding occurs compared to certain
  270. standard output field settings is rather confused.
  271. The binary package entries in the
  272. .B debian/files
  273. file will be passed through variable substitution twice. This should
  274. not matter, since
  275. .BR $ ", " { " and " }
  276. are not legal in package names or version numbers.
  277. .
  278. .SH SEE ALSO
  279. .BR dpkg\-deb (1),
  280. .BR dpkg (1),
  281. .BR dselect (1).
  282. .
  283. .SH AUTHORS
  284. Copyright (C) 1995-1996 Ian Jackson
  285. .br
  286. Copyright (C) 2000 Wichert Akkerman
  287. .sp
  288. This is free software; see the GNU General Public Licence version 2 or later
  289. for copying conditions. There is NO WARRANTY.