add docker packaging work
[scripts.git] / docker / packaging / pbuilderrc
1 HOOKDIR="/root/.pbuilder-hooks"
2
3 # Codenames for Debian suites according to their alias. Update these when
4 # needed.
5 UNSTABLE_CODENAME="sid"
6 TESTING_CODENAME="stretch"
7 STABLE_CODENAME="jessie"
8 STABLE_BACKPORTS_SUITE="$STABLE_CODENAME-backports"
9
10 # List of Debian suites.
11 DEBIAN_SUITES=($UNSTABLE_CODENAME $TESTING_CODENAME $STABLE_CODENAME $STABLE_BACKPORTS_SUITE
12     "unstable" "testing" "stable")
13
14 # List of Ubuntu suites. Update these when needed.
15 UBUNTU_SUITES=("xenial" "wily" "vivid" "yakkety" "trusty")
16
17 # Mirrors to use. Update these to your preferred mirror.
18 DEBIAN_MIRROR="deb.debian.org"
19 UBUNTU_MIRROR="mirrors.kernel.org"
20
21 EXTRAPACKAGES=eatmydata
22 EATMYDATA=yes
23
24 export LD_PRELOAD=${LD_PRELOAD:+$LDPRELOAD:}libeatmydata.so
25 PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-gdebi"
26
27 PKGNAME_LOGFILE_EXTENTION="_$(dpkg --print-architecture).build"
28 PKGNAME_LOGFILE=yes
29
30 export DH_VERBOSE=1
31
32 # Optionally use the changelog of a package to determine the suite to use if
33 # none set.
34 if [ -z "${DIST}" ] && [ -r "debian/changelog" ]; then
35     DIST=$(dpkg-parsechangelog | awk '/^Distribution: / {print $2}')
36     # Use the unstable suite for certain suite values.
37     if $(echo "experimental UNRELEASED" | grep -q $DIST); then
38         DIST="$UNSTABLE_CODENAME"
39     fi
40     # Use the stable suite for stable-backports.
41     if $(echo "$STABLE_BACKPORTS_SUITE" | grep -q $DIST); then
42         DIST="$STABLE_CODENAME"
43     fi
44 fi
45
46 # Optionally set a default distribution if none is used. Note that you can set
47 # your own default (i.e. ${DIST:="unstable"}).
48 : ${DIST:="$(lsb_release --short --codename)"}
49
50 # Optionally change Debian codenames in $DIST to their aliases.
51 case "$DIST" in
52     $UNSTABLE_CODENAME)
53         DIST="unstable"
54         ;;
55     $TESTING_CODENAME)
56         DIST="testing"
57         ;;
58     $STABLE_CODENAME)
59         DIST="stable"
60         ;;
61 esac
62
63 # Optionally set the architecture to the host architecture if none set. Note
64 # that you can set your own default (i.e. ${ARCH:="i386"}).
65 : ${ARCH:="$(dpkg --print-architecture)"}
66
67 NAME="$DIST"
68 if [ -n "${ARCH}" ]; then
69     NAME="$NAME-$ARCH"
70     DEBOOTSTRAPOPTS=("--arch" "$ARCH" "${DEBOOTSTRAPOPTS[@]}")
71 fi
72 #BASETGZ="/var/cache/pbuilder/$NAME-base.tgz"
73 # Optionally, set BASEPATH (and not BASETGZ) if using cowbuilder
74 BASEPATH="/var/cache/pbuilder/$NAME/base.cow/"
75 DISTRIBUTION="$DIST"
76 BUILDRESULT="/var/cache/pbuilder/$NAME/result/"
77 APTCACHE="/var/cache/pbuilder/$NAME/aptcache/"
78 BUILDPLACE="/var/cache/pbuilder/build/"
79 BINDMOUNTS="/var/cache/archive"
80
81 if $(echo ${DEBIAN_SUITES[@]} | grep -q $DIST); then
82     # Debian configuration
83     MIRRORSITE="http://$DEBIAN_MIRROR/debian/"
84     COMPONENTS="main contrib non-free"
85     DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" "--keyring=/usr/share/keyrings/debian-archive-keyring.gpg")
86     OTHERMIRROR="deb file:///var/cache/archive $DIST/"
87
88 elif $(echo ${UBUNTU_SUITES[@]} | grep -q $DIST); then
89     # Ubuntu configuration
90     MIRRORSITE="http://$UBUNTU_MIRROR/ubuntu/"
91     COMPONENTS="main restricted universe multiverse"
92     DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" "--keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg")
93     OTHERMIRROR="deb file:///var/cache/archive $DIST/"
94 else
95     echo "Unknown distribution: $DIST"
96     exit 1
97 fi