We describe here one way to work with the package sources.

Initialize cowbuilder, for Debian sid:

sudo cowbuilder --create --distribution sid --mirror ftp://ftp.se.debian.org/debian/ --debootstrapopts "--keyring=/usr/share/keyrings/debian-archive-keyring.gpg" --basepath /var/cache/pbuilder/sid.cow

or for Ubuntu 12.04:

sudo cowbuilder --create --distribution precise --components "main universe" --basepath /var/cache/pbuilder/precise.cow

Optionally update cowbuilder:

sudo cowbuilder --update --basepath /var/cache/pbuilder/sid.cow
sudo cowbuilder --update --basepath /var/cache/pbuilder/precise.cow

Clone the repository:

git clone git@github.com:Yubico/python-pyhsm-dpkg.git

Build the package:

git-buildpackage --git-pristine-tar --git-builder="pdebuild --auto-debsign --pbuilder cowbuilder -- --basepath /var/cache/pbuilder/sid.cow"
git-buildpackage --git-pristine-tar --git-builder="pdebuild --auto-debsign --pbuilder cowbuilder -- --basepath /var/cache/pbuilder/precise.cow"

If all goes well, you should have newly built packages in
/var/cache/pbuilder/result/.

Update the package to a new upstream release (don't forget debian/changelog):

git-import-orig --pristine-tar /path/to/new-release.tar.gz
