Using Pbuilder

Since pbuilder use different command line arguments than Debuild and Dpkg-buildpackage we have to use a small script that's invoked by git-buildpackage:

cat <<EOF >/usr/local/bin/git-pbuilder
#!/bin/sh
# pass all options to dpkg-buildpackage:
pdebuild --debbuildopts "$*"
EOF
chmod a+x /usr/local/bin/git-pbuilder
Furthermore we need a different clean command, since pdebuild clean means something different than debuild clean. We could put all this on the command line, but let's put it into the config file to safe typing:
cat <<EOF > ~/.gbp.conf
[DEFAULT]
# tell git-buildpackage howto clean the source tree
cleaner = fakeroot debian/rules clean
# this is how we invoke pbuilder, arguments passed to git-buildpackage will be
# passed to dpkg-buildpackge in the chroot
builder = /usr/local/bin/git-pbuilder
Invoking git-buildpackage will now invoke pdebuild

If you don't want this for all your invocations of git-buildpackage you can instead put this into .git/gbp.conf in one of your Git repositories.