Lightweight Debian Archive Scripts
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:
- Packages uploaded to an incoming directory (/home/sbuild/incoming/<dist_name>)
- process_packages script scans incoming directory for each dist every minute and spawns builds (via sbuild) as necessary
- Once packages are built site admin is emailed build logs
- Admin checks packages and runs add-packages to add the packages to the archive
- 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.