LongoMatch:The Digital Coach

How-To:Packaging for Debian-like systems

Posted on: enero 15, 2009


Debian-like systems use APT, a free user interface that works with core libraries to handle installing software on Linux. Apt can be functionally considered to be a front-end to dpkg. While dpkg performs actions on individual packages, apt tools manage relations (especially dependencies) between them, as well as sourcing and management of higher-level versioning decisions (release tracking and version pinning).

For this guide I supose that your project uses the autotools buid system. That’s why I will use CDBS which is a tool that uses debhelper to make building and maintaining Debian packages even easier. It has many advantages:

  • It produces a short, readable, and efficient debian/rules.
  • It automates debhelper and autotools for you, so you do not have to worry about repetitive tasks.
  • It helps you focus on more important packaging problems, because it helps without limiting customization.
  • Its classes have been well tested, so you can avoid dirty hacks to solve common problems.
  • Switching to CDBS is easy.
  • It is extensible.

Configuration Files

The files needed to create .deb package are stored in the project’s  root directory with the following structure:
  • debian/changelog
  • debian/control
  • debian/copyright
  • debian/rules


The changelog file is, as its name implies, a listing of the changes made in each version. It has a specific format that gives the package name, version, distribution, changes, and who made the changes at a given time.

The first line includes the package’s name (longomatch) and the package’s version (0.9.1-1hardy1) followed by the distribution’s name (hardy)

The changelog for the longomatch package:

longomatch (0.9.1-1hardy1) hardy; urgency=low
   *Improved video editor
   *Added templates support
   *Added internationalization support

— Andoni Morales Alastruey Tue, 18 Nov 2008 23:50:00 +0200


The control file contains the information that the package manager (such as apt-get, synaptic, and adept) uses, build-time dependencies, maintainer information, and much more.

For the longomatch package, the control file looks something like:

Source: longomatch
Section: devel
Priority: extra
Maintainer: Andoni Morales Alastruey <my@mail.com>
Build-Depends: debhelper (>= 5), autotools-dev, cdbs, pkg-config, mono-gmcs,libdb4o6.0-cil, libgtk2.0-cil,libgstreamer0.10-dev, libgstreamer-plugins-base0.10-dev, libgtk2.0-dev, libmono2.0-cil, libmono-cairo2.0-cil
Standards-Version: 3.7.2
Package: longomatch
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, mono-runtime, ffmpeg, mencoder
Description: LongoMatch:The Digital Coach
Sports video analyze tool for coaches
and trainers to assist them  on making live video reports
from a match. It creates a database with the most
important plays of a game, grouped by categories, to easily
access them and to create play lists and new videos from the
selected plays.


This file gives the copyright information. Generally, copyright information is found in the COPYING file in the program’s source directory. This file should include such information as the names of the author and the packager, the URL from which the source came, a Copyright line with the year and copyright holder, and the text of the copyright itself. LongoMatch includes the following copyright file:

This package was debianized by Andoni Morales Alastruey <my@mail.com> on
Tue, 02 Sep 2008 03:04:08 +0200.
Upstream Author(s):
Andoni Morales Alastruey <my@mail.com>
Copyright (C) 2008 Andoni Morales Alastruey <my@mail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
The Debian packaging is (C) 2008, Andoni Morales Alastruey <ylatuya@gmail.com> and
is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.


The last file we need to look at is rules. This does all the work for creating our package. It is a Makefile with targets to compile and install the application, then create the .deb file from the installed files. It also has a target to clean up all the build files so you end up with just a source package again. CDBS is a set of Makefile includes that uses debhelper to make building and maintaining Debian packages even easier. It uses advanced features of Makefiles to abstract the build process, so rules files end up primarily as a series of include statements. The final rules file using CDBS looks like this:

#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

As you can see the rules configuration files is very simple. CDBS scripts delegate all the work to autotools.

Creating the binaries package

The next step is to build the binaries package and the sources packages which are built calling the following commands in the ./debian directory:

# debuild -b (to build the binaries package)

# debuild -S (to build the sources packages)

debuild will parse all the previous files and will create a .deb package


4 comentarios to "How-To:Packaging for Debian-like systems"

I’m truly enjoying the design and layout of your blog. It’s a very
easy on the eyes which makes it much more pleasant for me
to come here and visit more often. Did you hire out a developer to
create your theme? Excellent work!

The Iphone 4s is one of the best – at least until the next great application comes out tomorrow!
Contact and share all the app development requirement.
326 pixels per inch.

This is a good question, which I love, but the iphone continues to derives its real power in usability.

Hey There. I discovered your blog the use of msn.
This is an extremely smartly written article.
I will make sure to bookmark it and come
back to learn extra of your useful info. Thank you for the post.

I will definitely return.


Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión /  Cambiar )

Google photo

Estás comentando usando tu cuenta de Google. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )

Conectando a %s

Descripción del proyecto

LongoMatch es un proyecto de Software Libre que proporciona una serie de herramientas para el análisis por vídeo. Está enfocado al deporte y ayuda a entrenadores y ténicos a realizar estudios de acciones a través del vídeo, permitiendo localizar y agrupar por categorías diferentes segmentos de una grabación para facilitar su posterior análisis. Su uso puede llegar a ser más genérico, pudiendo ser utilizado para realizar resúmenes de conferencias, estudios de películas o cualquier actividad que consista en localizar y estudiar partes concretas de una grabación. Para más información, visitad la página web del proyecto: www.ylatuya.es
A %d blogueros les gusta esto: