]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blob - misc/build-deb.sh
e15d4287b0b289800f8f522ea667b1eb347510d4
[tahoe-lafs/tahoe-lafs.git] / misc / build-deb.sh
1 #!/bin/bash
2 set -e
3
4 # $PYTHON and $ARCH must be set
5
6 if [ -z "$PYTHON" ]; then
7     PYTHON=python
8 fi
9 if [ -z "$ARCH" ]; then
10     echo "must set ARCH= before running this script"
11     exit 1
12 fi
13
14 NAME=$($PYTHON setup.py --name)
15 VERSION=$($PYTHON setup.py --version)
16
17 # actually, it's the debchange using a different author than the
18 # debian/control Maintainer: entry that makes lintian think this is an NMU.
19 # Put "local package" on the first line of the changelog entry to supress
20 # this warning.
21 TARBALL=${NAME}-${VERSION}.tar.gz
22 DEBTARBALL=${NAME}_${VERSION}.orig.tar.gz
23 DEBDIR=build/debian/${NAME}-${VERSION}
24 $PYTHON setup.py sdist --formats=gztar
25 rm -rf build/debian
26 mkdir -p build/debian
27 cp dist/$TARBALL build/debian/$DEBTARBALL
28 (cd build/debian && tar xf $DEBTARBALL)
29 zcat misc/debian/$ARCH.diff.gz | (cd $DEBDIR && patch -p1)
30 chmod +x $DEBDIR/debian/rules
31 # We put "local package" on the first line of the changelog entry to suppress
32 # the lintian NMU warnings (since debchange's new entry's "author" will
33 # probably be different than the what the debian/control Maintainer: field
34 # says)
35 echo "updating version to $VERSION-1"
36 (cd $DEBDIR && debchange --newversion $VERSION-1 "local package: 'make deb' build")
37 (cd $DEBDIR && debuild -uc -us)
38