summaryrefslogtreecommitdiffstats
path: root/debian/_buildscripts/local/scripts/additional files/user_home_folder/.pbuilderrc
blob: cb58cb895f946970e23355c792daaa408dc658a3 (plain)
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#!/bin/bash

#-- get desired distribution and architecture
if [ "$DIST" = "" ]; then
	DIST=$(lsb_release -cs)
fi
DISTRIBUTION=$DIST
if [ "$ARCH" = "" ]; then
  ARCH=$(dpkg --print-architecture)
fi
ARCHITECTURE=$ARCH

if [ -n "$T" ]; then
  if [ "${T##*-}" = "vm" ]; then
    BUILD_VM="qemu"
    T=${T%-vm}
  fi
  if [ "${T#*@}" = "$T" ]; then
    DISTRIBUTION=${T%-*}
    ARCHITECTURE=${T##*-}
  else
    DISTRIBUTION=${T%@*}
    ARCHITECTURE=${T##*@}
  fi
  if [ "${DISTRIBUTION##*-}" = "backports" ]; then
    BACKPORTS="yes"
    DISTRIBUTION=${DISTRIBUTION%-backports}
  fi
fi

BASETGZ="/var/cache/pbuilder/base-$DIST@$ARCH.tgz"

#-- select apt components
case "$DISTRIBUTION" in
    sid|buster|stretch|jessie|wheezy|squeeze|lenny|etch|sarge)
        COMPONENTS="main contrib non-free"
        ;;

    ceres|beowulf|ascii)
        COMPONENTS="main"
        DEBOOTSTRAPOPTS=(--variant=buildd --no-check-gpg)
        EXTRAPACKAGES="$EXTRAPACKAGES devuan-keyring"
        ;;

    bionic|artful|zesty|yakkety|xenial|wily|vivid|utopic|trusty|saucy|raring|quantal|precise|oneiric|natty|maverick|lucid)
        COMPONENTS="main restricted universe multiverse"
        DEBOOTSTRAPOPTS=(--variant=buildd)
        ;;

    raspbian-jessie|raspbian-wheezy)
        COMPONENTS="main contrib non-free"
        DEBOOTSTRAPOPTS=(--variant=buildd --no-check-gpg)
        ;;
esac
EXTRAPACKAGES="$EXTRAPACKAGES fakeroot apt-transport-https ca-certificates"

#-- select base apt sources
case "$DISTRIBUTION" in
    sid|buster|stretch|jessie|wheezy)
        MIRRORSITE=http://deb.debian.org/debian
        ;;

    squeeze|lenny|etch|sarge)
        MIRRORSITE=http://archive.debian.org/debian
        OTHERMIRROR="#deb http://archive.debian.org/backports.org $DISTRIBUTION-backports main contrib non-free"
        ;;

    ceres|beowulf|ascii)
        MIRRORSITE=http://auto.mirror.devuan.org/merged
        ;;

    bionic|artful|zesty|yakkety|wily|vivid|trusty|precise)
        if [ "$ARCHITECTURE" = "amd64" ] || [ "$ARCHITECTURE" = "i386" ]; then
            MIRRORSITE=http://archive.ubuntu.com/ubuntu
        else
            MIRRORSITE=http://ports.ubuntu.com
        fi
        ;;

    xenial)
        if [ "$ARCHITECTURE" = "amd64" ] || [ "$ARCHITECTURE" = "i386" ]; then
            MIRRORSITE=http://archive.ubuntu.com/ubuntu
        else
            MIRRORSITE=http://ports.ubuntu.com
        fi
        OTHERMIRROR="deb $MIRRORSITE $DISTRIBUTION-updates $COMPONENTS"
        ;;

    utopic|saucy|raring|quantal|oneiric|natty|maverick|lucid)
        MIRRORSITE=http://old-releases.ubuntu.com/ubuntu
        ;;

    raspbian-jessie|raspbian-wheezy)
        MIRRORSITE=http://ftp.fi.muni.cz/pub/linux/raspbian/raspbian
        ;;
esac

if [ -n "${ARCH}" ]; then
    NAME="$NAME-$ARCH"
    DEBOOTSTRAPOPTS=("--arch" "$ARCH" "${DEBOOTSTRAPOPTS[@]}")
fi

BUILDRESULT="/var/cache/pbuilder/$DISTRIBUTION/result/"

APTCACHE="/var/cache/pbuilder/aptcache/$DISTRIBUTION/"
if [ -n "$APTCACHE" ] && [ ! -d "$APTCACHE" ]; then
  mkdir $APTCACHE
fi
if [ -z "$(stat -L --print "%d\n" $APTCACHE/. /var/cache/pbuilder/build/. | uniq -d)" ]; then
  # apt cache for build on tmpfs is managed by hook scripts
  BINDMOUNTS="${BINDMOUNTS} ${APTCACHE}"
  APTCACHEHARDLINK=no
  APTCACHE=""
fi

BUILDPLACE="/var/cache/pbuilder/build/"

# default PKGNAME_LOGFILE
PKGNAME_LOGFILE="__build__.log"

#-- extra options
DEBBUILDOPTS="-B"
if [ "$ARCHITECTURE" == "amd64" ]; then
  DEBBUILDOPTS="-b"
fi
if [ "${DISTRIBUTION#raspbian}" != "$DISTRIBUTION" ] && [ "$ARCHITECTURE" == "armhf" ]; then
  DEBBUILDOPTS="-b"
  DISTRIBUTION=${DISTRIBUTION#raspbian-}
fi
if [ -z "$DEB_SIGN_KEYID" ]; then
  AUTO_DEBSIGN=${AUTO_DEBSIGN:-no}
fi

#-- choose dependency solver
#-- apt is better if target distribution contains apt >= 1.4~beta3
#-- aptitude is better if target distribution contains apt < 1.4~beta3
case "$DISTRIBUTION" in
  sid|buster|stretch|\
  ceres|beowulf|ascii|\
  bionic|artful|zesty)
    PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-apt"
    ;;

  jessie|wheezy|squeeze|lenny|etch|sarge|\
  raspbian-jessie|raspbian-wheezy|\
  yakkety|xenial|wily|vivid|utopic|trusty|saucy|raring|quantal|precise|oneiric|natty|maverick|lucid)
    PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-aptitude"
    ;;
esac