[ci] Enable IRC notifications from travis
[xapian.git] / xapian-maintainer-tools / debian / build-packages
blobc62ece801f8981c954c336e8cd5bf3a5f1b964b2
1 #!/bin/bash
2 # Build packages in a chroot.
4 # Copyright (C) 2006,2007,2008,2009 Olly Betts
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation; either version 2 of the
9 # License, or (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 # packages required: pbuilder lintian
22 set -e
24 LINTIAN_FLAGS="-l0 -I"
26 if [ x"$1" = x--help ] ; then
27 echo "Usage: $0 [PACKAGES...]"
28 echo
29 echo "Build binary packages from source packages which are in the 'build' subdirectory."
30 echo "e.g. $0 bindings omega"
31 exit 1
34 # Usage: build_package DSC_FILE
35 build_package() {
36 echo ">>> Building: $1"
37 pbuilder build $PBUILDER_OPTS --buildresult build "$1"
40 PACKAGES=${*-"core bindings omega"}
42 rm -f pbuilderrc
43 touch pbuilderrc
44 PBUILDER_OPTS="--configfile pbuilderrc"
46 echo ">>> Updating pbuilder's buildd environment."
47 pbuilder update --override-config $PBUILDER_OPTS
49 case $PACKAGES in
50 *core*) build_package build/xapian-core_*.dsc ;;
51 *) echo "*** WARNING : Using an already built libxapian package" ;;
52 esac
54 echo ">>> Creating temporary repo for pbuilder to get libxapian from."
55 ARCH=`dpkg-architecture -qDEB_BUILD_ARCH`
56 cd build
57 dpkg-scanpackages -a "$ARCH" . /dev/null | gzip -9 > Packages.gz
58 cd ..
59 pkgdir=`pwd`/build
60 echo "BINDMOUNTS=$pkgdir" >> pbuilderrc
61 echo "OTHERMIRROR='deb file:$pkgdir/ ./'" >> pbuilderrc
63 echo ">>> Updating the chroot to include the temporary repo."
64 # Need to ensure python is installed in the chroot so that the xapian-bindings
65 # install script can discover the default python version.
66 # FIXME : not sure this is actually required now...
67 pbuilder update --override-config $PBUILDER_OPTS --extrapackages python
69 case $PACKAGES in
70 *bindings*) build_package build/xapian-bindings_*.dsc ;;
71 esac
73 case $PACKAGES in
74 *omega*) build_package build/xapian-omega_*.dsc ;;
75 esac
77 lintian $LINTIAN_FLAGS *.dsc build/*.deb