Falcon Repository Manager

Package building

If you read this documentation in the order in which they appear on the website, you now know that falcon is excellent at handling packages once they're fully built. Building the packages is still manual work though, but it does not have to be! Debian has several build daemon programs, such as pbuilder and sbuild, which help automating the build process. Falcon can use these as backends for its build orchestration routines, so falcon is not yet another package build system, but a build orchestration system.

Configuring builders

I use pbuilder myself so here is how I rigged pbuilder to work smoothly with falcon. If you use sbuild or cowbuilder and want to help me, send in examples for those!
pbuilder
Installing pbuilder is easy, simply use sudo apt-get install pbuilder Setting it up to easily build for multiple pockets is slightly more difficult, but a one-time operation. Choose a root for all your build operations, eg /srv/pbuilder Then create the file /srv/pbuilder/build.sh with the following contents:
#!/bin/bash
# Wrapper around pbuilder for easy building for multiple distributions
# Make symlinks to this file called gutsy-build.sh etc...

# We need to be root
if [ $UID -ne 0 ]; then
    exec sudo "$0" "$@"
fi

# Change this to your build root if this script isn't in there
BUILDROOT=`dirname $0`
DISTRIBUTION=`basename $0`
DISTRIBUTION=${DISTRIBUTION/-build.sh/}

# Replace this with your origin value
DISTRIBUTION=${DISTRIBUTION/-seveas/}
ACTION=$1
shift

exec pbuilder $ACTION \
    --distribution $DISTRIBUTION \
    --aptconfdir "$BUILDROOT/apt-$DISTRIBUTION" \
    --basetgz "$BUILDROOT/base-$DISTRIBUTION.tgz" \
    "$@"
Configuration tips for /etc/pbuilderrc:

Then create /srv/pbuilder/apt-dapper etc (one for each version you want to build for). Copy /etc/apt/trusted.gpg and /etc/apt/trustdb.gpg into these folders. Put a file called apt.conf into these folders with the contents: APT::Get::AllowUnauthenticated 1; and write a sources.list that contains at least the official repos (Ubuntu's or Debian's) and if you want, also your own repository.

Then make symlinks to /srv/pbuilder/build.sh named /srv/pbuilder/feisty-build.sh and so on. And your pbuilder is ready to go. Create your pbuilder bases with /srv/pbuilder/feisty-build.sh create and so on. To avoid having to type your sudo password for using pbuilder, add this at the bottom of /etc/sudoers with visudo

dennis ALL=(ALL) NOPASSWD: /srv/pbuilder/*build.sh
This is required for automatic builds since the cronjob runs as your normal user. Of course, replace dennis with your username.

Setting up an rsync daemon

Falcon can upload over ssh and rsync, rsync is safer since it doesn't involve having a private key available that needs to be passwordless if you want to upload from cron. Simply install rsync and put these two modules in /etc/rsyncd.conf (don't forget to enable the rsync daemon in /etc/default/rsync and start the daemon).
[incoming]
comment=Pbuilder incoming
path=/srv/pbuilder/incoming
read only=false
hosts allow=83.160.7.26

[result]
comment=Pbuilder result
path=/srv/pbuilder/result
read only=true
hosts allow=83.160.7.26
Of course you have to replace 83.160.7.26 with the IP adress of your main builder.

Setting up falcon

Remote builders
The build daemons don't need a complete falcon installation, just the file /usr/bin/falcon-build-local-queue and a small bit of configuration. Simply copy over the falcon-build-local-queue from your main builder and create the file ~/.falcon/buildconf with the following contents:
origin       = Seveas
incoming     = /srv/pbuilder/incoming
result       = /srv/pbuilder/result
buildcommand = /srv/pbuilder/%(pocket)s-build.sh build %(dsc)s
The value of origin should be the same as what you configured on yout main repository machine and incoming and result should correspond to what the pbuilder wrapper is expecting. The build command in here is using the pbuilder wrapper we set up earlier.
The main builder
falcon-build-local-queue will build everything in its incoming directory and put the results in its result directory. That's not too exciting, but the best bit is done on the main archive machine. Launch the configuration editor and go to the building section. Here you add all the remote builders and falcon will coordinate all builds on those machines. Select a builder or create a new one.

Builder configuration

You need at least one builder that builds the Arch: all packages, otherwise falcon will complain. Falcon should now what to do with each builder, where to upload and download files and how to build the packages. If you tell falcon a buildcommand, it will connect via ssh and run this command, so you don't need the falcon-build-local-queue on the remote host. If you do not give falcon a buildcommand, it will only upload and download, requiring you to run falcon-build-local-queue on the remote machine.
Build commands
The build command can contain a few strings that will be replaced. The build command I use is /srv/pbuilder/%(pocket)s-build.sh build %(dsc)s The following replacements are made:

Using the build system

Now the hard work is done, you can use the build system manually and automatically. To manually build a package on all builders, use the command falcon build filename.dsc. This will queue all the builds and will run the ones it can run. To check for completion of pending builds, run falcon-build-queue -c and look in .falcon/build/ for the resulting packages. For more automation, read the automation docs.
Generated by Falcon 2.0.5 ©2005-2008 Dennis Kaarsemaker