File: cvs-buildpackage.1

package info (click to toggle)
cvs-buildpackage 5.26
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, stretch
  • size: 248 kB
  • sloc: sh: 1,728; perl: 77; makefile: 49
file content (384 lines) | stat: -rw-r--r-- 13,075 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
.\" Hey, Emacs! This is an -*- nroff -*- source file.
.\" Copyright (c) 1997 Manoj Srivastava <srivasta@debian.org>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
.\" 02111-1307, USA.
.\"
.\" $Id: cvs-buildpackage.1,v 1.29 2003/07/03 18:29:41 srivasta Exp $
.\"
.TH CVS\-BUILDPACKAGE 1 "May 13 1999" "Debian" "Debian GNU/Linux manual"
.SH NAME
cvs\-buildpackage \- build Debian packages from a CVS repository.
.SH SYNOPSIS
.B cvs\-buildpackage
.I [options]
.SH DESCRIPTION
This manual page explains the Debian
.B "cvs\-buildpackage"
utility, which is used to build Debian packages whose sources are
stored in a 
.I CVS
repository. This is a 
.B CVS
-aware wrapper around dpkg-buildpackage, and it first parses
.I ./debian/changelog; 
exports the corresponding version (tagged 
.I debian_version_<$version>
), and runs 
.B dpkg-buildpackage
in the exported tree.  It looks for uncommitted files in the source
tree, and offers to abort before doing anything so that the user may
commit the files in, if they wish. 
.B "cvs\-buildpackage"
can also optionally automatically re\-tag all files before exporting
the source (this functionality is only relevant in the top level
directory of a checked out Debian package source tree, of course).
.PP
Please note that the 
.B work
directory referred to below is the scratch directory where the program
does its work; it is where it shall export the sources from CVS, and
it assumes full control of that directory
.I Read:
anything in that directory, apart from the orig source files, can be
deleted by 
.B cvs-buildpackage
Make sure not to have 
.I your
checked out sources/working directory in the same location, as you may
lose data.
.PP
If this utility is not run from a top level  
directory of a checked out Debian package source tree, then to
build an old version the cvs module
name or the package
name have to be supplied on the command line.  
.PP
Combined with the companion utilities
.B cvs\-inject
and  
.B cvs\-upgrade,
this provides an infrastructure to facilitate the use of
.B CVS
by Debian maintainers. This allows one to keep separate CVS branches
of a package for 
.I stable, 
.I unstable, 
and possibly 
.I experimental
distributions, along with the other benefits of a version control system.
.SH OPTIONS
.B \-h
Print out a usage message.
.TP
.BR \-M<module>
The name of the CVS module.
.TP
.BR \-P<package>
Sets the name of the package. Very useful if this is not running in
the CVS checked out source tree, in which case one also needs the
version of the package, which may optionally be determined by checking
out the latest 
.B debian/changelog
file.
.TP
.B \-V<version>
The version number of the package. In conjunction with setting the
package name, this option allows operation outside a CVS source tree
(just needs the repository).
.TP
.B \-T<tag>
The CVS tag to use for exporting sources, rather than constructing one
from the version. This assumes you know what you are doing.
.TP
.B \-U<tag>
The CVS tag to use for the upstream tag, rather than constructing one
from the upstream version. This assumes you know what you are doing.
.TP
.BR \-C<Build\ Command>
Sets the name of the builder program invoked, nominally set to
.B dpkg-buildpackage.
However, the user may choose to use a different build program, or a
wrapper, or even
.IB "'chroot /opt/root dpkg-buildpackage'"
to build the package in a 
.I chroot
jail, if desired. (Obviously, this requires that the Work directory to
be a subdirectory of a previously set up chroot jail).  One may also hook in 
.B pbuilder
by setting this variable to 
.IB "'pdebuild --auto-debsign --buildresult ../'".
(Again, this requires that pbuilder has been set up correctly).
This argument overrides the settings in the environment variable
.B CVSDEB_BUILDPACKAGE,
and the configuration file variable
.B conf_buildpackage.
.TP
.B \-G<get method>
This option, if set, should contain a command to execute to get the
original tarball into the current directory. This can then be used to
allow one to get the original file using, for instance,
.B wget
or 
.BR curl .
This overrides the 
.B CVSDEB_GET_ORIG
environment variable and the
.B conf_get_orig
configuration file option.
.TP
.B \-A
Use
.B apt-get source
to retrive the original tarball.
This option has no effect unless a source package with the correct
upstream version has already been uploaded and is referenced from a
.B Sources
file known to
.BR apt .
If
.B \-A
and
.B \-G
are both given,
.B \-G
is tried first, and
.B apt
is used only if that did not produce the tarball.
This overrides the 
.B CVSDEB_USE_APT
environment variable and the
.B conf_use_apt
configuration file option.
.TP
.B \-R<root\ directory>
Root of the original sources archive. We expect to find the
.I <package\ name>_<version>.orig.tar.gz
file under
.I <root\ directory>/package\ name>/
unless the cvs-buildpackage work directory has been set, or we want to
export the original sources from the vendor branch of the
.I CVS
tree. If the cvs-buildpackage work directory is set anywhere, (command
line, configuration file, environment variable), the root directory
value is ignored, since we only need the root directory to set
defaults for the cvs-buildpackage work directory. This argument
overrides the settings in the environment variable
.B CVSDEB_ROOTDIR,
and the configuration file variable
.B conf_rootdir.
Please note that the cvs-buildpackage work directory referred to here
is the scratch directory where this program works, not the directory
that the human uses to work in.
This should probably not be a sub dir of
.B CVSROOT,
since cvs shall refuse to export packages there, and the script shall
fail. 
.TP
.B \-W<work directory>
The full path name for the cvs-buildpackage working directory, into
which the sources will be exported out of CVS and which should contain
the original
.I <package\ name>_<version>.orig.tar.gz
Please note that it is not strictly essential to have the original
sources, as this script will check out the vendor branch version
tagged as
.B upstream_version_<version>
(without the Debian revision). However, these recreated original
sources are likely to be different for consecutive runs of
cvs-buildpackage, and very likely to be different from the pristine
original sources (different enough to cause problems with an
upload). Thus it is 
.B strongly
advisable to keep the orig.tar.gz file around.
Setting this variable overrides the settings for the root directory. This
argument also overrides the settings in the environment variable
.B CVSDEB_WORKDIR,
and the configuration file variable
.B conf_workdir.
Please note that the cvs-buildpackage work directory referred to here
is the scratch directory where this program works, not the directory
that the human uses to work in. Also, you should specify an absolute
path name for the work directory.  This should probably not be a sub
dir of
.B CVSROOT,
since cvs shall refuse to export packages there, and the script shall
fail. 
.TP
.B \-F
The Force Tag option. This only has effect if run in the source
directory. If set, it forces a 
.I cvs tag \-F
operation to be performed before exporting the sources. This
argument overrides the settings in the environment variable
.B CVSDEB_FORCETAG,
and the configuration file variable
.B conf_forcetag.
The default action is not to force a tag before export.
.TP
.B \-E
The Full Export option. Normally, cvs-buildpackage will export all the
data from CVS using
.I cvs export.
If the orig.tar.gz is not available in the working directory, the
full tree will be exported from CVS regardless of whether this option
is set or not. This option overrides the environment variable
.B CVSDEB_FULLEXPORT,
and the configuration file variable
.B conf_fullexport. 
.TP
.B \-op
The opposite of full export. Using this option resets the value of
full export. Normally, cvs-buildpackage will export all the data from
CVS using
.I cvs export.
With this option set, cvs-buildpackage will extract the
orig.tar.gz in the cvs-buildpackage working directory, and then use
the
.I cvs rdiff
command to bring that tree up-to-date with the CVS tree we're
building. Please look at the 
.B \-f<fix_script>
option to see how to massage the source tree after extraction and
patching. 
.TP
.B \-ctp
Include
.IB package _
at the start of the CVS tag.  This overrides the
.B CVSDEB_PACKAGEINTAG
environment variable and the
.B conf_forcetag
configuration file option.  The default is not to include the prefix.
.TP
.B \-n
The no exec (or dry-run) option, causing
.B cvs\-buildpackage
to print out all actions that would be taken without actually
executing them.
.TP
.B \-f<fix_script>
This option, if set, should point to a script that should be run just
from the top level of the source tree to set up permissions of
scripts that have been created by pathching the sources from an
recently extracted original tar file (the behaviour attained by
setting the 
.B \-op
option. This script is called with two arguments, the package name,
and version. This script is only relevant when that option has been
used. There a number of variables that are exported into the
environment, for example
.B package
contains the name of the package,
.B non_epoch_version
contains the version of the package without the epoch,
.B upstream_version 
contains the upstream version.
.B debian_version
contains the debian revision.
.B cvstag
contains the cvs tag, and
.B cvs_upstream_tag
contains the tag for the upstream version. 
.TP
.B \-H<hook_script>
This option, if set, should point to a script that should be run just
before calling 
.B dpkg\-buildpackage.
Ideally, things like this are done using the modules file and
programs, but is still provided here for convenience. This script is
called with two arguments, the package name, and version. There a
number of variables that are exported into the environment, for
example
.B package
contains the name of the package,
.B non_epoch_version
contains the version of the package without the epoch,
.B upstream_version 
contains the upstream version.
.B debian_version
contains the debian revision.
.B cvstag
contains the cvs tag, and
.B cvs_upstream_tag
contains the tag for the upstream version. 
This argument
overrides the settings in the environment variable 
.B CVSDEB_HOOK
which in turn over rides the configuration file option
.B conf_hook_script.
.TP
.B \-x<prefix>
This option provides the CVS default module prefix (should really fix
the CVS modules file). This
argument overrides the settings in the environment variable
.B CVSDEB_PREFIX.
.B Note:
The configuration file variable
.B conf_prefix is not honoured by 
.B cvs\-buildpackage,
since the prefix is required to calculate the variables that are
supposed to be defined when we load the config file (chicken and egg
problem). 
.PP
The rest of the command line arguments are passed on, uninterpreted, 
to 
.B dpkg\-buildpackage,
though we do pay attention to the -r 
.B (root command)
option
(which gives the command to achieve root access, usually
.I sudo, fakeroot, 
or
.I super
).  The -r option overrides the other means of setting the root command,
namely, the environment variable
.B CVSDEB_ROOTCOMMAND,
which in turn overrides the config file option
.B conf_rootcommand.
No attempt is made to check any other option. Please use the \-h
option to see which of the 
.B dpkg\-buildpackage
options are supported and passed on.
.SH FILES
Apart from the runtime options,
.B cvs\-buildpackage
also looks for site\-wide defaults in the file
.I /etc/cvsdeb.conf.
After that, it looks for and reads
.I "~/.cvsdeb.conf".
The default configuration allows there to be a site wide override for
the root or the cvs-buildpackage working directories on the site, but
the
.I cvsdeb.conf
files are actually Bourne shell snippets, and any legal shell directives
may be included in there.
.B Note:
Caution is urged with this file, since you can totally change the way
that the script behaves by suitable editing this file.
.SH "SEE ALSO"
.BR dpkg-buildpackage (1),
.BR cvs-inject (1),
.BR cvs-upgrade (1),
.BR cvsdeb.conf (5),
.BR cvs (1).
.SH AUTHOR
This manual page was written Manoj Srivastava <srivasta@debian.org>,
for the Debian GNU/Linux system.