#!/bin/sh
set -e
# pass commandline arguments to dpkg-buildpackage
# set -x
#pdebuild --debbuildopts "-i\.git -I.git $*"

cat > ~/.pbuilderrc <<EOT
AUTO_DEBSIGN=yes
PKGNAME_LOGFILE=yes
# BUILDRESULT=$BUILDDIR
HOOKDIR=/home/tillea/.pbuilder
EOT

/usr/bin/pdebuild --pbuilder cowbuilder --buildresult `dirname \$PWD` --debbuildopts "-i\.git -I.git $*" --debsign-k "Andreas Tille <tille@debian.org>"
rm ../*_source.changes
lintian -i ../`dpkg-parsechangelog | awk '/^Source:/ {print $2}'`_`dpkg-parsechangelog | awk '/^Version:/ {print $2}'`_*.changes
