dev/debian-build/dbuild
author David Douard <david.douard@logilab.fr>
Mon, 03 Nov 2014 11:12:45 +0100
changeset 372 80f78674c56e
parent 336 5874d49da474
permissions -rwxr-xr-x
Add support for phases This adds a "publish" permission level (between "init" and "write") required to be able to change the phase of a changeset from "draft" to "public". Update documentation accordingly. This is meant to be used for using the changeset evolution feature of mercurial, see http://evolution.experimentalworks.net/doc/

#!/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 BUILDDIR $BUILDDIR

rm -rf ${BUILDDIR}
mkdir -p ${BUILDDIR}
hg st -mac0n -X '.hg*' -X 'dev/**' -X 'debian/**' | cpio -p -0 -d \
   ${BUILDDIR}/${PACKAGE}-${UPSTREAM_VERSION}
(cd ${BUILDDIR} ; tar cvzf \
   ${PACKAGE}_${UPSTREAM_VERSION}.orig.tar.gz \
   ${PACKAGE}-${UPSTREAM_VERSION} )
hg st -mac0n -I 'debian/**' | cpio -p -0 -d \
   ${BUILDDIR}/${PACKAGE}-${UPSTREAM_VERSION}

cd ${BUILDDIR}/${PACKAGE}-${UPSTREAM_VERSION}
dpkg-buildpackage $DPKG_BUILDPACKAGE_OPTIONS
cd ..
lintian -i --pedantic -IE ${PACKAGE}_${DEBIAN_VERSION}_*.changes