dev/debian-build/dbuild_release
author Paul Crowley <paul@lshift.net>
Mon, 12 Sep 2011 09:37:16 +0100
branchdebian
changeset 340 83de2f945bbe
parent 314 c02eae7665af
child 335 0d15506351db
permissions -rwxr-xr-x
Add a watch file

#!/bin/sh

set -e

cd $(hg root)

PACKAGE=$(dpkg-parsechangelog | sed -n 's/^Source: \(.*\)/\1/p')
DEBIAN_VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: \(.*\)/\1/p')
# Lazy, but hey
UPSTREAM_VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: \(.*\)-[^-]*/\1/p')
BUILDDIR=$(pwd)/build/debian

echo PACKAGE $PACKAGE
echo DEBIAN_VERSION $DEBIAN_VERSION
echo UPSTREAM_VERSION $UPSTREAM_VERSION
echo UPSTREAM $UPSTREAM
echo BUILDDIR $BUILDDIR

rm -rf ${BUILDDIR}
mkdir -p ${BUILDDIR}
hg archive -X '.hg*' -X 'dev/**' -t tgz -r release_${UPSTREAM_VERSION} \
   ${BUILDDIR}/${PACKAGE}_${UPSTREAM_VERSION}.orig.tar.gz
hg archive -X '.hg*' -X 'dev/**' -r debian_${DEBIAN_VERSION} \
   ${BUILDDIR}/${PACKAGE}-${UPSTREAM_VERSION}

cd ${BUILDDIR}/${PACKAGE}-${UPSTREAM_VERSION}
dpkg-buildpackage -kFD56DDC0
#dpkg-buildpackage
cd ..
lintian -i --pedantic -IE ${PACKAGE}_${DEBIAN_VERSION}_*.changes
sudo pbuilder --build ${PACKAGE}_${DEBIAN_VERSION}.dsc