# requires: pigz, eatmydata
# Mirrors to use. Update these to your preferred mirror.
UBUNTU_MIRROR="archive.ubuntu.com/ubuntu"
# Optionally use the changelog of a package to determine the suite to use if
# none set.
#if [ -z "${dist}" ] && [ -r "debian/changelog" ]; then
# dist=$(dpkg-parsechangelog | awk '/^Distribution: / {print $2}')
# # Use the unstable suite for Debian experimental packages.
# if [ "${dist}" == "experimental" ]; then
# dist="$UNSTABLE_CODENAME"
# fi
#fi
# Optionally set a default distribution if none is used. Note that you can set
# your own default (i.e. ${dist:="unstable"}).
: ${dist:="$(lsb_release --short --codename)"}
# Optionally set the architecture to the host architecture if none set. Note
# that you can set your own default (i.e. ${ARCH:="i386"}).
: ${ARCH:="$(dpkg --print-architecture)"}
NAME="$dist"
# Append a project suffix to the chroot name to allow seperate chroots for
# e.g. different PPAs
if [ ! -z "$pro" ]; then
NAME="$NAME-$pro"
fi
# Append the architecture to the chroot name to allow different chroots for
# each architecture
if [ -n "${ARCH}" ]; then
NAME="$NAME-$ARCH"
DEBOOTSTRAPOPTS=("--arch=${ARCH}" "${DEBOOTSTRAPOPTS[@]}")
else
# use the current architecture as default
ARCH="$(dpkg --print-architecture)"
fi
# if main=1 is set, do not use universe and multiverse
if [ -n "$main" ]; then
COMPONENTS="main restricted"
NAME="$NAME-main"
else
COMPONENTS="main restricted universe multiverse"
fi
# Edit the paths here as you like
BASETGZ="/var/cache/pbuilder/$NAME.tgz"
BUILDRESULT="/var/cache/pbuilder/$NAME/result/"
APTCACHE="/var/cache/apt/archives/"
BUILDPLACE="/var/cache/pbuilder/build/"
DISTRIBUTION="$dist"
# Ubuntu configuration
MIRRORSITE="http://$UBUNTU_MIRROR/"
# Use the $dist-proposed repository by default
OTHERMIRROR="deb http://$UBUNTU_MIRROR/ $dist-proposed $COMPONENTS"
# Optionally add PPAs by default
#OTHERMIRROR="$OTHERMIRROR|deb http://ppa.launchpad.net/kubuntu-ppa/ppa/ubuntu/ $dist main"
#Get our magical hook: bzr branch lp:~kubuntu-packagers/pbuilder/pbuilder-hooks
#Change the directory of course :)
HOOKDIR="$HOME/.pbuilder-hooks"
#Editor of choice
export EDITOR="vim"
# Buildlog filename
PKGNAME_LOGFILE_EXTENSION="_$(dpkg --print-architecture).build"
PKGNAME_LOGFILE=yes
# Build in verbose debhelper mode for easier debugging
export DH_VERBOSE=1
# Use pigz to speed up de/compression of the chroot tarballs
COMPRESSPROG=pigz
# Don't verify Archive signatures
# WARNING: only use this for throw away builds and don't share the build
# artifacts
#ALLOWUNTRUSTED=yes
# Build with multiple compile jobs
# Change 2 to how many cpu cores you want the build to use
export DEB_BUILD_OPTIONS="parallel=2"
# Extra packages to install in the chroot by default
EXTRAPACKAGES="eatmydata vim"
# eatmydata support
if [ "$ARCH" = "amd64" ]; then
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libeatmydata.so
fi
if [ "$ARCH" = "i386" ]; then
export LD_PRELOAD=/usr/lib/i386-linux-gnu/libeatmydata.so
fi