The Basics of Debian Packaging

James D. Barrett

jadoba@jadoba.net

Introduction

Read, read, and then read some more

  • Debian Policy Manual (package: debian-policy)
  • Debian New Maintainer's Guide (package: maint-guide)
  • Debian Developer's Reference (package: developers-reference)
  • FHS (http://www.pathname.com/fhs/)
  • Other applicable policies (webapp, database, etc.)
  • Read the source code of the upstream
  • Read all of the software documentation

The software you wish to package...

  • Is the work already done for you?
  • Use it yourself
  • Know it inside and out
  • Sign up for bug reports and announcements
  • Submit an ITP and contact the upstream developer

Initial Debianization

  • Install pertinent packages:
    # apt-get update
    # apt-get install debhelper po-debconf dpatch fakeroot build-essential
  • Start Debianization:
    $ cd ~/ && mkdir debian && cd debian && wget http://...
    $ tar xvzf phplist-2.10.4.tgz && cd phplist-2.10.4
    $ dh_make -e jadoba@jadoba.net -f ../phplist-2.10.4.tgz
  • dh_make will create a new directory called debian

~/debian/phplist-2.10.4/debian/

  • Files of interest here:
    • Required: changelog, control, copyright, rules
    • Other files/directories, some of which I added:
      admin.htaccess, apache.conf
      compat
      docs, examples/, README.Debian
      dirs, files, install
      phplist.1, phplist.config, phplist.examples, phplist.links, phplist.manpages
      phplist.postinst, phplist.postrm, phplist.postrm.debhelper, phplist.substvars,
      phplist.templates, po/
    • Added by dpkg-buildpackage:
      patched/, patches/
      phplist/

Build it; lintian and linda; test it

  • $ cd ~/debian/phplist-2.10.4 && dpkg-buildpackage -rfakeroot -D
  • Initial testing with lintian and linda
  • Set up a local repository
  • VMware, Xen, QEMU, etc
  • pbuilder - chroot environment for testing

You might get stuck...

  • debian-mentors mailing list - gold mine
  • Anther similar package's diff.gz - diamond mine
  • Google - copper mine?
  • Re-read the policy if you have time...

In conclusion...

  • Read until your eyes fall out
  • Know the upstream
  • Packaging is pretty straighforward
  • Test.
  • A lot of programs can be made into a debian package

More info...

Thanks for listening! For further reading...

Debian Policy Manual, Debian New Maintainer's Guide, PHP Policy Draft, Debian Developer's Corner
To find a package in google: 'packagename site:packages.debian.org' - useful for finding reverse-dependencies, build-dependencies and the such
[any material that should appear in print but not on the slide]