diff options
Diffstat (limited to 'docker/packaging/pbuilderrc')
-rw-r--r-- | docker/packaging/pbuilderrc | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/docker/packaging/pbuilderrc b/docker/packaging/pbuilderrc new file mode 100644 index 0000000..0f3b26d --- /dev/null +++ b/docker/packaging/pbuilderrc @@ -0,0 +1,97 @@ +HOOKDIR="/root/.pbuilder-hooks" + +# Codenames for Debian suites according to their alias. Update these when +# needed. +UNSTABLE_CODENAME="sid" +TESTING_CODENAME="stretch" +STABLE_CODENAME="jessie" +STABLE_BACKPORTS_SUITE="$STABLE_CODENAME-backports" + +# List of Debian suites. +DEBIAN_SUITES=($UNSTABLE_CODENAME $TESTING_CODENAME $STABLE_CODENAME $STABLE_BACKPORTS_SUITE + "unstable" "testing" "stable") + +# List of Ubuntu suites. Update these when needed. +UBUNTU_SUITES=("xenial" "wily" "vivid" "yakkety" "trusty") + +# Mirrors to use. Update these to your preferred mirror. +DEBIAN_MIRROR="deb.debian.org" +UBUNTU_MIRROR="mirrors.kernel.org" + +EXTRAPACKAGES=eatmydata +EATMYDATA=yes + +export LD_PRELOAD=${LD_PRELOAD:+$LDPRELOAD:}libeatmydata.so +PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-gdebi" + +PKGNAME_LOGFILE_EXTENTION="_$(dpkg --print-architecture).build" +PKGNAME_LOGFILE=yes + +export DH_VERBOSE=1 + +# 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 certain suite values. + if $(echo "experimental UNRELEASED" | grep -q $DIST); then + DIST="$UNSTABLE_CODENAME" + fi + # Use the stable suite for stable-backports. + if $(echo "$STABLE_BACKPORTS_SUITE" | grep -q $DIST); then + DIST="$STABLE_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 change Debian codenames in $DIST to their aliases. +case "$DIST" in + $UNSTABLE_CODENAME) + DIST="unstable" + ;; + $TESTING_CODENAME) + DIST="testing" + ;; + $STABLE_CODENAME) + DIST="stable" + ;; +esac + +# 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" +if [ -n "${ARCH}" ]; then + NAME="$NAME-$ARCH" + DEBOOTSTRAPOPTS=("--arch" "$ARCH" "${DEBOOTSTRAPOPTS[@]}") +fi +#BASETGZ="/var/cache/pbuilder/$NAME-base.tgz" +# Optionally, set BASEPATH (and not BASETGZ) if using cowbuilder +BASEPATH="/var/cache/pbuilder/$NAME/base.cow/" +DISTRIBUTION="$DIST" +BUILDRESULT="/var/cache/pbuilder/$NAME/result/" +APTCACHE="/var/cache/pbuilder/$NAME/aptcache/" +BUILDPLACE="/var/cache/pbuilder/build/" +BINDMOUNTS="/var/cache/archive" + +if $(echo ${DEBIAN_SUITES[@]} | grep -q $DIST); then + # Debian configuration + MIRRORSITE="http://$DEBIAN_MIRROR/debian/" + COMPONENTS="main contrib non-free" + DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" "--keyring=/usr/share/keyrings/debian-archive-keyring.gpg") + OTHERMIRROR="deb file:///var/cache/archive $DIST/" + +elif $(echo ${UBUNTU_SUITES[@]} | grep -q $DIST); then + # Ubuntu configuration + MIRRORSITE="http://$UBUNTU_MIRROR/ubuntu/" + COMPONENTS="main restricted universe multiverse" + DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" "--keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg") + OTHERMIRROR="deb file:///var/cache/archive $DIST/" +else + echo "Unknown distribution: $DIST" + exit 1 +fi |