Matt's Musings

October 26, 2005

Lightweight Debian Archive Scripts

Filed under: Debian — matt @ 11:09 pm NZST

Update – 21 Jun 2006: This post just featured in DWN even though its hardly fresh news! I’ve since updated the scripts to use reprepro, so I would highly recommend you read the updated post. The remainder of this page exists only for historical interest!


Hello Planet Debian :) ,

Steve Kemp wants a solution to magically build uploaded packages. I maintain several small Debian archives and recently needed a solution like this too. The solution needs to provide semi-automated package builds and installation. The full Debian Archive Kit (DAK) was far too heavy for my needs.

I ended up creating a couple of wrapper scripts around sbuild and debarchiver to achieve this. The basic flow of packages through my archives goes like this:

  1. Packages uploaded to an incoming directory (/home/sbuild/incoming/<dist_name>)
  2. process_packages script scans incoming directory for each dist every minute and spawns builds (via sbuild) as necessary
  3. Once packages are built site admin is emailed build logs
  4. Admin checks packages and runs add-packages to add the packages to the archive
  5. add-packages invokes debarchiver to do the heavy lifting and then generates the release files.

There is no support for GPG signed packages at this stage, hence the manual check before packages are added to the archive. The scripts were a quick hack a few months ago, and I’ve just hacked them again to pull all the site specific stuff out into easily modifiable variables at the top of the scripts, so hopefully I haven’t introduced any syntax errors! You will need correctly configured sbuild and debarchiver setups prior to running these scripts.

If you want to use them, feel free, I’d love to know if they are useful to anyone but me. If there is some interest I’d be happy to tidy them up, package them properly and maintain them.

Get them from:
http://www.mattb.net.nz/debian/misc/process_packages
http://www.mattb.net.nz/debian/misc/add-packages

I run process_packages from cron with an entry like

*/1 * * * * sbuild /home/sbuild/bin/process_packages &>/dev/null

My /home/sbuild layout looks like

drwxr-xr-x 2 root sbuild 4.0K Jul 31 11:16 bin
drwxr-xr-x 2 sbuild sbuild 12K Oct 26 16:32 build
drwxr-xr-x 6 root root 4.0K Sep 14 12:38 chroots
drwxr-xr-x 4 sbuild sbuild 4.0K Jul 13 09:59 incoming
drwxr-xr-x 2 sbuild sbuild 24K Oct 26 16:31 logs

bin contains the scripts, build contains symlinks to the chroots, and is used as the directory to invoke sbuild from. The resulting .debs are also placed in build. chroots contains the actual distribution chroots, incoming holds a directory for each distribution to process and is scanned by process_packages. logs contains a dump of all the sbuild logs. Debarchiver should be configured to pick up packages out of the build directory.

Let me know if I need to provide more details.

2 Comments

  1. For the archive I realy suggest using reprepro. It does not include incoming processing but everything else. You just point it to a changes file and tell it what distribution to put it under and the rest is automatic, including Release.gpg files.

    Reprepro can also pull in sources and debs from multiple sources and mix them all up (or keep them in seperate distributions). With that you can easily mix in your local partial debian mirror next to the local archive all with the one software.

    The configuration is trivial, a small RFC822 text file for what the repository carries and another smaller one for source to fetch from.

    Once you have the archive I suggest running wanna-build, buildd and sbuild. If you want to test out packages before uploading them it is best to test them on the same build system. If w-b+buildd is too complicated for you I still have the amd64 archive scripts on alioth which do a simpler job in shell.

    MfG
    Goswin

    Comment by Goswin von Brederlow — October 27, 2005 @ 4:15 am

  2. Thanks a lot for sharing those – they’re almost exactly what I was looking for!

    The scanning and building I can use as-is, although what I want to do with the built packages differs so I’ll have to code that part up myself.

    Comment by Steve Kemp — October 27, 2005 @ 7:46 am

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress