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
|
PBuilder Hooks by apachelogger
############ Installation
* Link or copy the files you want to use to ~/.pbuilder-hooks
* A synopsis of each hook's functionality is located at the end of this
document, also make sure you read the sections about custom pool, icecc etc.
* The Little Helpers section holds some additional tweaks that greatly improve
pbuilder enjoyment
* To finalize everything, add
HOOKDIR="/home/$USERNAME/.pbuilder-hooks"
to your .pbuilderrc (don't forget to replace $USERNAME with $USERNAME ;-)
############ Custom Pool
* In various cases it makes sense to use a simple package pool in pbuilder.
Such a case would for example be stackbuilding KDE before publishing
anything, or you when you want to build a package which depends on another
one which is not yet built/available in a repository.
For these situations there is D09custompool which will essentially run
dpkg-scanpackages to create a _very_ simple repository without the usual
pool structure (pool/a, pool/b, pool/c...). Further more it requires you to
use a very explicit path setup.
* The expected structure on your regular system looks like this
/usr/src/deb/pool/
/usr/src/deb/pool/intrepid
/usr/src/deb/pool/jaunty
/usr/src/deb/pool/...
* To use the pool just throw packages in, add D09custompool to your hooks and
set
BINDMOUNTS="/usr/src/deb/pool/jaunty"
and add
export POOL=true
in your pbuilderrc. That should be everything you need to do, you really
want to continue reading though ;-)
* In order to do comfortable uploads to this pool you want to use a dput.cf
entry like the following. Please note that allow_unsigned_uploads is very
important because pbuilder will not invoke debsign by default, setting the
distribution is a very sensible thing to do as well, since that way dput
will prevent you from uploading to the wrong pool.
[jaunty]
method = local
incoming = /usr/src/deb/pool/jaunty
allowed_distributions = jaunty
allow_non-us_software = 1
allow_unsigned_uploads = 1
run_dinstall = 0
post_upload_command = cd /usr/src/deb/pool/jaunty && dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
* If you don't want to give your user +w on this directory (which is probably
sensible) you still don't need to manual change the hook, the setup becomes
more complicate though.
You will need to create a transitional directory which will be treated by
dput as new incoming directory (i.e. you need to change the setting
accordingly). Then you just need to modify the post_upload_cmd to use sudo
and move the content of the incoming dir to the actual pool before the cmd
used above. IMHO it actually makes sense to write a script for post_upload.
* Once all is set up properly you should be able to use
deb file:/usr/src/deb/pool/jaunty jaunty ./
to use your package pool. It makes sense to change pbuilder's sources.list
(sudo pbuilder login --save-after-login). If you don't add it manually, the
hook will add it every time again and run the scan to make sure the
Packages.gz is up-to-date.
* In case you want to cleanup the pool form time to time, just remove all its
content (you also might want to run the dput post_upload_command manually).
############ ICECC
* If you don't want to use icecc (aka Icecream) you will need to remove
D20icecc and possibly also B90kill and C90kill.
* If you want to use icecc you will need to add the following to your pbuilderrc:
export PATH="/usr/lib/icecc/bin:${PATH}"
DEBBUILDOPTS="-j5"
The DEBBUILDOPTS setting represents the number of jobs to run (usually
amount of CPUs+1, in this case 2 nodes, 2 cores = 5 jobs)
* You also need to edit D20icecc. In line 10 change pb@apoc to whatever your
node should be called (the actual name will be pb@apoc@153012 - hour, minute
second as kind of unique identifier). You also need to change the scheduler
IP in the same line ("192.168.1.2").
* While C90kill will kill the iceccd (i.e. the node daemon) it will not
restart a possibly installed iceccd on the build machine (any iceccd will
get killed in D20icecc), so in order to use your regular iceccd again you
will need to restart the daemon manually.
############ CCACHE
* I also have CCACHE settings in my pbuilderrc, but I don't remember if it
ever worked, or if it only did without icecc.
If someone wants to try -> poke me
############ Little Helpers
* Adding
PKGNAME_LOGFILE_EXTENTION="_$(dpkg --print-architecture).build"
PKGNAME_LOGFILE=yes
to your pbuilderrc will ensure pbuilder _always_ creates a build log (helps
with debugging).
* Adding
export DH_VERBOSE=1
will always turn on DH_VERBOSE making debugging a lot easier.
* I have the following in my .bash_aliases
alias pbuild='rm -rf build && mkdir build && sudo pbuilder build --buildresult ./build --logfile ./build/BUILDLOG *dsc'
it will remove ./build, recreate it, and run pbuilder using *dsc piping
everything (including log) to ./build
############ Features
B10list-missing:
list missing files
B90kill:
kill icecc
C10shell:
drops to shell upon FTBFS
add export EDITOR="nano" to your pbuilderrc to install nano as editor (or
set the var to any other valid package name of an editor)
C90kill:
link to B90kill
D09custompool:
makes you able to use a custom package pool
D10aptupdate:
runs apt-get update before anything
D20icecc:
makes pbuilder use icecream
D99nocompression:
exports appropriate vars to turn off compression
|