Here you will find a cheat sheet to setup a buildd for Debian. This document was written by Andreas Barth while setting up buildds for experimental and backports.org so it might not be fully consistent to the Debian setup used by the developer machines setup as autobuilders.
For buildd you can either use the buildd located at db.debian.org or extract it from wanna-build sources. If you want to use the db.debian.org version add deb http://db.debian.org debian-admin/ to sources.list and install buildd.
Additionally you will need a current debootstrap to be able to set up chroots for testing and unstable. So you might need a backport for this. You can either take it from a backports repository or just rebuild it from source yourself.
You need to create the following directories (under /org/buildd/):
install -d build mqueue -o buildd -g buildd install -d chroots -m 755 install -d logs stats -o buildd -g buildd install -d secret -o buildd -g adm -m 2770 install -d /var/debbuild/srcdep-lock -o buildd install -d /var/lib/sbuild/srcdep-lock -o buildd install -d chroots/sid/var/debbuild/srcdep-lock -o buildd install -d chroots/sid/build/buildd -m 777 install -d chroots/woody-backports/var/debbuild/srcdep-lock -o buildd install -d chroots/woody-backports/build/buildd -m 777 install -d bin -o buildd -g adm -m 775 cp /etc/passwd chroots/sid/etc/ cp /etc/passwd chroots/woody-backports/etc/ ln -s source-dependencies-unstable /etc/source-dependencies-sid-nonfree sudo ln -s source-dependencies-stable /etc/source-dependencies-woody-backports.org
And then the chroots:
sudo debootstrap --variant=buildd sid chroots/sid http://ftp.debian.org/debian sudo ln -s /org/buildd/chroots/sid/ build/chroot-unstable
And then upgrade and install packages needed:
sudo chroot chroots/sid apt-get update sudo chroot chroots/sid apt-get install fakeroot build-essential sudo debfoster sudo chroot chroots/sid debfoster
also for woody-backports:
sudo debootstrap --variant=buildd woody chroots/woody-backports http://ftp.debian.org/debian sudo ln -s /org/buildd/chroots/woody-backports/ build/chroot-woody-backports.org
Let's edit chroots/woody-backports/etc/apt/sources.list
deb http://ftp.debian.org/debian woody main non-free contrib deb-src http://ftp.debian.org/debian woody main non-free contrib deb-src ftp://linux.mathematik.tu-darmstadt.de/pub/linux/distributions/debian-backports/debian woody all
And let's upgrade and install things:
sudo chroot chroots/woody-backports apt-get update sudo chroot chroots/woody-backports apt-get install fakeroot build-essential sudo debfoster sudo chroot chroots/woody-backports debfoster
Ok, let's create the .sbuildrc:
$mailto = 'wherever you want'; $maintainer_name='what should be in changes'; $fakeroot='/usr/bin/fakeroot'; %dist_order = ( 'oldstable-security' => 0, stable => 1, 'stable-security' => 1, testing => 2, 'testing-security' => 2, unstable => 3, 'woody-backports.org' => 5, 'sarge-backports.org' => 6, experimental => 7 );
Don't forget to add the buildd user to the sudo configuration file so that it can run tools without restriction.
Ok, let's test it now: Go to ~buildd/build, and let's build a package:
sbuild -d unstable -v netpbm-nonfree_2:9.20-2 sbuild -d woody-backports.org -v arj_3.10.19-1.backports.org.1
Let's add |/usr/bin/buildd-mail-wrapper to ~buildd/.forward, so that we can answer buildds mails.
You have also to tweak ~buildd/buildd.conf - but sorry, no cheat for that, as this depends on your wanna-build.
You can obtain more information about the details of the buildd states here. You should answer the mails of the buildd either with the signed changes file, or with "give-back", "retry", "dep-wait", or "failed", or "dep-wait <dependencies>" or "failed\n<why it failed>".
You can use the following tasks as cronjobs:
@reboot touch ~buildd/NO-DAEMON-PLEASE 17 * * * * /usr/bin/buildd-watcher 47 * * * * /usr/bin/buildd-uploader