dpkg-source.1 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. .\" Authors: Ian Jackson
  2. .TH dpkg\-source 1 "2007-03-07" "Debian Project" "dpkg utilities"
  3. .SH NAME
  4. dpkg\-source,
  5. \- Debian source package tools
  6. .
  7. .SH SYNOPSIS
  8. .B dpkg\-source
  9. .RI [ options ]
  10. .I command
  11. .
  12. .SH DESCRIPTION
  13. .B dpkg\-source
  14. packs and unpacks Debian source archives.
  15. None of these commands allow multiple options to be combined into one,
  16. and they do not allow the value for an option to be specified in a
  17. separate argument.
  18. .
  19. .SH COMMANDS
  20. .TP
  21. .BI "\-x " filename ".dsc " \fR[\fPoutput-directory\fR]\fP
  22. Extract a source package. One non-option argument must be supplied,
  23. the name of the Debian source control file
  24. .RB ( .dsc ).
  25. An optional second non-option argument may be supplied to specify the
  26. directory to extract the source package to, this must not exist. If
  27. no output directory is specified, the source package is extracted into
  28. a directory named \fIsource\fR-\fIversion\fR under the current working
  29. directory.
  30. .B dpkg\-source
  31. will read the names of the other file(s) making up the source package
  32. from the control file; they are assumed to be in the same directory as
  33. the
  34. .BR .dsc .
  35. The files in the extracted package will have their permissions and
  36. ownerships set to those which would have been expected if the files
  37. and directories had simply been created - directories and executable
  38. files will be 0777 and plain files will be 0666, both modified by the
  39. extractors' umask; if the parent directory is setgid then the
  40. extracted directories will be too, and all the files and directories
  41. will inherit its group ownership.
  42. .TP
  43. .RI "\fB\-b\fP [" options "] " directory " [" orig-directory | orig-targz |'']
  44. Build a source package. One or two non-option arguments should
  45. be supplied. The first is taken as the name of the directory
  46. containing the unpacked source tree. 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.gz
  53. or the original source directory
  54. .IB directory .orig
  55. or the empty string (no original source, and so no diff) depending on
  56. the arguments.
  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 \fBdpkg\-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.
  115. This is very helpful in cutting out extraneous files that get included
  116. in the .diff.gz, (eg: "debian/BUGS_TODO/*" or "debian/RCS/*,v"). For
  117. instance, if you maintain a package that you track via remote CVS,
  118. where you don't have access permissions for committing the debian
  119. control files and making tags for \fIcvs\-buildpackage(1)\fR, it is
  120. necessary to perform an extra checkout/update into a directory you
  121. keep pristine, to generate the .orig.tar.gz from. That directory will
  122. have CVS/Entries files in it that will contain timestamps that differ
  123. from the ones in your working directory, thus causing them to be
  124. unnecessarily included in every .diff.gz, unless you use the \fB\-i\fR
  125. switch.
  126. .TP
  127. .BI \-I filename
  128. If this option is specified, the filename will be passed to tar's \-\-exclude
  129. option when it is called to generate a .orig.tar.gz or .tar.gz file. For
  130. example, \-ICVS will make tar skip over CVS directories when generating
  131. a .tar.gz file. The option may be repeated multiple times to list multiple
  132. filenames to exclude.
  133. .TP
  134. .BR \-si ", " \-sa ", " \-sd
  135. These options control whether the original source archive is included
  136. in the upload generated by
  137. .BR dpkg\-buildpackage
  138. if any source is being generated (i.e.,
  139. .BR \-b " or " \-B
  140. haven't been used).
  141. By default, or if
  142. .B \-si
  143. is specified, the original source will be included if the version
  144. number ends in
  145. .BR \-0 " or " \-1 ,
  146. i.e. if the Debian revision part of the version number is
  147. .BR 0 " or " 1 .
  148. .B \-sa
  149. forces the inclusion of the original source;
  150. .B \-sd
  151. forces its exclusion and includes only the diff.
  152. .TP
  153. .BR \-sa , \-sp , \-su , \-sk , \-sA , \-sP , \-sU , \-sK , \-ss " with " \-b
  154. If
  155. .BR \-sk " or " \-sp
  156. is specified
  157. .B dpkg\-source
  158. expects the original source as a tarfile, by default
  159. .IB package _ upstream-version .orig.tar.gz\fR.
  160. It will leave this original source in place as a tarfile, or copy it
  161. to the current directory if it isn't already there
  162. If
  163. .B \-sp
  164. is used rather than
  165. .B \-sk
  166. it will remove it again afterwards.
  167. If
  168. .BR \-su " or " \-sr
  169. is specified the original source is expected as a directory, by
  170. default
  171. .IB package - upstream-version .orig
  172. and
  173. .B dpkg\-source
  174. will create a new original source archive from it. If
  175. .B \-sr
  176. is used
  177. .B dpkg\-source will remove that directory after it has been used.
  178. If
  179. .B \-ss
  180. is specified
  181. .B dpkg\-source
  182. will expect that the original source is available both as a directory
  183. and as a tarfile. If will use the directory to create the diff, but
  184. the tarfile to create the
  185. .BR .dsc .
  186. This option must be used with care - if the directory and tarfile do
  187. not match a bad source archive will be generated.
  188. If
  189. .B \-sn
  190. is specified
  191. .B dpkg\-source
  192. will not look for any original source, and will not generate a diff.
  193. The second argument, if supplied, must be the empty string. This is
  194. used for Debian-specific packages which do not have a separate
  195. upstream source and therefore have no debianisation diffs.
  196. If
  197. .BR \-sa " or " \-sA
  198. is specified
  199. .B dpkg\-source
  200. will look for the original source archive as a tarfile or as a
  201. directory - the second argument, if any, may be either, or the empty
  202. string (this is equivalent to using
  203. .BR \-sn ).
  204. If a tarfile is found it will unpack it to create the diff and remove
  205. it afterwards (this is equivalent to
  206. .BR \-sp );
  207. if a directory is found it will pack it to create the original source
  208. and remove it afterwards (this is equivalent to
  209. .BR \-sr );
  210. if neither is found it will assume that the package has no
  211. debianisation diffs, only a straightforward source archive (this is
  212. equivalent to
  213. .BR \-sn ).
  214. If both are found then dpkg\-source will ignore the directory,
  215. overwriting it, if
  216. .B \-sA
  217. was specified (this is equivalent to
  218. .BR \-sP )
  219. or raise an error if
  220. .B \-sa
  221. was specified.
  222. .B \-sA
  223. is the default.
  224. .BR \-sa ", " \-sp ", " \-sk ", " \-su " and " \-sr
  225. will not overwrite existing tarfiles or directories. If this is
  226. desired then
  227. .BR \-sA ", " \-sP ", " \-sK ", " \-sU " and " \-sR
  228. should be used instead.
  229. .TP
  230. .BR \-sp , \-su , \-sn " with " \-x
  231. In all cases any existing original source tree will be removed.
  232. If
  233. .B \-sp
  234. is used when extracting then the original source (if any) will be left
  235. as a tarfile. If it is not already located in the current directory
  236. or if an existing but different file is there it will be copied there.
  237. This is the default.
  238. .B \-su
  239. unpacks the original source tree.
  240. .B \-sn
  241. ensures that the original source is neither copied to the current
  242. directory nor unpacked. Any original source tree that was in the
  243. current directory is still removed.
  244. .PP
  245. All the
  246. .B \-sX
  247. options are mutually exclusive. If you specify more than one only the
  248. last one will be used.
  249. .
  250. .SH BUGS
  251. The point at which field overriding occurs compared to certain
  252. standard output field settings is rather confused.
  253. The binary package entries in the
  254. .B debian/files
  255. file will be passed through variable substitution twice. This should
  256. not matter, since
  257. .BR $ ", " { " and " }
  258. are not legal in package names or version numbers.
  259. .
  260. .SH SEE ALSO
  261. .BR dpkg\-deb (1),
  262. .BR dpkg (1),
  263. .BR dselect (1).
  264. .
  265. .SH AUTHORS
  266. Copyright (C) 1995-1996 Ian Jackson
  267. .br
  268. Copyright (C) 2000 Wichert Akkerman
  269. .sp
  270. This is free software; see the GNU General Public Licence version 2 or later
  271. for copying conditions. There is NO WARRANTY.