Daria Morgendorffer
Anton Salikhmetov codedot
Previous Entry Share Next Entry
Local Debian Autobuilder
The below steps are to set up a local Debian auto-building system similar to that of Launchpad PPA. Within the steps, it is supposed that a local Debian repository has been already configured as written before.

1 Install `rebuildd', `pbuilder', and `devscripts' packages.

2 Edit /etc/default/rebuildd configuration as follows:
START_REBUILDD=1
DISTS="lenny"
3 Run `sudo rebuildd-init-build-system' and `sudo rebuildd init' to initialize the `pbuilder' chroot environent and `rebuildd' database, respectively.

4 Add the local repository to /etc/apt/sources.list on the host machine (`deb-src http://localhost/debian codedot main').

5 Create /var/www/debian/bin/{addjobs,getsrc,putres} scripts with mode 755 as follows:

#!/bin/sh
# addjobs

action=$1 release=lenny package=$3 version=$4 changes=$5 priority=1

# Check if a source package accepted
[ "$action" != "accepted" ] && exit 0
echo "$changes" | grep -q "_source\.changes" || exit 0

# Queue build of the package
echo "$package $version $priority $release" | \
    /usr/sbin/rebuildd-job add

#!/bin/sh
# getsrc

d=$1 p=$2 v=$3

apt-get -q update

apt-get -q --download-only -t ${d} source ${p}=${v}

#!/bin/sh
# putres

d=$1 p=$2 v=$3 a=$4

changes=/var/cache/pbuilder/result/${p}_${v}_${a}.changes

debsign $changes
dput local $changes


6 Edit /etc/rebuildd/rebuilddrc configuration as follows:
source_cmd = /var/www/debian/bin/getsrc ${d} ${p} ${v}
post_build_cmd = /var/www/debian/bin/putres ${d} ${p} ${v} ${a}
build_cmd = pbuilder build --debbuildopts -b --basetgz /var/cache/pbuilder/${d}-${a}.tgz ${p}_${v}.dsc
7 Append /var/www/debian/conf/distributions with two lines:
Log: logfile
 --changes /var/www/debian/bin/addjobs
8 Create /var/lib/pbuilder/hooks/D50update script with mode 755 as follows:
#!/bin/sh

/usr/bin/apt-get update
9 Run the command `pbuilder --update --basetgz /var/cache/pbuilder/lenny-*.tgz --override-config --othermirror "deb http://localhost/debian codedot main|deb-src http://localhost/debian codedot main"'.

10 Start `rebuildd' service: `sudo /etc/init.d/rebuildd start'.

After the above steps have been done, new source packages uploaded into the local repository (e.g. using `dput local *.change' command) will be automatically built by the system, and resulting binary packages if succeeded will be uploaded into the repository as well.

You are viewing codedot