dpkg-source.1 9.5 KB

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