aboutsummaryrefslogtreecommitdiff
path: root/pdebuild
blob: 3ed70671d2b2ad137a0340e80417fc9be469ea88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /bin/bash
set -e

while ! test -d ./debian -o "$(pwd)" = "/" ; do
    cd ..;
done

if test ! -d ./debian; then
    echo "Cannot find ./debian dir"
    exit 1
fi;

. /usr/lib/pbuilder/pbuilder-checkparams

PKG_SOURCENAME=$(dpkg-parsechangelog|sed -n 's/^Source: //p')
PKG_VERSION=$(dpkg-parsechangelog|sed -n 's/^Version: \(.*:\|\)//p')
ARCHITECTURE=$(dpkg-architecture -qDEB_HOST_ARCH)

dpkg-buildpackage -S -us -uc -r${BUILDSOURCEROOTCMD} || true
${PBUILDERROOTCMD} pbuilder build "$@" --buildresult "${BUILDRESULT}" ../"${PKG_SOURCENAME}_${PKG_VERSION}".dsc
if [ "${AUTO_DEBSIGN}" = "yes" ]; then
    debsign "${BUILDRESULT}/${PKG_SOURCENAME}_${PKG_VERSION}_${ARCHITECTURE}.changes"
fi