Debian Packaging - Introduction
Esteban Manchado Velázquez <>


What is packaging?

On versions (small digression)

Types of packages: standard (non-native)

Types of packages: native packages

Some interesting packaging files

Sample debian/control

Source: memcached
Section: web
Priority: optional
Maintainer: Esteban Manchado Velázquez <>
Build-Depends: debhelper (>= 4.0.0), libevent-dev-patched (>= 1.4.0)

Package: memcached-patched
Architecture: any
Depends: ${shlibs:Depends}, perl
Conflicts: memcached
Replaces: memcached
Provides: memcached
Suggests: libcache-memcached-perl
Description: High-performance memory object caching system
 Danga Interactive developed memcached to enhance the speed of,
 yadda, yadda...
One Source section, one or more Package sections.

Sample debian/rules

Too long to show here, but...

build: build-stamp

build-stamp:  config.status
        touch build-stamp


install: build
        dh_clean -k

        # Add here commands to install the package into debian/memcached-patched
        $(MAKE) install DESTDIR=$(CURDIR)/debian/$(PACKAGE)

Long story short, you compile and install the software under debian/PACKAGENAME, like debian/memcached-patched/usr/bin/memcached and so on...

Sample debian/changelog

memcached (1.2.5-4) unstable; urgency=low

  * Add Replaces: memcached
  * Remake the package, using "proper" patches in debian/patches.

 -- Esteban Manchado Velázquez (Debian packaging) <>  Fri, 27 Jun 2008 09:58:47 +0000

memcached (1.2.5-3) unstable; urgency=low

  * Init script is now copied correctly

 -- Cosimo Streppone <>  Thu, 19 Jun 2008 14:26:00 +0200

[... More crap ...]
This file has a format! Use dch to edit it!

How to compile a package

/usr/src/String-Diff-0.03$ ls
blib         Changes  inc            lib       Makefile.PL  META.yml    README
build-stamp  debian   install-stamp  Makefile  MANIFEST     pm_to_blib  t

/usr/src/String-Diff-0.03$ egrep Source debian/control
Source: libstring-diff-perl

/usr/src/String-Diff-0.03$ egrep Package debian/control
Package: libstring-diff-perl

/usr/src/String-Diff-0.03$ ls ../libstring-diff-perl*

/usr/src/String-Diff-0.03$ debuild
[...lots of crap...]

/usr/src/String-Diff-0.03$ ls ../libstring-diff-perl*
Several files created. Most important are *.deb and *.diff.gz.

Compilation results explained

The "source package" is actually three files: *.orig.tar.gz, *.diff.gz and *.dsc.


Picture credits


Takk. Spørsmål?