Andrea Veri's Blog Me, myself and I

Building Debian packages with Deb-o-Matic

Today I’ll be telling you about an interesting way to build your Debian packages using Deb-o-Matic, a tool developed and maintained by Luca Falavigna. Some more details about this tool from the package’s description:

Deb-o-Matic is an easy to use build machine for Debian source packages based on pbuilder, written in Python.

It provides a simple tool to automate build of source packages with limited user interaction and a simple configuration. It has some useful features such as automatic update of pbuilder, automatic scan and selection of source packages to build and modules support.

The setup.

Download the package.

apt-get install debomatic

Modify the main configuration file as follows:

builder: pbuilder
packagedir: /home/john/debomatic # Take note of the following path since we'll need it for later use.
configdir: /etc/debomatic/distributions
pbuilderhooks: /usr/share/debomatic/pbuilderhooks
maxbuilds: 3 # The number of builds you can perform at the same time.
inotify: 1
sleep: 60 # The sleep time between one build and another.
logfile: /var/log/debomatic.log

gpg: 0 # Change to 1 if you want Deb-O-Matic to check the GPG signature of the uploaded packages.
keyring: /etc/debomatic/debomatic.gpg # Add the GPG Keys you want Deb-O-Matic to accept in this keyring.

modules: 1 # A list of all the available modules will follow right after.
modulespath: /usr/share/debomatic/modules

alwaysupdate: unstable experimental precise
modulesblacklist: Lintian Mailer
mapper: {'sid': 'unstable',
'wheezy': 'testing',
'squeeze': 'stable'}

lintopts: -i -I -E --pedantic # Run Lintian in Pedantic mode.

[mailer] # You need an SMTP server running on your machine for the mailer to work. You can have a look at the 'Ssmtp' daemon which is a one-minute-setup MTA, check an example over <a href="" target="_blank">here</a>.
fromaddr: debomatic@localhost
smtphost: localhost
smtpport: 25
authrequired: 0
smtpuser: user
smtppass: pass
success: /etc/debomatic/mailer/build_success.mail-template # Update the build success or failure mails as you wish by modifying the relevant files.
failure: /etc/debomatic/mailer/build_failure.mail-template

configversion = 010a

The available modules are:

  1.  “Contents“, which acts as a ‘dpkg -c’ over the built packages.
  2. DateStamp“, which displays build start and finish times into a file in the build directory.
  3. Lintian“, which stores Lintian output on top of the built package in the pool directory.
  4. Mailer“, which sends a reply to the uploader once the build has finished.
  5. PrevBuildCleaner“, which deletes all files generated by the previous build.
  6. Repository“, which generates a local repository of built packages.

Configure ‘dput‘ to upload package’s sources to your local repository, edit the /etc/ file and add this entry:

method = local
incoming = /home/john/debomatic

or the following if you are going to upload the files to a different machine through SSH:

login = john
fqdn =
method = scp
incoming = /debomatic

Add a new Virtual Host on Apache and access the repository / built packages directly through your browser:

<VirtualHost *:80>

DocumentRoot /home/john/debomatic

<Directory /home/john/debomatic>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all


Start the daemon:

sudo /etc/init.d/debomatic start

(Optional) Add your repository to APT‘s sources.list:

deb unstable main contrib non-free

(Optional) Start Deb-O-Matic at system’s startup by modifying the /etc/init.d/debomatic file at line 21:

- [ -x "$DAEMON" ] || exit 0
- [ "$DEBOMATIC_AUTOSTART" = 0 ] && exit 0

+ [ -x "$DAEMON" ] || exit 0
+ [ "$DEBOMATIC_AUTOSTART" = 1 ] && exit 0

and finally add it to the desired runlevels:

update-rc.d debomatic defaults