#!/bin/bash set -e PKG=$1 VER=$2 ARCH=$3 if [ "$PKG" = "" ]; then echo "PKG not set" exit 1 fi if [ "$VER" = "" ]; then VER="unstable" fi if [ "$ARCH" != "amd64" ]; then ARCH="i386" fi rm -rf ../build mkdir -p ../build ( cd ../build && dpkg-source -I.git '-i^\.git/' -b ../git/${PKG} ) cd ../build dpkg-source -x *.dsc >/dev/null 2>&1 rm -f *.gz *.dsc python ../git/scripts/update.changelog.py \ ../build/${PKG}-*/debian/changelog \ "${VER}" ( cd ${PKG}-*/ && make patch_$VER || true ) dpkg-source -b ${PKG}-*/ DSC=$(ls -1 *.dsc) BUILD_OPTS="-us -uc" if [ "$ARCH" = "amd64" ]; then # binary only in amd64 BUILD_OPTS="${BUILD_OPTS} -B" fi mkdir -p /var/cache/pbuilder/result/${ARCH} if [ "$VER" = "max" ]; then VER="lucid" fi if [ -f "/var/cache/pbuilder/${VER}-${ARCH}.tgz" ]; then pbuilder --build --architecture ${ARCH} --debbuildopts "${BUILD_OPTS}" \ --buildresult /var/cache/pbuilder/result/${ARCH}/ \ --basetgz "/var/cache/pbuilder/${VER}-${ARCH}.tgz" $DSC 2>&1 | \ tee -a /var/cache/pbuilder/result/${ARCH}/${DSC}-${VER}-${ARCH}.log fi