[zeromq-dev] Debian packaging - idea for building snapshot packages

Wolfgang Barth wob at swobspace.de
Sun Apr 11 11:29:12 CEST 2010


I'm playing a little bit around with debian package building. For stable
packages I think it is a good way to build packages for Debian mainstream
releases offsite from tarball like Adrian did.

For building snapshots out of git I want to use commit ids to distinguish
between different snapshots and development progress. So what I did is:

# remove debian/changelog if modified locally -- see git status
rm debian/changelog

# new checkout changelog
git checkout -- debian/changelog

# adapt changelog to the latest commit (extracts something from git log ;-)
git-dch --auto --snapshot

# change versioning manually - remove the dash, since zeromq is an 
# native debian package (see below). It's only neccessary as long 
# the first version in changelog contains a version number like 
# 2.0.6beta.dfsg-2 including a dash

# build the package with --git-ignore-new, 
# because debian/changelog was modified
git-buildpackage --git-ignore-new --git-verbose

I get the following binary packages:

The version number ~1.gbp6fea42 reflects the snapshot version 1 and a short
commit id. For git-buildpackage I use the following config file

  builder = debuild -i -I -uc -us
  cleaner = fakeroot debian/rules clean

Really interesting is the modified changelog which contains an extract
from git log since the last found version from git:

  zeromq (2.0.6beta.dfsg2~1.gbp6fea42) unstable; urgency=low

  ** SNAPSHOT build @6fea42258348c8489d2cd64ca0e92981148134f8 **

  [ Adrian von Bidder ]
  * Much improved descriptions (thanks to Martin Lucina)
  * Rename zeromq-utils to -bin to better reflect the nature of these
  * files.

  [ Martin Lucina ]
  * Debian packaging fixes suitable for 0MQ git
  * Build fixes for Solaris and non-GNU compilers
  [... little bit truncated ...]

The version numbers for debian/changelog in git should be changed. Debian
use the following conventions:

* packages with upstream sources:
  - <upstream-version>-<debian-revision>
  - i.e. 2.0.6beta-1
  -> using a dash

* native debian packages (including the debian directory within the
  - <source-version>
  - i.e. 2.0.6beta
  -> a dash must not be included

So, the dash is correct for Adrians off-git packaging, but not for the
git itself. zeromq with a directory debian out of git is a native 
debian package.

Some hints for getting the latest snapshot from git this way (assuming the
native version numbering in debian/changelog is already solved):

debuild clean
rm -f debian/changelog
git checkout -- debian/changelog
git pull
git-dch --auto --snapshot
git-buildpackage --git-ignore-new --git-verbose

Comments and improvements always welcome ;-)

<wob (at) swobspace de> * http://www.swobspace.de

More information about the zeromq-dev mailing list