3
This package is currently aimed at developers. Some knowledge
4
of the Debian build system may be required to get it working
5
properly. Bug reports (and patches) welcome to simplify or
8
-------------------------------------------------------------------------
11
sbuild is part of the wanna-build suite of programs by Roman Hodek.
12
cvs.linux-68k.org has more information.
14
To get wanna-build/buildd/sbuild from CVS:
16
cvs -d :pserver:anon@cvs.linux-m68k.org:/CVS login
18
cvs -d :pserver:anon@cvs.linux-m68k.org:/CVS checkout wanna-build
20
Some things have been moved around with this sbuild package to
21
make it conform to Debian policy and some functionality that
22
isn't required when sbuild is used apart from wanna-build/buildd
23
has been removed or ignored.
25
Current CVS and the code in common use by most buildds have
26
diverged somewhat. A merge is expected. This sbuild is the "apt
27
patch" version that uses apt-get to fetch the source, eliminating
28
the need for the FetchFile perl module.
30
NOTE: this package requires the sbuild user have full sudo.
31
If you don't want this pbuilder might suit your needs better.
33
-------------------------------------------------------------------------
36
In the rest of the doc, DIST={stable,unstable}, "base" is your
37
root install and USER is the user who is going to use sbuild.
38
Substitute the proper login of course.
40
It's assumed that the chroots are at /usr/local/chroot/DIST.
41
This isn't hard-coded anywhere, just the layout that wanna-build
42
has always used. Only the symlinks to the chroot(s) in each
43
user's build directory matter. More later.
45
-------------------------------------------------------------------------
46
I. modifications in the base install
47
II. building the chroots
48
III. chroot modifications that sbuild requires
51
I. modifications in the base install
52
====================================
54
group "sbuild" was created during the install. Each sbuild user
55
has to be added to that group. He also has to be added to sudoers.
57
(# is the root prompt, $ the user prompt.)
59
1. add the sbuild user to the group
63
(or # vigr and manually edit)
65
2. add the sbuild user to sudoers
69
add the following line:
70
USER ALL=(ALL) NOPASSWD: ALL
72
(change USER to the user's login)
74
3. add chroot proc entries to fstab, in base
77
none /usr/local/chroot/DIST/proc proc defaults 0 0
79
You'll need an fstab entry for each chroot of course.
81
4. setup user's home directory
83
$ cp /usr/share/doc/sbuild/configs/example.sbuildrc ~/.sbuildrc
85
change the "mailto" and "maintainer_name" values to your own.
86
You'll be mailed the build logs.
88
$ mkdir ~/logs # for the build logs
89
$ mkdir ~/build # the build directory
91
$ ln -s /usr/local/chroot/stable chroot-stable # chroot symlinks
92
$ ln -s /usr/local/chroot/unstable chroot-unstable
95
II. Building the chroots
96
========================
98
If you don't have chroots set up you have to do that now. This
99
is more painful than it needs to be but it's only done once.
100
You'll just upgrade/dist-upgrade from then on.
102
You can use the debootstrap method or the chroot/makechroot
103
script in the sbuild's doc directory. That script uses
104
/usr/local/chroot/ for the chroot base. This may not be what you
105
want. Flavor to suit.
108
III. chroot modifications
109
=========================
111
The bin/fixchroot script in sbuild's doc directory automates the
112
following. It should also be run whenever someone is added to
113
sbuild group and sudoers or any of the other /etc files below are
114
modified. The script will likely be kept more up to date than
115
this explanation. Please check through it.
117
Once the chroots are set up you need to do the following:
118
(again DIST={stable,unstable}, USER = the sbuild user's login.)
120
1. add a build directory for each user in each chroot
122
# mkdir -p /usr/local/chroot/DIST/build/USER
123
- sbuild uses this directory to unpack source & build packages
124
# chgrp -R sbuild /usr/local/chroot/DIST/build
125
# chmod -R g+w /usr/local/chroot/DIST/build
127
2. add a lockdir for sbuild, each chroot
129
# mkdir -p /usr/local/chroot/DIST/var/lib/sbuild/srcdep-lock
130
# chgrp -R sbuild /usr/local/chroot/DIST/var/lib/sbuild
131
# chmod -R 775 /usr/local/chroot/DIST/var/lib/sbuild
133
3. add some config files, each chroot (this list could very likely
136
# cd /usr/local/chroot/DIST
158
If you're not in your build directory when you run sbuild, the
159
build will happen in base and that's not what you want. A useful
162
alias sbu='cd ~/build && sbuild -v -D -d unstable -p successful'
164
This should build ed (if 0.2-19 is the current version) and mail
168
$ sbuild -v -D -d unstable -p successful ed_0.2-19
170
Now try something that has build-dependencies. :-)
172
---------------------------------------------------------------------------
176
"Can't create lock file ..."
177
You've probably not been added to the sbuild group. Remember
180
Permission problems are usually the result of altering the base
181
/etc files and not copying them to the chroots.
183
ssmtp in unstable depends on debconf and you don't want debconf
184
prompting you when autobuilding. It should have these options:
185
# dpkg-reconfigure debconf
190
If you've deleted & recreated the sbuild group it may have a
191
different GID than before. You'll have to update some dirs/files
192
in the chroots. See "chroot modifications" in this doc and the
195
---------------------------------------------------------------------------
199
# dpkg --root=/where/your/chroot/is
200
- this roots dpkg in the chroot so you can use it from base
202
Also see bin/ in sbuild's doc directory for some useful utilities.
203
Probably the most interesting:
206
- these scripts root apt-get in the chroots. They use sudo for
207
the actual apt-get operations so non-root can use them if s/he's
208
in sudoers. You can also use apt-cache with chrapt, at the cost
209
of having to type apt-(get|cache). (apt-get is understood by
210
chrootapt.) -h each for usage info.
212
$ deborphan -f /usr/local/chroot/unstable/var/lib/dpkg/status -a
213
- helps you keep a minimal chroot; shows the packages that no
216
If you've moved the chroots from the default you'll have to set the
217
environment variable SBUILD_CHROOT_ROOT. The supplied scripts are
220
---------------------------------------------------------------------------
224
avg-build-times avg-build-space
225
-------------------------------
226
sbuild will keep databases of the time and space that builds
227
require if a couple files exist:
229
touch /var/lib/sbuild/avg-build-{times,space}
230
chmod 664 /var/lib/sbuild/avg-build-{times,space}
231
chgrp sbuild /var/lib/sbuild/avg-build-{times,space}
233
More info in the avg-pkg-build-time man page.
238
These are useful for building packages that don't have a
239
Build-Depends line. See http://buildd.debian.org/andrea and the
240
update-sourcedeps man page.
242
The update-sourcedeps script will fetch the source-dependencies-*
243
files and put them in place.
245
If you decide to use src-deps you have to keep them up to date,
246
maybe with a cron job. They change seldom enough that it doesn't
247
make sense to have sbuild update them each build.