dpkg-source.1 9.8 KB

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