summaryrefslogtreecommitdiffstats
path: root/debian/_buildscripts/local/scripts/additional files
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2018-06-20 19:13:35 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2018-06-20 19:16:10 +0900
commite324c2e7e496f30183b678e8fa1a3c10cdb80e5b (patch)
tree50fda18f6c1de7e73755e080fbc55a28833582ff /debian/_buildscripts/local/scripts/additional files
parent77398a607fe09f49f40349bce398661c43e77143 (diff)
downloadtde-packaging-e324c2e7e496f30183b678e8fa1a3c10cdb80e5b.tar.gz
tde-packaging-e324c2e7e496f30183b678e8fa1a3c10cdb80e5b.zip
DEB build scripts: major update aimed at simplifying the use for
non-root users. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/_buildscripts/local/scripts/additional files')
-rw-r--r--debian/_buildscripts/local/scripts/additional files/etc/pbuilderrc190
-rwxr-xr-xdebian/_buildscripts/local/scripts/additional files/root/.pbuilder/hooks/__template_C10shell7
-rw-r--r--debian/_buildscripts/local/scripts/additional files/root/.pbuilderrc152
3 files changed, 158 insertions, 191 deletions
diff --git a/debian/_buildscripts/local/scripts/additional files/etc/pbuilderrc b/debian/_buildscripts/local/scripts/additional files/etc/pbuilderrc
index 04869a03b..81e7894c4 100644
--- a/debian/_buildscripts/local/scripts/additional files/etc/pbuilderrc
+++ b/debian/_buildscripts/local/scripts/additional files/etc/pbuilderrc
@@ -1,53 +1,179 @@
-# this is your configuration file for pbuilder.
-# the file in /usr/share/pbuilder/pbuilderrc is the default template.
-# /etc/pbuilderrc is the one meant for editing.
-#
-# read pbuilderrc.5 document for notes on specific options.
-
-BASETGZ=/var/cache/pbuilder/base.tgz
-BUILDPLACE=/var/cache/pbuilder/build/
+#!/bin/bash
+
+# general options
+BUILDPLACE="/var/cache/pbuilder/build/"
USEPROC=yes
USEDEVPTS=yes
USEDEVFS=no
-BUILDRESULT=/var/cache/pbuilder/result/
+
+# the username and ID used by pbuilder, inside chroot. Needs fakeroot, really
+BUILDUSERID=1234
+BUILDUSERNAME=pbuilder
# make debconf not interact with user
export DEBIAN_FRONTEND="noninteractive"
DEBEMAIL=""
+
# for pbuilder debuild (sudo -E keeps the environment as-is)
BUILDSOURCEROOTCMD="fakeroot"
PBUILDERROOTCMD="sudo -E"
-# command to satisfy build-dependencies; the default is an internal shell
-# implementation which is relatively slow; there are two alternate
-# implementations, the "experimental" implementation,
-# "pbuilder-satisfydepends-experimental", which might be useful to pull
-# packages from experimental or from repositories with a low APT Pin Priority,
-# and the "aptitude" implementation, which will resolve build-dependencies and
-# build-conflicts with aptitude which helps dealing with complex cases but does
-# not support unsigned APT repositories
-PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends"
-
-#Command-line option passed on to dpkg-buildpackage.
-DEBBUILDOPTS=""
+# this is necessary for running 'apt-ftparchive' in a hook script if required
+EXTRAPACKAGES="$EXTRAPACKAGES apt-utils"
#APT configuration files directory
APTCONFDIR=""
-# the username and ID used by pbuilder, inside chroot. Needs fakeroot, really
-BUILDUSERID=1234
-BUILDUSERNAME=pbuilder
-
-# Set the debootstrap variant to 'buildd' type.
-DEBOOTSTRAPOPTS[0]='--variant=buildd'
-# Set the PATH I am going to use inside pbuilder: default is "/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin"
+# Set the PATH to be used inside pbuilder
export PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin"
-
-# SHELL variable is used inside pbuilder by commands like 'su'; and they need sane values
+# Shell to be used inside pbuilder by commands like 'su'
export SHELL=/bin/bash
-# The name of debootstrap command.
-DEBOOTSTRAP="debootstrap"
+# default PKGNAME_LOGFILE
+PKGNAME_LOGFILE="__build__.log"
+
+#-- 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
# 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
diff --git a/debian/_buildscripts/local/scripts/additional files/root/.pbuilder/hooks/__template_C10shell b/debian/_buildscripts/local/scripts/additional files/root/.pbuilder/hooks/__template_C10shell
deleted file mode 100755
index 3e2f1c865..000000000
--- a/debian/_buildscripts/local/scripts/additional files/root/.pbuilder/hooks/__template_C10shell
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-# invoke shell if build fails.
-
-apt-get install -y --force-yes vim less bash mc
-cd /tmp/buildd/*/debian/..
-echo "Build FAILED! Invoking shell"
-/bin/bash < /dev/tty > /dev/tty 2> /dev/tty
diff --git a/debian/_buildscripts/local/scripts/additional files/root/.pbuilderrc b/debian/_buildscripts/local/scripts/additional files/root/.pbuilderrc
deleted file mode 100644
index d6662085c..000000000
--- a/debian/_buildscripts/local/scripts/additional files/root/.pbuilderrc
+++ /dev/null
@@ -1,152 +0,0 @@
-#!/bin/bash
-
-#-- this is necessary for running 'apt-ftparchive' in a hook script if required
-EXTRAPACKAGES="$EXTRAPACKAGES apt-utils"
-
-#-- 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