# pbuilder defaults; edit /etc/pbuilderrc to override these and see
# pbuilderrc.5 for documentation

# Set how much output you want from pbuilder, valid values are
# E => errors only
# W => errors and warnings
# I => errors, warnings and informational
# D => all of the above and debug messages
LOGLEVEL=I
# if positive, some log messagges (errors, warnings, debugs) will be colored
# auto => try automatically detection
# yes  => always use colors
# no   => never use colors
USECOLORS=auto

case ${DISTRIBUTION} in
    buster|bullseye|bookworm|trixie|sid|experimental)
        DIST_VENDOR=debian
        MIRRORSITE=https://deb.debian.org/debian
        ;;
    bionic|focal)
        DIST_VENDOR=ubuntu
        MIRRORSITE=http://archive.ubuntu.com/ubuntu
        ;;
    jammy|noble)
        DIST_VENDOR=ubuntu
        MIRRORSITE=https://fr.archive.ubuntu.com/ubuntu
        ;;
    *)
        echo "Unknown distribution: ${DISTRIBUTION}" >&2
        exit 1
esac

BASETGZ="@BUILDER_DIR@/pbuilder/base.tgz"
#EXTRAPACKAGES=""
#export DEBIAN_BUILDARCH=athlon
BUILDPLACE=@BUILDER_DIR@/pbuilder/build
# directory inside the chroot where the build happens. See #789404
BUILDDIR=/build
# what be used as value for HOME during builds.  See #441052
# The default value prevents builds to write on HOME, which is prevented on
# Debian buildds too.  You can set it to $BUILDDIR to get a working HOME, if
# you need to.
BUILD_HOME=/nonexistent
#OTHERMIRROR="deb http://www.home.com/updates/ ./"
#export http_proxy=http://your-proxy:8080/
USEPROC=yes
USEDEVFS=no
USEDEVPTS=yes
USESYSFS=yes
USENETWORK=no
USERUNSHM=yes
BUILDRESULT="@BUILDER_DIR@/pbuilder/results"

# specifying the distribution forces the distribution on "pbuilder update"
#DISTRIBUTION=sid
# specifying the architecture passes --arch= to debootstrap; the default is
# to use the architecture of the host
#ARCHITECTURE=`dpkg --print-architecture`
# specifying the components of the distribution, for instance to enable all
# components on Debian use "main contrib non-free" and on Ubuntu "main
# restricted universe multiverse"
case ${DISTRIBUTION} in
    buster|bullseye|bookworm|trixie|sid|experimental)
        COMPONENTS="main"
        ;;
    bionic|focal|jammy|noble)
        COMPONENTS="main restricted universe multiverse"
        ;;
esac
#specify the cache for APT
APTCACHE="@BUILDER_DIR@/cache/aptcache"
APTCACHEHARDLINK="yes"
REMOVEPACKAGES=""
HOOKDIR="@BUILDER_DIR@/pbuilder/hooks"
EATMYDATA=yes

# make debconf not interact with user
export DEBIAN_FRONTEND="noninteractive"

#for pbuilder debuild
BUILDSOURCEROOTCMD="fakeroot"
PBUILDERROOTCMD="sudo -E"
# use cowbuilder for pdebuild
#PDEBUILD_PBUILDER="cowbuilder"

# additional build results to copy out of the package build area
#ADDITIONAL_BUILDRESULTS=(xunit.xml .coverage)

# 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"

# Arguments for $PBUILDERSATISFYDEPENDSCMD.
# PBUILDERSATISFYDEPENDSOPT=()

# You can optionally make pbuilder accept untrusted repositories by setting
# this option to yes, but this may allow remote attackers to compromise the
# system. Better set a valid key for the signed (local) repository with
# $APTKEYRINGS (see below).
ALLOWUNTRUSTED=no

# Option to pass to apt-get always.
export APTGETOPT=()
# Option to pass to aptitude always.
export APTITUDEOPT=()

# Whether to use debdelta or not.  If "yes" debdelta will be installed in the
# chroot
DEBDELTA=no

#Command-line option passed on to dpkg-buildpackage.
#DEBBUILDOPTS="-IXXX -iXXX"
DEBBUILDOPTS="-sa"

#APT configuration files directory
APTCONFDIR=""

export DEB_VENDOR=Qubes

unset MAKEFLAGS

# the username and ID used by pbuilder, inside chroot. Needs fakeroot, really
BUILDUSERNAME=pbuilder
BUILDUSERID=$(grep $BUILDUSERNAME /etc/passwd | cut -d: -f3)

# BINDMOUNTS is a space separated list of things to mount
# inside the chroot.
BINDMOUNTS=""

# Set the debootstrap variant to 'buildd' type.
DEBOOTSTRAPOPTS=(
    '--variant=buildd'
    '--force-check-gpg'
    )
# or unset it to make it not a buildd type.
# unset DEBOOTSTRAPOPTS

DEBOOTSTRAPOPTS+=( "--keyring=@BUILDER_DIR@/plugins/chroot_deb/keys/${DISTRIBUTION}-${DIST_VENDOR}-archive-keyring.gpg" )
DEBOOTSTRAPOPTS+=( "--include=ca-certificates" )

# Keyrings to use for package verification with apt, not used for debootstrap
# (use DEBOOTSTRAPOPTS). By default the debian-archive-keyring package inside
# the chroot is used.
if [ -r "@BUILDER_DIR@/pbuilder/qubes-keyring.gpg" ]; then
    APTKEYRINGS=( "@BUILDER_DIR@/pbuilder/qubes-keyring.gpg" )
else
    APTKEYRINGS=()
fi

# Set the PATH I am going to use inside pbuilder: default is "/usr/sbin:/usr/bin:/sbin:/bin"
export PATH="/usr/sbin:/usr/bin:/sbin:/bin"

# SHELL variable is used inside pbuilder by commands like 'su'; and they need sane values
export SHELL=/bin/bash

# The name of debootstrap command, you might want "cdebootstrap".
DEBOOTSTRAP="debootstrap"

# default file extension for pkgname-logfile
PKGNAME_LOGFILE_EXTENSION="_$(dpkg --print-architecture).build"

# default PKGNAME_LOGFILE
PKGNAME_LOGFILE=""

# default AUTOCLEANAPTCACHE
AUTOCLEANAPTCACHE=""

#default COMPRESSPROG
COMPRESSPROG="gzip"

# pbuilder copies some configuration files (like /etc/hosts or /etc/hostname)
# from the host system into the chroot.  If the directory specified here
# exists and contains one of the copied files (without the leading /etc) that
# file will be copied from here instead of the system one
CONFDIR="/etc/pbuilder/conf_files"

# ccache (make sure ccache is installed before uncommenting)
CCACHEDIR=""
# Note: CCACHEDIR is private to pbuilder, ccache uses "CCACHE_DIR"
#CCACHEDIR="/var/cache/pbuilder/ccache"
#export CCACHE_DIR="${CCACHEDIR}"
#export PATH="/usr/lib/ccache:${PATH}"
#EXTRAPACKAGES=ccache
#BINDMOUNTS="${BINDMOUNTS} ${CCACHE_DIR}"
BINDMOUNTS="@BUILDER_DIR@/repository:/tmp/qubes-deb"

# qubes-builder is the thing building building the final packages, it doesn't
# need to send *_source.changes to be actually built; and two .changes files
# messes things up
SOURCE_ONLY_CHANGES=no
