Browse Source

Add official Ubuntu support

Allow overriding COMPONENTS as this is needed for Ubuntu support
anyway (cowdancer is available in universe only).
merge-requests/109/head
Michael Prokop 10 years ago
parent
commit
c27e896c13
  1. 4
      README.org
  2. 23
      scripts/build-and-provide-package

4
README.org

@ -9,7 +9,7 @@ homogeneous as possible.
* System requirements
+ [[http://jenkins-ci.org/][Jenkins]]
+ [[http://www.debian.org/][Debian]]
+ [[http://www.debian.org/][Debian]] / [[http://www.ubuntu.com/][Ubuntu]]
+ [[http://packages.debian.org/sid/cowbuilder][cowbuilder]], [[http://packages.debian.org/sid/reprepro][reprepro]] and [[http://packages.debian.org/sid/sudo][sudo]] (all available via apt-get/aptitude)
Debian packages of jenkins-debian-glue are available at http://jenkins.grml.org/job/jenkins-debian-glue-binaries/ for your service.
@ -199,6 +199,8 @@ Then you should get test reports for your Debian packages based on lintian's out
+ /BUILD_ONLY/: execute the steps building Debian binary package(s) but skip the repository setup/inclusion steps (useful for building the package(s) on slave nodes and including the result on a different node later then)
+ /COMPONENTS/: the specified repository components will be enabled when creating a new cowbuilder base.cow. If unset defaults to pbuilder's defaults (the underlying system of cowbuilder). Notice that on Ubuntu systems /COMPONENTS/ will be automatically set to "main universe" (if /COMPONENTS/ isn't set yet) to work around a cowdancer issue.
+ /COWBUILDER_BASE/: set path for cowbuilder's base.cow, defaults to //var/cache/pbuilder/base-${COWBUILDER_DIST}-${arch}.cow/ whereas /COWBUILDER_DIST/ depends on its according variable and /arch/ depends on /architecture/ (though doesn't match it if it's set to "all").
+ /COWBUILDER_DIST/: distribution that should be used for creating the cowbuilder base.cow. If /distribution/ is set COWBUILDER_DIST defaults to that, otherwise defaults to the currently running distribution and if that can't be determined then falls back to "sid" (being Debian/unstable).

23
scripts/build-and-provide-package

@ -168,17 +168,38 @@ dist_and_arch_settings() {
}
cowbuilder_init() {
if [ -n "${COMPONENTS:-}" ] ; then
echo "*** COMPONENTS is set [$COMPONENTS], using for pbuilder configuration ***"
local pbuilderrc=$(mktemp)
echo "COMPONENTS=\"${COMPONENTS}\"" > $pbuilderrc
local pbuildercfg="--configfile=$pbuilderrc"
fi
# workaround for Ubuntu problem, as cowdancer is available only in universe :(
# https://bugs.launchpad.net/ubuntu/+source/cowdancer/+bug/237591
# https://bugs.launchpad.net/ubuntu/+source/cowdancer/+bug/747053
if lsb_release --id 2>/dev/null | grep -q Ubuntu ; then
if [ -z "${COMPONENTS:-}" ] ; then
echo "*** Ubuntu detected, enabling universe repository component to work around cowdancer issue ***"
local pbuilderrc=$(mktemp)
echo 'COMPONENTS="main universe"' > $pbuilderrc
local pbuildercfg="--configfile=$pbuilderrc"
fi
fi
if [ ! -d "${COWBUILDER_BASE}" ]; then
echo "*** Creating cowbuilder base $COWBUILDER_BASE for arch $arch and distribution $COWBUILDER_DIST ***"
sudo cowbuilder --create --basepath "${COWBUILDER_BASE}" --distribution "${COWBUILDER_DIST}" \
--debootstrapopts --arch --debootstrapopts "$arch" \
--debootstrapopts --variant=buildd
--debootstrapopts --variant=buildd ${pbuildercfg:-}
[ $? -eq 0 ] || bailout 1 "Error: Failed to create cowbuilder base ${COWBUILDER_BASE}."
else
echo "*** Updating cowbuilder cow base ***"
sudo cowbuilder --update --basepath "${COWBUILDER_BASE}"
[ $? -eq 0 ] || bailout 1 "Error: Failed to update cowbuilder base ${COWBUILDER_BASE}."
fi
[ -n "${pbuilderrc:-}" ] && rm -f "$pbuilderrc"
}

Loading…
Cancel
Save