Enable COMPONENTS workaround for Ubuntu cowdancer issue only when building *for* (not *on*) Ubuntu
Enable COMPONENTS workaround for Ubuntu cowdancer issue only when building *for* (not *on*) Ubuntu

When building for Debian on a Ubuntu host then the "universe"
repository doesn't exist and the cowbuilder run for Debian fails.
Also the user might want to configure COMPONENTS from a custom
pbuilder configuration file, then COMPONENTS isn't set as
environment variable though.  So instead of checking for Ubuntu
on the host system let's see which distribution we're building
for. When we identify Ubuntu and neither COMPONENTS nor a no
custom PBUILDER_CONFIG is set, only then enable the workaround.

FTR, one easy way to support building for Ubuntu and Debian on a
plain Debian system is for example:

| $ sudo apt-get -y install ubuntu-archive-keyring
|
| $ grep '^PBUILDER' /etc/jenkins/debian_glue
| PBUILDER_CONFIG=/etc/jenkins/pbuilderrc
|
| $ cat /etc/jenkins/pbuilderrc
| DEBIAN_SUITES=("wheezy" "jessie" "sid")
| DEBIAN_MIRROR="http.debian.net"
| UBUNTU_MIRROR="mirrors.kernel.org"
|
| 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")
| else
|   # Ubuntu configuration
|   MIRRORSITE="http://$UBUNTU_MIRROR/ubuntu/"
|   COMPONENTS="main restricted universe multiverse"
|   DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" "--keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg")
| fi

Thanks: Yurii Vlasenko for reporting and feedback
Closes: 3a89b8acdf1281f9f9dc0ebf67e660c229a64f95@ github

cclausen/jenkins-debian-glue,n054/jenkins-debian-glue,hashar/jenkins-debian-glue,cclausen/jenkins-debian-glue,bmiklautz/jenkins-debian-glue,mika/jenkins-debian-glue,webtrekk-kane/jenkins-debian-glue,tonin/jenkins-debian-glue,mika/jenkins-debian-glue,hetznerZA/jenkins-debian-glue,tonin/jenkins-debian-glue,webtrekk-kane/jenkins-debian-glue,hashar/jenkins-debian-glue,n054/jenkins-debian-glue,wikimedia/operations-debs-jenkins-debian-glue,kartikm/jenkins-debian-glue,bmiklautz/jenkins-debian-glue,linuxmaniac/jenkins-debian-glue,jbfavre/jenkins-debian-glue,kartikm/jenkins-debian-glue,wikimedia/operations-debs-jenkins-debian-glue,linuxmaniac/jenkins-debian-glue,jbfavre/jenkins-debian-glue,hetznerZA/jenkins-debian-glue