Matt Brown: Lightweight Debian Archive Scripts
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:
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
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.
- 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.
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.
Congratulations, you got 10/10 correct!
