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
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
|
.TH "pbuilder" 8 "2007 Apr 10" "Debian" "pbuilder"
.SH NAME
pbuilder \- personal package builder
.SH SYNOPSIS
.BI "pbuilder --create [" "options" "]"
.PP
.BI "pbuilder --update [" "options" "]"
.PP
.BI "pbuilder --build [" "options" "] " ".dsc-file"
.PP
.BI "pbuilder --execute [" "options" "] -- " "script [" "script options" "]"
.PP
.BI "pbuilder --clean"
.PP
.BI "pbuilder --login [" "options" "]"
.SH "DESCRIPTION"
Front end program to the
.B "pbuilder"
suite of programs, used for creating and maintaining chroot environment
and building Debian package in the chroot environment.
.SH "COMMANDS"
.TP
.B "--create"
Creates a
.B "base.tgz"
for the specified distribution.
.TP
.B "--update"
Updates the
.B "base.tgz"
for the specified distribution.
Also, by specifying the
.B "\-\-override\-config"
option, it is possible to install a new apt-line using
the given options and settings in the configuration file
for the base.tgz.
For example, to switch the distribution of an existing
base.tgz to sid, specify the
.B "\-\-distribution sid \-\-override\-config"
options to update.
.TP
.B "--build"
Builds the package specified by
.I ".dsc-file"
in the chroot environment created using the
.B "base.tgz"
.TP
.B "--clean"
Cleans up the directory specified by the configuration
.B "BUILDPLACE"
and
.B "APTCACHE"
specified in
.I "/etc/pbuilderrc"
.TP
.B "--login"
Logs into the chroot, and cleaned up afterwards.
Any changes you make will not be kept.
Only use this for temporary and debugging purposes.
Do not bind-mount filesystems directly inside the chroot.
Use
.B "\-\-bindmounts"
option to mount.
.TP
.B "--execute"
Execute a script or command inside the chroot,
in a similar manner to
.B "--login"
The file specified in the command-line argument will be
copied into the chroot, and invoked.
The remaining arguments are passed on to the script.
.TP
.B "--dumpconfig"
Dumps configuration information, used for debugging.
.TP
.B "--debuild"
Builds a Debian package from the Debian source directory.
The current directory should have the usual
.I "debian/"
directory.
Same as
.B "pdebuild --use-pdebuild-internal"
.SH "OPTIONS"
The command is followed by options of the form
.BI "\-\-" "option name"
which will modify the semantics as explained below.
They are applied from left-to-right, and when there are
conflicting options, the rightmost options will have effect.
.TP
.BI "\-\-basetgz [" "basetgz-location" "]"
Specifies the location of
.B "base.tgz"
This option will define the default distribution and
apt-lines when used in
.B "pbuilder --update"
and
.B "pbuilder --create"
.TP
.BI "\-\-buildplace [" "location of build" "]"
Specifies the location where building and
.B "base.tgz"
updating and creation takes place. This is
a temporary work directory.
A subdirectory of that directory using the current PID of the
process is used.
.TP
.BI "\-\-buildresult [" "location to put build result" "]"
Specifies the location the build result gets into after building.
The deb files and other files that have resulted from build
is copied there.
Note that the default value is not the current directory,
or
.B ".."
but another place,
.B "/var/cache/pbuilder/result"
This is to avoid
overwriting already existing deb files with
the newly generated ones.
.TP
.BI "\-\-mirror [" "mirror location" "]"
Specifies the URL of Debian mirror to be
specified in
.B "sources.list"
inside the chroot.
This option is only valid when distribution is being specified, for
.B "--update"
and
.B "--build"
targets.
The format is something like:
.I "http://http.us.debian.org/debian"
which should point to your favourite mirror.
This option can optionally be omitted, and left blank,
in which case, this part is skipped.
Note that these URLs specified to pbuilder will be used from within
the chroot, and specifying
.B "file:/somewhere/"
will most probably fail.
.TP
.BI "\-\-othermirror [" "deb http://xxx/xxx/ ./ " "|" " other deb lines... " "]"
The lines which is added to the sources.list, delimited with
.B "|"
Like
.B "deb http://local/mirror stable main|deb file:/usr/local/mirror ./"
The deb lines here are the ones that will appear at the top of the
.B "sources.list"
inside the chroot.
Be sure to follow the syntax rules of
.BR "sources.list" "(5)."
These lines appear at the beginning of the
constructed sources file, so this is the place to list your
.B "local"
mirror sites; apt will then use them in preference to the ones
listed in
.B "\-\-mirror".
.TP
.BI "\-\-distribution [" "distribution" "]"
Specifies the distribution used. The supported values are the ones debootstrap
supports, plus experimental which is special cased in pbuilder. For instance
you may use:
.B "sid"
or
.B "experimental".
.TP
.BI "\-\-architecture [" "architecture" "]"
Specifies the architecture to use when creating the chroot, defaults to the
system one. The supported values are the ones debootstrap supports.
.TP
.BI "\-\-components [" "components" "]"
Specifies the default distribution components to use. eg. "main contrib non-free".
Default is "main".
.TP
.BI "\-\-override\-config"
Specify to use different apt set up inside the chroot than it was used for creating the base.tgz.
Specify this when you want to do
.B "pbuilder --update"
with a different distribution target set up.
.B "--distribution", "--components", "--mirror", "--othermirror"
options are only valid when
.B "\-\-override\-config"
option is specified in
.B "--update"
target, or when
.B "pbuilder --create"
is being called.
.TP
.BI "\-\-http\-proxy [" "proxy" "]"
Specifies the http proxy URL. Something like
.B "http://xxx.xxx.xxx.xxx:8080/"
should do.
.TP
.BI "\-\-aptcache [" "location of retrieved package files" "]"
Specifies the location where the packages downloaded by apt should
be cached. Use
.B "\-\-aptcache """""
if you want caching to be turned off.
.TP
.BI "\-\-debdelta
This option is used in the
.B "\-\-update"
target, and enable the use of debdelta (if it is already installed, otherwise
will be installed the first time this option is used).
.TP
.BI "\-\-configfile [" "configuration file to load" "]"
Additional configuration file to read after all other
configuration files have been read.
\" START OF hookdir description
.TP
.BI "\-\-hookdir [" "location of user scripts" "]"
Specifies the location where scripts for user intervention during
the
.B "--create"
and
.B "--update"
process are stored. Currently scripts are
executed at only one point, on exit from the chrooted environment,
just before either a create or a build regenerated the base.tgz
file. The script names must be in the form
.B "X<digit><digit><whatever-else-you-want>"
much like boot scripts. The scripts must be executable and may
be either binaries or interpreted scripts. If it is a script
in other than Bourne Shell or Perl, it is up to the user to
ensure the interpreter was previously installed in the chrooted
environment. Files ending in ~ or .bak are ignored.
Although it may not seem necessary,
.B "pbuilder --update"
does not invoke the hooks if
.B "\-\-hookdir"
is empty, so if you want to avoid running hooks,
run pbuilder with
.B "\-\-hookdir """""
If there is a distribution hook, for example, if
there was a file
.B "sid"
inside the hook directory, and the script was creating the
chroot for
.B "sid"
distribution, pbuilder will call debootstrap with that
as the 4th parameter in the chroot creation process.
This allows for use of custom debootstrap hook script.
.B "A<digit><digit><whatever-else-you-want>"
is for
.B "--build"
target.
It is executed before build starts; after
unpacking the build system, and unpacking the source,
and satisfying the build-dependency.
.B "B<digit><digit><whatever-else-you-want>"
is executed after build system finishes building,
successfully, before copying back the build result.
.B "C<digit><digit><whatever-else-you-want>"
is executed after build failure, before cleanup.
.B "D<digit><digit><whatever-else-you-want>"
is executed before unpacking the source inside the chroot,
after setting up the chroot environment.
Create $TMP, and $TMPDIR if necessary.
This is called before build-dependency is satisfied.
Also useful for calling
.B "apt-get update"
.B "E<digit><digit><whatever-else-you-want>"
is executed after
.B "pbuilder --update"
and
.B "pbuilder --create"
finishes apt-get work with the chroot,
before umounting kernel file systems (/proc) and
creating the tarball from the chroot.
.B "F<digit><digit><whatever-else-you-want>"
is executed just before user logs in, or
program starts executing, after chroot is created
in
.B "--login"
or
.B "--execute"
target.
.B "G<digit><digit><whatever-else-you-want>"
is executed just after debootstrap finishes,
and configuration is loaded, and pbuilder starts mounting /proc and invoking
.B "apt-get install"
in
.B "--create"
target.
\" End of hookdir description
.TP
.BI "\-\-debbuildopts [" "options" "]"
List of options that are passed on to dpkg-buildpackage. Multiple flags are
additive and appended ot the any value given in DEBBUILDOPTS as specified in
pbuilderrc. To clear the list of options, pass the empty string, e.g.
\-\-debbuildopts "".
Multiple options are delimited with spaces,
like \-\-debbuildopts "\-j100 \-E"
.TP
.BI "\-\-logfile [" "file to log" "]"
Specifies the logfile to create.
The messages generated during execution will be written to the specified file,
and the standard output.
.TP
.BI "\-\-binary\-arch"
Specify to build architecture specific targets instead of all targets.
Setting
.B "\-\-debbuildopts"
after this option will re-set some parts of the effect.
Use this option rather than using
.B "\-\-debbuildopts -B"
.TP
.BI "\-\-bindmounts " "bind-mount-points"
Bind-mount the specified directories to inside the chroot.
.I "bind-mount-points"
is a space-delimited list of directories to bind-mount which should be
specified in a space-delimited manner, surrounded in double quotations, like:
.B """/srv /somedir /someotherdir"""
.TP
.BI "\-\-debootstrapopts " "\-\-variant=buildd" " " "\-\-keyring" " " "/usr/share/keyrings/debian\-archive\-keyring.gpg"
Add extra command-line options to debootstrap.
Specify multiple options through multiple instance of this
option, for example:
.B "--debootstrapopts --arch=arm --debootstrapopts --variant=buildd"
.TP
.BI "\-\-debootstrap " "debootstrap"
Use specified debootstrap implementation as debootstrap.
Known implementations are
.B cdebootstrap
and
.B debootstrap
and default is to use
.B debootstrap.
.TP
.BI "\-\-allow\-untrusted "
Allow untrusted (no key installed) and unsigned repositories.
.BI Warning:
Enabling this option may allow remote attackers to compromise the system.
Better use signed repositories and
.B "\-\-keyring"
to add the key(s).
.TP
.BI "\-\-keyring " "path/to/keyring"
Additional keyrings to use for package verification with apt, not used for
debootstrap (use
.B "\-\-debootstrapopts"
). Use this to add (local) signed repositories. By default the
debian-archive-keyring package inside the chroot is used. Can be specified
multiple times.
.TP
.BI "\-\-save\-after\-login "
.TP
.BI "\-\-save\-after\-exec "
Save the chroot image after exiting from the chroot instead of
deleting changes.
Effective for
.B login
and
.B execute
session.
.TP
.BI "\-\-autocleanaptcache"
Clean apt cache automatically, to run apt-get autoclean to only
keep the packages which are required for the version of Debian.
This is useful when you keep a aptcache directory for each distribution
and want to keep the size of the aptcache down.
.TP
.BI "\-\-help"
Show a brief help message.
.SH "MORE SPECIFIC OPTIONS"
Some options are more involved to pbuilder internal than others. The
following options are available.
.TP
.BI "\-\-removepackages [" "packages to remove" "]"
Removes the packages on creating the
.BR "base.tgz" "."
Use this option to remove potentially dangerous or undesirable
packages, like
.B "lilo"
which nobody will need to have inside a chroot.
Packages should be specified in a space-delimited manner,
surrounded in double quotations, like
.B """lilo gcc mawk"""
.TP
.BI "\-\-extrapackages [" "packages to add" "]"
Adds packages specified as an addition to the default,
which is
.B "build-essential"
by default.
This is used in
.B "--build"
and
.B "--create"
(after successfully creating the initial chroot)
and
.BR "--update" .
The packages should be specified as a space-delimited list.
.TP
.BI "\-\-debemail [" "maintainer-name <email-address>" "]"
Specifies that dpkg-buildpackage be called with
.BI "-m" "maintainer-name <email-address>"
instead of default value specified in the environment
variable, or pbuilderrc
.B "This option is almost obsolete, use \-\-debbuildopts instead"
.TP
.BI "\-\-pkgname\-logfile"
Alternative option to
.B "\-\-logfile"
option.
Automatically creates a logfile that is named by the .dsc file name,
only really applicable for
.B "--build"
target.
The file extension is specified by
.B "PKGNAME_LOGFILE_EXTENSION"
in
.B "pbuilderrc"
.TP
.BI "\-\-aptconfdir [" "APT configuration directory to use" "]"
Uses the apt configuration file found in the specified directory
as the chroot configuration.
.B "/etc/apt"
is one example, so that the same configuration can be used inside the
chroot.
This option overrides other options, and may cause some inconsistency
problems.
.TP
.BI "\-\-timeout [" "timeout in sleep time" "]"
Time out building after sleeping set time.
Specify something like
.B "\-\-timeout 10h"
in the command line.
Default is no timeout.
.TP
.BI "\-\-no\-targz"
Not using base.tgz for operation.
The
.B "\-\-buildplace"
will not be deleted and reconstructed from
a
.B .tar.gz
file.
Also,
.B "pbuilder"
will not add its process ID to the
.B "\-\-buildplace"
as it usually would.
Useful when experimenting with
chroots, or trying to create chroots outside control
of
.B "pbuilder."
.TP
.BI "\-\-compressprog"
Program to use for compression and decompression of the base.tgz.
The default is to use gzip, and any program that can be used for
the \-\-use\-compress-program option of tar can be given.
If set to "pigz", compression and decompression is gzip compatible
but will use all available CPUs.
.TP
.BI "\-\-twice"
Build the package twice in a row. Useful to ensure the package cleans up
properly. The resulting packages are the ones from the second build.
.TP
.BI "\-\-preserve\-buildplace"
Do not clean the
.B "\-\-buildplace"
if it has the same contents as the
.B .tar.gz
file, and no modifications are done.
For preserving the build place for
.B "--create"
and
.B "--update"
targets, see
.B "--debug"
option.
As with
.BR "\-\-no\-targz" ","
suppresses appending
.BR "pbuilder" "'s"
process ID to the
.BR "\-\-buildplace" "."
This is useful if you want to attempt to build a large number of
packages successively, but you expect that many of them cannot have
their build dependencies satisfied.
It will clean up the build place on failure,
or after a successful build.
.TP
.BI "\-\-debug"
Turn on Debug mode of pbuilder, to be verbose about errors,
and try to avoid cleanup processing when error happens in
.B "--update"
and
.B "--create"
targets.
.TP
.BI "\-\-inputfile " "filename"
Add extra file to be copied to
.B "/tmp/buildd"
inside the build environment.
available in
.B "--build"
and
.B "--login"
and
.B "--execute"
targets.
.SH "FILES"
.TP
.I "/etc/pbuilderrc"
The system-wide configuration file for pbuilder.
.TP
.I "/usr/share/pbuilder/pbuilderrc"
The default settings for pbuilder, used as fallback for all
values that is not specified in
.B "/etc/pbuilderrc."
.TP
.I "${HOME}/.pbuilderrc"
The personal configuration file for pbuilder, which overrides
settings set in other configuration files.
Note that ${HOME} is usually /root (if you are running pbuilder
through sudo).
.SH "EXAMPLES"
.TP
.B "pbuilder --create"
.nf
# pbuilder \-\-create
Distribution is sid.
Building the build environment
-> running debootstrap
/usr/sbin/debootstrap
I: Retrieving Release
I: Retrieving Packages
I: Validating Packages
.
.
.hy
.TP
.B "pbuilder --update"
.nf
# pbuilder \-\-update
W: /home/dancer/.pbuilderrc does not exist
Building the build Environment
-> extracting base tarball [/var/cache/pbuilder/base.tgz]
.
.
.hy
.TP
.B "pbuilder --build"
.nf
# pbuilder \-\-build dsh_*.dsc
I: using fakeroot in build.
Current time: Sat Jan 20 12:03:34 JST 2007
pbuilder-time-stamp: 1169262214
Building the build Environment
-> extracting base tarball [/home/dancer/DEBIAN/pbuilder/pbuilder/testsuite/tmp.FeeAX18779/testimage]
-> creating local configuration
.
.
.hy
.SH "BUGS"
This program is starting to have too many options already.
.SH "AUTHOR"
Initial coding, and main maintenance is done by
Junichi Uekawa <dancer@debian.org>.
User hooks code added by Dale Amon <amon@vnl.com>
The homepage is available at
.B "\%http://pbuilder.alioth.debian.org"
.SH "SEE ALSO"
.BR "/usr/share/doc/pbuilder/pbuilder-doc.html" ", "
.BR "pdebuild" "(1), "
.BR "pbuilderrc" "(5)"
\" LocalWords: buildresult
|