~ubuntu-branches/ubuntu/breezy/sbuild/breezy

« back to all changes in this revision

Viewing changes to debian/README.Debian

  • Committer: Bazaar Package Importer
  • Author(s): Rick Younie
  • Date: 2002-03-03 21:51:51 UTC
  • Revision ID: james.westby@ubuntu.com-20020303215151-50oderv821xp634e
Tags: 0.4
made /etc/sbuild.conf a conffile - thanks Gergely Nagy.
(Closes: #136374)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Disclaimer
 
2
==========
 
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
 
6
clarify things.
 
7
 
 
8
-------------------------------------------------------------------------
 
9
Intro
 
10
=====
 
11
sbuild is part of the wanna-build suite of programs by Roman Hodek.
 
12
cvs.linux-68k.org has more information.
 
13
 
 
14
To get wanna-build/buildd/sbuild from CVS:
 
15
 
 
16
  cvs -d :pserver:anon@cvs.linux-m68k.org:/CVS login
 
17
  [empty password]
 
18
  cvs -d :pserver:anon@cvs.linux-m68k.org:/CVS checkout wanna-build
 
19
 
 
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.
 
24
 
 
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.
 
29
 
 
30
NOTE: this package requires the sbuild user have full sudo.
 
31
  If you don't want this pbuilder might suit your needs better.
 
32
 
 
33
-------------------------------------------------------------------------
 
34
Some terms
 
35
==========
 
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.
 
39
 
 
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.
 
44
 
 
45
-------------------------------------------------------------------------
 
46
I.   modifications in the base install
 
47
II.  building the chroots
 
48
III. chroot modifications that sbuild requires
 
49
 
 
50
 
 
51
I. modifications in the base install
 
52
====================================
 
53
 
 
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.
 
56
 
 
57
(# is the root prompt, $ the user prompt.)
 
58
 
 
59
1. add the sbuild user to the group
 
60
 
 
61
    # adduser USER sbuild
 
62
 
 
63
    (or # vigr and manually edit)
 
64
 
 
65
2. add the sbuild user to sudoers
 
66
 
 
67
    # visudo
 
68
 
 
69
    add the following line:
 
70
    USER    ALL=(ALL) NOPASSWD: ALL
 
71
 
 
72
    (change USER to the user's login)
 
73
 
 
74
3. add chroot proc entries to fstab, in base
 
75
 
 
76
    # vi /etc/fstab
 
77
    none   /usr/local/chroot/DIST/proc   proc    defaults    0       0
 
78
 
 
79
    You'll need an fstab entry for each chroot of course.
 
80
 
 
81
4. setup user's home directory
 
82
 
 
83
    $ cp /usr/share/doc/sbuild/configs/example.sbuildrc ~/.sbuildrc
 
84
 
 
85
    change the "mailto" and "maintainer_name" values to your own.
 
86
    You'll be mailed the build logs.
 
87
 
 
88
    $ mkdir ~/logs          # for the build logs
 
89
    $ mkdir ~/build         # the build directory
 
90
    $ cd ~/build
 
91
    $ ln -s /usr/local/chroot/stable chroot-stable  # chroot symlinks
 
92
    $ ln -s /usr/local/chroot/unstable chroot-unstable
 
93
 
 
94
 
 
95
II. Building the chroots
 
96
========================
 
97
 
 
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.
 
101
 
 
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.
 
106
 
 
107
 
 
108
III. chroot modifications
 
109
=========================
 
110
 
 
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.
 
116
 
 
117
Once the chroots are set up you need to do the following:
 
118
(again DIST={stable,unstable}, USER = the sbuild user's login.)
 
119
 
 
120
1. add a build directory for each user in each chroot
 
121
 
 
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
 
126
 
 
127
2. add a lockdir for sbuild, each chroot
 
128
 
 
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
 
132
 
 
133
3. add some config files, each chroot (this list could very likely
 
134
   be trimmed down)
 
135
 
 
136
    # cd /usr/local/chroot/DIST
 
137
    # cp \
 
138
        /etc/fstab \
 
139
        /etc/group \
 
140
        /etc/host.conf \
 
141
        /etc/hostname \
 
142
        /etc/hosts \
 
143
        /etc/hosts.allow \
 
144
        /etc/hosts.deny \
 
145
        /etc/mailname \
 
146
        /etc/nsswitch.conf \
 
147
        /etc/passwd \
 
148
        /etc/resolv.conf \
 
149
        /etc/services \
 
150
        /etc/shadow \
 
151
        /etc/sudoers \
 
152
        /etc/timezone \
 
153
        etc/
 
154
 
 
155
 
 
156
That should be it.
 
157
 
 
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
 
160
alias,
 
161
 
 
162
  alias sbu='cd ~/build && sbuild -v -D -d unstable -p successful'
 
163
 
 
164
This should build ed (if 0.2-19 is the current version) and mail
 
165
you the log:
 
166
 
 
167
$ cd ~/build
 
168
$ sbuild -v -D -d unstable -p successful ed_0.2-19
 
169
 
 
170
Now try something that has build-dependencies. :-)
 
171
 
 
172
---------------------------------------------------------------------------
 
173
Problems
 
174
========
 
175
 
 
176
"Can't create lock file ..."
 
177
You've probably not been added to the sbuild group.  Remember
 
178
to log out/in.
 
179
 
 
180
Permission problems are usually the result of altering the base
 
181
/etc files and not copying them to the chroots.
 
182
 
 
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
 
186
    non-interactive
 
187
    critical
 
188
    no
 
189
 
 
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
 
193
fixchroot script.
 
194
 
 
195
---------------------------------------------------------------------------
 
196
utilities
 
197
=========
 
198
 
 
199
# dpkg --root=/where/your/chroot/is
 
200
    - this roots dpkg in the chroot so you can use it from base
 
201
 
 
202
Also see bin/ in sbuild's doc directory for some useful utilities.
 
203
Probably the most interesting:
 
204
 
 
205
$ chrootapt | chrapt
 
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.
 
211
 
 
212
$ deborphan -f /usr/local/chroot/unstable/var/lib/dpkg/status -a 
 
213
    - helps you keep a minimal chroot; shows the packages that no
 
214
    others depend on.
 
215
 
 
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
 
218
works in progress.
 
219
 
 
220
---------------------------------------------------------------------------
 
221
Odds and Ends
 
222
=============
 
223
 
 
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:
 
228
 
 
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}
 
232
 
 
233
More info in the avg-pkg-build-time man page.
 
234
 
 
235
 
 
236
src-deps
 
237
--------
 
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.
 
241
 
 
242
The update-sourcedeps script will fetch the source-dependencies-*
 
243
files and put them in place.
 
244
 
 
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.
 
248
 
 
249
 
 
250
 
 
251
 
 
252
 
 
253
 
 
254
# vim:et