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

Initialize cowbuilder:

git-pbuilder create

Optionally update cowbuilder:

git-pbuilder update

Clone the repository:

git clone git@github.com:Yubico/yubikey-personalization-dpkg.git

Build the package:

git checkout debian
gbp buildpackage --git-pbuilder --git-pbuilder-options=--twice

If all goes well, you should have newly built packages in ../.

To merge in a new upstream version do:

git remote add yubico git@github.com:Yubico/yubikey-personalization.git
git pull yubico
git checkout master
git merge <tag-of-the-new-release>
git checkout debian
git merge master
# update debian/ files and commit as appropriate

Preserve the upstream tarball:

cp ../path/to/ykpers-X.Y.Z.tar.gz yubikey-personalization_X.Y.Z.orig.tar.gz
pristine-tar commit yubikey-personalization_X.Y.Z.orig.tar.gz master

---OLD notes below for historic reasons (remove on 2016-01-01)

The recommended way to get the git repo of this package is to clone
the git repository and then use gitpkg(1).

For gitpkg to do its work best, you should have the following settings
in .git/config:

[gitpkg]
	deb-export-hook = /usr/share/gitpkg/hooks/quilt-patches-deb-export-hook
	pre-export-hook = /usr/share/gitpkg/hooks/pristine-tar-pre-export-hook
        create-fake-orig = false
        force-overwrite-orig = false

After you have hacked on the source and committed, run gitpkg HEAD (or
gitpkg $treeish) and you get a source package in
../deb-packages/yubikey-personalization/.

Example initial checkout:

git clone git@github.com:Yubico/yubikey-personalization-dpkg.git
cd yubikey-personalization-dpkg
git config gitpkg.deb-export-hook /usr/share/gitpkg/hooks/quilt-patches-deb-export-hook
git config gitpkg.pre-export-hook /usr/share/gitpkg/hooks/pristine-tar-pre-export-hook
git config gitpkg.create-fake-orig false
git config gitpkg.force-overwrite-orig false

To merge in a new upstream version do:

git remote add yubico git@github.com:Yubico/yubikey-personalization.git
git pull yubico
git checkout master
git merge <tag-of-the-new-release>
git checkout debian
git merge master
# update debian/ files and commit as appropriate
git tag -s -m "yubikey-personalization-dpkg X.Y.Z-L" debian/X.Y.Z-L

Preserve the upstream tarball:

cp ../path/to/ykpers-X.Y.Z.tar.gz yubikey-personalization_X.Y.Z.orig.tar.gz
pristine-tar commit yubikey-personalization_X.Y.Z.orig.tar.gz master

To build the package you first initialize cowbuilder, for example:

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

Optionally update cowbuilder:

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

Build the package:

gitpkg HEAD
cd ../deb-packages/yubikey-personalization/yubikey-personalization-$VER/
pdebuild --auto-debsign --pbuilder cowbuilder -- --twice --basepath /var/cache/pbuilder/base-debian-sid.cow

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

 -- Tollef Fog Heen <tfheen@debian.org>, Fri,  9 Dec 2011 23:24:53 +0100
 -- Simon Josefsson <simon@josefsson.org>, Thu, 04 Apr 2013 09:03:50 +0200
