Sunday, 21 June 2009

Debian packaging workflow 2

Update (2009-06-25): I have moved this workflow to a static page. What appears below should be considered obsolete.

I have made some refinements to the SkinnyDebbie packaging workflow.

File Structure


{package-root} is {someplace-convenient}/{package-name}, where {package-name} is the name of the package without version or platform info. For example, if {package-name} is foobar, {package-root} might be:


The {package-root} structure

+ {package-root}
    + debian
        + DEBIAN
        + {mirror-of-file-system-with-binaries-etc}
    + docs
        + man
            + man[1-9] ...



This is just a wrapper for the whole shebang. This structure (with DEBIAN and {mirror-of-file-system-with-binaries-etc} directories inside) attempts to be consistent with the regular Debian build process.


Contains documentation in a centralized location to make it easier to maintain. The stuff here is copied into {package-root}/debian as needed by (see below).


Man files for the package go here in plaintext. /docs/man/man1 has {whatever}.1 man files, /docs/man/man8 has {whatever}.8 man files, etc. Man files are required by Debian policy for anything in /usr/bin or /usr/sbin.


Changelog for the release in plaintext, formatted according to Debian policy requirements. According to my reading of the official Debian policy, this file should actually be called “changelog” since the upstream and package maintainers are the same and therefore share a changelog, but I can’t get a clean lintian check whithout naming the the version that appears in the final package “changelog.Debian.gz”. The changelog file is required by Debian policy.


Copyright info in plaintext, formatted according to Debian policy requirements. The copyright file is required by Debian policy.


The big fun. The file does the actual building of the package. It will copy over the documentation files (above) into the right places in the right form in /debian/DEBIAN/{mirror-of-file-system-with-binaries-etc} and then make the package. Note that by using fakeroot the package files can be owned and the build executed by user. In other words, sudo is not required.

A copy of used to make the skinny-xdm-beautify can be had here. In its present form, you will have to hand-tweak the PACKAGENAME variable as well as the names and places of the manpages.

The process

1 ) Build the package:

cd {package-root}

2 ) Test the package:

lintian {name-of-package-file}


lintian foobar_0.9.0-2_all.deb

3 ) Copy the new package to {local-repository}/binary and delete the old version.

4 ) Recreate the Packages.gz file for the repository. Example:

cd {local-repository}
dpkg-scanpackages binary /dev/null | gzip -9c >> binary/Packages.gz

5 ) Upload/sync changes to the online repository. Example: