-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpbuilderrc
125 lines (110 loc) · 3.77 KB
/
pbuilderrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Codenames for Debian suites according to their alias. Update these when
# needed.
UNSTABLE_CODENAME="sid"
TESTING_CODENAME="jessie"
STABLE_CODENAME="wheezy"
# List of Debian suites.
DEBIAN_SUITES=($UNSTABLE_CODENAME $TESTING_CODENAME $STABLE_CODENAME
"experimental" "unstable" "testing" "stable")
# List of Ubuntu suites. Update these when needed.
UBUNTU_SUITES=("trusty" "utopic" "vivid")
case "$DIST" in
t)
DIST="trusty"
;;
u)
DIST="utopic"
;;
v)
DIST="vivid"
;;
esac
# Mirrors to use. Update these to your preferred mirror.
DEBIAN_MIRROR="ftp.pl.debian.org"
UBUNTU_MIRROR="ftp.vectranet.pl"
# 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 change Debian codenames in $dist to their aliases.
case "$DIST" in
$UNSTABLE_CODENAME)
DIST=$UNSTABLE_CODENAME
;;
$TESTING_CODENAME)
DIST=$TESTING_CODENAME
;;
$STABLE_CODENAME)
DIST=$STABLE_CODENAME
;;
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 [ ! -z "$PROFILE" ]; then
NAME="$NAME-$PROFILE"
fi
if [ -n "${ARCH}" ]; then
NAME="$NAME-$ARCH"
DEBOOTSTRAPOPTS=("--arch" "$ARCH" "${DEBOOTSTRAPOPTS[@]}")
fi
if [ -n "$main" ]; then
COMPONENTS="main restricted"
NAME="$NAME-main"
else
COMPONENTS="main restricted universe multiverse"
fi
# Edit the paths here, I usually keep it in my /home
BASETGZ="$HOME/Packaging/pbuilder/$NAME-base.tgz"
BASEPATH="$HOME/Packaging/pbuilder/$NAME.cow"
DISTRIBUTION="$DIST"
BUILDRESULT="$HOME/Packaging/pbuilder/$NAME/result/"
APTCACHE="/var/cache/apt/archives/"
BUILDPLACE="$HOME/Packaging/pbuilder/buildplace"
PBUILDERROOTCMD="sudo -E"
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'
)
elif $(echo ${UBUNTU_SUITES[@]} | grep -q $dist); then
# Ubuntu configuration
MIRRORSITE="http://archive.ubuntu.com/ubuntu/"
OTHERMIRROR="deb http://$UBUNTU_MIRROR/ubuntu/ $dist $COMPONENTS|deb http://$UBUNTU_MIRROR/ubuntu/ $dist-updates $COMPONENTS|deb http://$UBUNTU_MIRROR/ubuntu/ $dist-proposed $COMPONENTS|deb http://archive.ubuntu.com/ubuntu/ $dist-updates $COMPONENTS|deb http://archive.ubuntu.com/ubuntu/ $dist-proposed $COMPONENTS"
elif $(echo ${TANGLU_SUITES[@]} | grep -q $dist); then
# Tanglu configuration
MIRRORSITE="http://$TANGLU_MIRROR/tanglu/"
COMPONENTS="main contrib non-free"
DEBOOTSTRAPOPTS=(
"${DEBOOTSTRAPOPTS[@]}"
'--keyring=/usr/share/keyrings/tanglu-archive-keyring.gpg'
)
else
echo "Unknown distribution: $DIST"
exit 1
fi
#Get our magical hook: bzr branch lp:~kubuntu-members/pbuilder/pbuilder-hooks
#Change the directory of course :)
HOOKDIR="$HOME/Packaging/pbuilder/pbuilder-hooks"
#Editor of choice
export EDITOR="vim"
PKGNAME_LOGFILE_EXTENTION="_$(dpkg --print-architecture).build"
PKGNAME_LOGFILE=yes
export DH_VERBOSE=1
COMPRESSPROG=pigz
ALLOWUNTRUSTED=yes
APTCACHEHARDLINK=no
DEBBUILDOPTS="-sa" # always include the source in the changes file
EXTRAPACKAGES="vim"