summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/0001-Use-obs-build-in-locations-and-executable-names.patch (renamed from debian/patches/0001-Use-obs-build-in-locations-and-executable-names-inst.patch)44
-rw-r--r--debian/patches/0002-Fix-Build-Zypp-parsecfg-expected-full-config-file-na.patch25
-rw-r--r--debian/patches/0003-HACK-make-glibc-build.patch35
-rw-r--r--debian/patches/0005-dsc-keep-everything.patch37
-rw-r--r--debian/patches/Log-the-version-number-during-startup.patch98
-rw-r--r--debian/patches/build-recipe-dsc-List-contents-of-build-results.patch65
-rw-r--r--debian/patches/build-recipe-dsc-Move-all-build-results-not-just-.deb-and.patch46
-rw-r--r--debian/patches/build-recipe-dsc-Show-information-about-the-build-chroot.patch49
-rw-r--r--debian/patches/build-recipe-dsc-don-t-rebuild-the-source-package.patch28
-rw-r--r--debian/patches/deb-Install-policy-rc.d-to-prevent-services-from-starting.patch46
-rw-r--r--debian/patches/deb-Show-version-of-each-package-that-we-preinstall.patch25
-rw-r--r--debian/patches/debootstrap-Print-the-exact-command-we-re-going-to-run.patch32
-rw-r--r--debian/patches/debootstrap-add-fallback-for-Debian-SID-distro.patch39
-rw-r--r--debian/patches/series14
14 files changed, 537 insertions, 46 deletions
diff --git a/debian/patches/0001-Use-obs-build-in-locations-and-executable-names-inst.patch b/debian/patches/0001-Use-obs-build-in-locations-and-executable-names.patch
index 5bcf9b6..3377253 100644
--- a/debian/patches/0001-Use-obs-build-in-locations-and-executable-names-inst.patch
+++ b/debian/patches/0001-Use-obs-build-in-locations-and-executable-names.patch
@@ -1,17 +1,23 @@
-From e9487df6bd6aafdc75cdb92b388d6ab49cca7a95 Mon Sep 17 00:00:00 2001
-From: Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
-Date: Wed, 1 Oct 2014 10:44:55 +0100
-Subject: Use obs-build in locations and executable names, instead of just
- build.
+From: =?utf-8?b?SMOpY3RvciBPcsOzbiBNYXJ0w61uZXo=?= <zumbi@debian.org>
+Date: Mon, 5 Mar 2018 01:01:07 +0100
+Subject: Use obs-build in locations and executable names
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+ instead of just build.
Signed-off-by: Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
+Signed-off-by: Héctor Orón Martínez <zumbi@debian.org>
+Forwarded: not-needed, Debian-specific
+Last-Update: 2018-08-30
---
Makefile | 13 +++++++------
build | 6 +++---
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile
-index 8c84ced..94e4abb 100644
+index 3d0c608..41f73f3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
@@ -23,10 +29,10 @@ index 8c84ced..94e4abb 100644
INITVM_ARCH=$(shell bash -c '. common_functions ; build_host_arch; echo $$BUILD_INITVM_ARCH')
-@@ -68,11 +68,12 @@ install:
- install -m644 build-pkg build-pkg-* $(DESTDIR)$(pkglibdir)
- install -m644 *.pm baselibs_global*.conf lxc.conf $(DESTDIR)$(pkglibdir)
+@@ -85,11 +85,12 @@ install:
+ install -m644 *.pm lxc.conf $(DESTDIR)$(pkglibdir)
install -m644 configs/* $(DESTDIR)$(pkglibdir)/configs
+ install -m644 baselibs_configs/* $(DESTDIR)$(pkglibdir)/baselibs_configs
- install -m644 build.1 $(DESTDIR)$(man1dir)
- install -m644 vc.1 $(DESTDIR)$(man1dir)
- install -m644 unrpm.1 $(DESTDIR)$(man1dir)
@@ -39,14 +45,14 @@ index 8c84ced..94e4abb 100644
+ ln -sf $(pkglibdir)/build $(DESTDIR)$(bindir)/obs-build
+ ln -sf $(pkglibdir)/vc $(DESTDIR)$(bindir)/obs-buildvc
ln -sf $(pkglibdir)/unrpm $(DESTDIR)$(bindir)/unrpm
-
- # Allow initvm to be packaged seperately from the rest of build. This
+ ln -s baselibs_configs/baselibs_global.conf $(DESTDIR)$(pkglibdir)/baselibs_global.conf
+ ln -s baselibs_configs/baselibs_global-deb.conf $(DESTDIR)$(pkglibdir)/baselibs_global-deb.conf
diff --git a/build b/build
-index cdba8f8..3a5f696 100755
+index a2b5f3b..5455631 100755
--- a/build
+++ b/build
-@@ -31,8 +31,8 @@ if test "$0" = /sbin/init ; then
- fi
+@@ -36,8 +36,8 @@ BUILD_CONF=/etc/build.conf
+ test -e "$BUILD_CONF" && BUILD_DIR=/usr/lib/build
test -z "$BUILD_DIR" -a -e /.build/build.data -a -z "$BUILD_IGNORE_2ND_STAGE" && BUILD_DIR=/.build
-test -z "$BUILD_DIR" && BUILD_DIR=/usr/lib/build
@@ -55,13 +61,13 @@ index cdba8f8..3a5f696 100755
+test -z "$BUILD_ROOT" && BUILD_ROOT=/var/tmp/obs-build-root
test -z "$CONFIG_DIR" && CONFIG_DIR="$BUILD_DIR/configs"
- export CHROOT="chroot $BUILD_ROOT"
-@@ -94,7 +94,7 @@ DO_STATISTICS=
- RUN_SHELL=
- CCACHE=
+ export BUILD_ARCH BUILD_HOST_ARCH BUILD_ROOT BUILD_RPMS BUILD_DIR BUILD_DEBUG
+@@ -107,7 +107,7 @@ CCACHE=
DLNOSIGNATURE=
+ BUILD_FLAVOR=
+ OBS_PACKAGE=
-CACHE_DIR=/var/cache/build
+CACHE_DIR=/var/cache/obs-build
+ RECIPE_BUILD_START_TIME=
- # This is for insserv
diff --git a/debian/patches/0002-Fix-Build-Zypp-parsecfg-expected-full-config-file-na.patch b/debian/patches/0002-Fix-Build-Zypp-parsecfg-expected-full-config-file-na.patch
deleted file mode 100644
index 0cda1cc..0000000
--- a/debian/patches/0002-Fix-Build-Zypp-parsecfg-expected-full-config-file-na.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 23590deedb2bf7d7482e1ec49eb735c64dce9883 Mon Sep 17 00:00:00 2001
-From: Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
-Date: Fri, 3 Oct 2014 14:28:45 +0100
-Subject: Fix Build::Zypp:parsecfg expected full config file name.
-
-Fixes #135
-
-Signed-off-by: Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
----
- Build/Zypp.pm | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Build/Zypp.pm b/Build/Zypp.pm
-index 20d020c..7518d17 100644
---- a/Build/Zypp.pm
-+++ b/Build/Zypp.pm
-@@ -28,7 +28,7 @@ sub parsecfg {
- my ($repocfg, $reponame) = @_;
-
- local *REPO;
-- open(REPO, '<', "$root/etc/zypp/repos.d/$repocfg.repo") or return undef;
-+ open(REPO, '<', "$root/etc/zypp/repos.d/$repocfg") or return undef;
- my $name;
- my $repo = {};
- while (<REPO>) {
diff --git a/debian/patches/0003-HACK-make-glibc-build.patch b/debian/patches/0003-HACK-make-glibc-build.patch
new file mode 100644
index 0000000..b449038
--- /dev/null
+++ b/debian/patches/0003-HACK-make-glibc-build.patch
@@ -0,0 +1,35 @@
+From: =?utf-8?b?SMOpY3RvciBPcsOzbiBNYXJ0w61uZXo=?= <zumbi@debian.org>
+Date: Mon, 5 Mar 2018 01:15:10 +0100
+Subject: HACK: make glibc build
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+See:
+ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844420
+
+Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+Signed-off-by: Héctor Orón Martínez <zumbi@debian.org>
+Forwarded: not-needed, Debian-specific
+Bug-Debian: http://bugs.debian.org/844420
+Last-Update: 2018-08-30
+---
+ build-recipe-debootstrap | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap
+index 9220952..2404fdc 100644
+--- a/build-recipe-debootstrap
++++ b/build-recipe-debootstrap
+@@ -68,6 +68,11 @@ recipe_build_debootstrap() {
+ cp $BUILD_ROOT/etc/hosts $BUILD_ROOT/$myroot/etc/hosts
+ fi
+
++
++ # Hack for glibc build, make localhost. resolve
++ echo "127.0.0.2 localhost." >> $BUILD_ROOT/$myroot/etc/hosts
++ cat $BUILD_ROOT/$myroot/etc/hosts
++
+ # Mount special filesystem in the debootstrap build root
+ mount -n -tproc none $BUILD_ROOT/$myroot/proc
+ mount -n -tsysfs -o ro none $BUILD_ROOT/$myroot/sys
diff --git a/debian/patches/0005-dsc-keep-everything.patch b/debian/patches/0005-dsc-keep-everything.patch
new file mode 100644
index 0000000..646c859
--- /dev/null
+++ b/debian/patches/0005-dsc-keep-everything.patch
@@ -0,0 +1,37 @@
+From: =?utf-8?b?SMOpY3RvciBPcsOzbiBNYXJ0w61uZXo=?= <zumbi@debian.org>
+Date: Mon, 5 Mar 2018 01:24:07 +0100
+Subject: dsc: keep everything
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+Debian package build dependencies allow for direct or indirect build
+cycles, when doing a full distribution build in OBS this means keeping
+the keep list gets very tedious very quickly.
+
+Adjust the default keep processing such that for Debian (dsc) builds
+everything is kept by default
+
+Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+Signed-off-by: Héctor Orón Martínez <zumbi@debian.org>
+Forwarded: https://github.com/openSUSE/obs-build/pull/342
+Last-Update: 2018-08-30
+---
+ Build.pm | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/Build.pm b/Build.pm
+index 59c17a5..8ae21b6 100644
+--- a/Build.pm
++++ b/Build.pm
+@@ -563,7 +563,9 @@ sub get_build {
+ @directdepsend = grep {!/^-/} splice(@directdepsend, @deps + 1);
+ }
+ my @extra = (@{$config->{'required'}}, @{$config->{'support'}});
+- if (@{$config->{'keep'} || []}) {
++ if ($config->{'type'} eq 'dsc') {
++ ;
++ } elsif (@{$config->{'keep'} || []}) {
+ my %keep = map {$_ => 1} (@deps, @{$config->{'keep'} || []}, @{$config->{'preinstall'}});
+ for (@{$subpacks || []}) {
+ next if $keep{$_};
diff --git a/debian/patches/Log-the-version-number-during-startup.patch b/debian/patches/Log-the-version-number-during-startup.patch
new file mode 100644
index 0000000..aba6604
--- /dev/null
+++ b/debian/patches/Log-the-version-number-during-startup.patch
@@ -0,0 +1,98 @@
+From: Simon McVittie <smcv@collabora.com>
+Date: Mon, 12 Nov 2018 17:29:03 +0000
+Subject: Log the version number during startup
+
+When testing OBS behaviour changes, it's useful to be able to look
+at a build log and see which code was running.
+
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+Forwarded: https://github.com/openSUSE/obs-build/pull/497
+---
+ Makefile | 12 +++++++++++-
+ build | 2 ++
+ common_functions | 2 ++
+ init_buildsystem | 2 ++
+ 4 files changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 41f73f3..7b2a5c9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -20,13 +20,22 @@ sysconfdir=/etc
+ DESTDIR=
+
+ all:
++ifeq ($(SCM),svn)
++ echo $(VERSION)$(SVNVER) > version
++else
++ifeq ($(SCM),git)
++ echo $(VERSION)_git$(DATE) > version
++else
++ echo $(VERSION) > version
++endif
++endif
+
+ .PHONY: test
+
+ test:
+ PERL5LIB=. prove -v
+
+-install:
++install: all
+ install -m755 -d \
+ $(DESTDIR)$(pkglibdir)/configs \
+ $(DESTDIR)$(pkglibdir)/baselibs_configs \
+@@ -83,6 +92,7 @@ install:
+ install -m644 build-recipe build-recipe-* $(DESTDIR)$(pkglibdir)
+ install -m644 build-pkg build-pkg-* $(DESTDIR)$(pkglibdir)
+ install -m644 *.pm lxc.conf $(DESTDIR)$(pkglibdir)
++ install -m644 version $(DESTDIR)$(pkglibdir)
+ install -m644 configs/* $(DESTDIR)$(pkglibdir)/configs
+ install -m644 baselibs_configs/* $(DESTDIR)$(pkglibdir)/baselibs_configs
+ install -d $(DESTDIR)$(man1dir)
+diff --git a/build b/build
+index 3ecf7e8..8e7bb18 100755
+--- a/build
++++ b/build
+@@ -121,6 +121,7 @@ umask 022
+
+ echo_help () {
+ cat << EOT
++build version: $BUILD_VERSION
+
+ Some comments for build
+ -----------------------
+@@ -1185,6 +1186,7 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
+ if test -z "$RUNNING_IN_VM" ; then
+ echo
+ echo "$HOST started \"build $RECIPEFILE\" at `date --utc`."
++ echo "build version: $BUILD_VERSION"
+ echo
+ test -n "$REASON" && echo "$REASON"
+ echo
+diff --git a/common_functions b/common_functions
+index 45f970b..e225c38 100755
+--- a/common_functions
++++ b/common_functions
+@@ -20,6 +20,8 @@
+ #
+ ################################################################
+
++BUILD_VERSION="$(cat "$BUILD_DIR/version")"
++
+ build_host_arch() {
+ : ${BUILD_HOST_ARCH:=`uname -m`}
+ # the linux kernel only knows armv7l, armv7hl is a userland definition
+diff --git a/init_buildsystem b/init_buildsystem
+index 23e1c40..d83296d 100755
+--- a/init_buildsystem
++++ b/init_buildsystem
+@@ -461,6 +461,8 @@ getcachedir() {
+ done
+ }
+
++echo "init_buildsystem version: $BUILD_VERSION"
++
+ set_build_arch
+
+ trap fail_exit EXIT
diff --git a/debian/patches/build-recipe-dsc-List-contents-of-build-results.patch b/debian/patches/build-recipe-dsc-List-contents-of-build-results.patch
new file mode 100644
index 0000000..d1e6671
--- /dev/null
+++ b/debian/patches/build-recipe-dsc-List-contents-of-build-results.patch
@@ -0,0 +1,65 @@
+From: Simon McVittie <smcv@collabora.com>
+Date: Mon, 18 Mar 2019 17:27:40 +0000
+Subject: build-recipe-dsc: List contents of build results
+
+Debian's sbuild dumps the metadata and contents of all build results
+into its own logs, which is often helpful when comparing build logs and
+package contents. Let's do the same.
+
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+Forwarded: https://github.com/openSUSE/obs-build/pull/497
+---
+ build-recipe-dsc | 33 +++++++++++++++++++++++++++++++++
+ 1 file changed, 33 insertions(+)
+
+diff --git a/build-recipe-dsc b/build-recipe-dsc
+index 3ee4077..3bf145e 100644
+--- a/build-recipe-dsc
++++ b/build-recipe-dsc
+@@ -86,6 +86,8 @@ EOF
+
+ dsc_build() {
+ local buildroot=$1
++ local changes
++ local f
+
+ DSC_BUILD_OPTIONS=
+ if test -n "$BUILD_JOBS" ; then
+@@ -106,6 +108,37 @@ dsc_build() {
+ chroot $buildroot su -
+ else
+ chroot $buildroot su -c "export DEB_BUILD_OPTIONS=${DSC_BUILD_OPTIONS} ; cd $TOPDIR/BUILD && $DSC_BUILD_CMD" - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true
++
++ for changes in "$buildroot/$TOPDIR"/*.changes ; do
++ echo
++ echo "==== $(basename "$changes") ===="
++ echo
++ cat "$changes"
++ echo
++
++ while read f ; do
++ case "$f" in
++ (*.buildinfo)
++ echo "==== $f ===="
++ echo
++ cat "$buildroot/$TOPDIR/$f"
++ echo
++ esac
++ done < <(sed -ne '/Files:/,$s/^ ................................ [0-9][0-9]* [^ ]* [^ ]* //p' "$changes")
++
++ while read f ; do
++ case "$f" in
++ (*.deb|*.ddeb|*.udeb)
++ echo "==== $f ===="
++ echo
++ chroot "$buildroot" su -c "dpkg-deb --info $(printf '%q' "$TOPDIR/$f")" - "$BUILD_USER" < /dev/null || true
++ echo
++ chroot "$buildroot" su -c "dpkg-deb --contents $(printf '%q' "$TOPDIR/$f")" - "$BUILD_USER" < /dev/null || true
++ echo
++ esac
++ done < <(sed -ne '/Files:/,$s/^ ................................ [0-9][0-9]* [^ ]* [^ ]* //p' "$changes")
++ done
++
+ if test "$BUILD_SUCCEEDED" = true -a "$DO_CHECKS" != "false" && ( chroot $buildroot su -c "which lintian > /dev/null" - $BUILD_USER < /dev/null ); then
+ DEB_CHANGESFILE=${DEB_DSCFILE%.dsc}$OBS_DCH_RELEASE"_"$(chroot $buildroot su -c 'dpkg-architecture -qDEB_BUILD_ARCH')".changes"
+ chroot $buildroot su -c "cd $TOPDIR && echo Running lintian && (set -x && lintian -i $TOPDIR/$DEB_CHANGESFILE)" - $BUILD_USER < /dev/null || BUILD_SUCCEEDED=false
diff --git a/debian/patches/build-recipe-dsc-Move-all-build-results-not-just-.deb-and.patch b/debian/patches/build-recipe-dsc-Move-all-build-results-not-just-.deb-and.patch
new file mode 100644
index 0000000..480931b
--- /dev/null
+++ b/debian/patches/build-recipe-dsc-Move-all-build-results-not-just-.deb-and.patch
@@ -0,0 +1,46 @@
+From: Simon McVittie <smcv@collabora.com>
+Date: Mon, 18 Mar 2019 17:26:43 +0000
+Subject: build-recipe-dsc: Move all build results,
+ not just *.deb and *.changes
+
+The purpose of the changes file is to list everything that is to be
+installed into the Debian (or derivative) archive, including *.deb,
+*.udeb (micro-debs for the Debian installer), *.ddeb (detached debug
+symbols, in Ubuntu and its derivatives) and *.buildinfo (details of the
+build environment, mainly for reproducible builds). If we're providing
+an equivalent of the Debian archive, then we should include all the
+same files.
+
+This change ensures that all build products get moved into the right
+place, even if they are file types that obs-build doesn't yet know about,
+or even file types that haven't been invented yet.
+
+When obs-build is used in conjunction with OBS, changes to bs_publish
+are also likely to be necessary for a full-stack solution.
+
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+Forwarded: https://github.com/openSUSE/obs-build/pull/496
+---
+ build-recipe-dsc | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/build-recipe-dsc b/build-recipe-dsc
+index c104890..3ee4077 100644
+--- a/build-recipe-dsc
++++ b/build-recipe-dsc
+@@ -114,8 +114,13 @@ dsc_build() {
+ }
+
+ dsc_move_build_result() {
+- for DEB in $BUILD_ROOT/$TOPDIR/*.{deb,changes} ; do
+- test -e "$DEB" && mv "$DEB" "$BUILD_ROOT/$TOPDIR/DEBS"
++ local changes
++
++ for changes in $BUILD_ROOT/$TOPDIR/*.changes ; do
++ while read f ; do
++ mv "$BUILD_ROOT/$TOPDIR/$f" "$BUILD_ROOT/$TOPDIR/DEBS/"
++ done < <(sed -ne '/Files:/,$s/^ ................................ [0-9][0-9]* [^ ]* [^ ]* //p' "$changes")
++ mv "$changes" "$BUILD_ROOT/$TOPDIR/DEBS"
+ done
+
+ # link used sources over to DEB directory
diff --git a/debian/patches/build-recipe-dsc-Show-information-about-the-build-chroot.patch b/debian/patches/build-recipe-dsc-Show-information-about-the-build-chroot.patch
new file mode 100644
index 0000000..eebaed5
--- /dev/null
+++ b/debian/patches/build-recipe-dsc-Show-information-about-the-build-chroot.patch
@@ -0,0 +1,49 @@
+From: Simon McVittie <smcv@collabora.com>
+Date: Mon, 18 Mar 2019 17:34:00 +0000
+Subject: build-recipe-dsc: Show information about the build chroot
+
+This vaguely mimics what Debian's sbuild does, although the precise
+information given here is different.
+
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+Forwarded: https://github.com/openSUSE/obs-build/pull/497
+---
+ build-recipe-dsc | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+diff --git a/build-recipe-dsc b/build-recipe-dsc
+index 3bf145e..86a5016 100644
+--- a/build-recipe-dsc
++++ b/build-recipe-dsc
+@@ -89,6 +89,31 @@ dsc_build() {
+ local changes
+ local f
+
++ echo "==== Kernel ===="
++ echo
++ uname -a || true
++ echo
++
++ echo "==== Filesystems in build chroot ===="
++ echo
++ chroot "$buildroot" su -c "cat /proc/self/mountinfo" - "$BUILD_USER" < /dev/null || true
++ echo
++
++ echo "==== User identity in build chroot ===="
++ echo
++ chroot "$buildroot" su -c "id" - "$BUILD_USER" < /dev/null || true
++ echo
++
++ echo "==== Environment variables in build chroot ===="
++ echo
++ chroot "$buildroot" su -c "env | LC_ALL=C sort -u" - "$BUILD_USER" < /dev/null || true
++ echo
++
++ echo "==== Packages installed in build chroot ===="
++ echo
++ chroot "$buildroot" su -c "dpkg-query -W" - "$BUILD_USER" < /dev/null || true
++ echo
++
+ DSC_BUILD_OPTIONS=
+ if test -n "$BUILD_JOBS" ; then
+ DSC_BUILD_OPTIONS="parallel=${BUILD_JOBS}"
diff --git a/debian/patches/build-recipe-dsc-don-t-rebuild-the-source-package.patch b/debian/patches/build-recipe-dsc-don-t-rebuild-the-source-package.patch
new file mode 100644
index 0000000..f32a7ac
--- /dev/null
+++ b/debian/patches/build-recipe-dsc-don-t-rebuild-the-source-package.patch
@@ -0,0 +1,28 @@
+From: Andrew Shadura <andrew.shadura@collabora.co.uk>
+Date: Mon, 6 Nov 2017 10:22:03 +0100
+Subject: build-recipe-dsc: don't rebuild the source package
+
+If we use build suffixes, rebuilding the source package will
+result in the build suffix being included into the source package,
+which we'd rather avoid.
+
+Signed-off-by: Andrew Shadura <andrew.shadura@collabora.co.uk>
+Forwarded: https://github.com/openSUSE/obs-build/pull/459
+Last-Update: 2018-08-30
+---
+ build-recipe-dsc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build-recipe-dsc b/build-recipe-dsc
+index 79cfc66..c104890 100644
+--- a/build-recipe-dsc
++++ b/build-recipe-dsc
+@@ -95,7 +95,7 @@ dsc_build() {
+ # this allows the build environment to be manipulated
+ # and alternate build commands can be used
+ DSC_BUILD_CMD="$(queryconfig --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$CONFIG_DIR" substitute dsc:build_cmd)"
+- test -z "$DSC_BUILD_CMD" && DSC_BUILD_CMD="dpkg-buildpackage -us -uc"
++ test -z "$DSC_BUILD_CMD" && DSC_BUILD_CMD="dpkg-buildpackage -us -uc -b"
+ if test -e $buildroot/$TOPDIR/SOURCES/build.script ; then
+ echo "Sourcing build.script to build - it should normally run 'dpkg-buildpackage -us -uc'"
+ DSC_BUILD_CMD="source $TOPDIR/SOURCES/build.script"
diff --git a/debian/patches/deb-Install-policy-rc.d-to-prevent-services-from-starting.patch b/debian/patches/deb-Install-policy-rc.d-to-prevent-services-from-starting.patch
new file mode 100644
index 0000000..7f7d995
--- /dev/null
+++ b/debian/patches/deb-Install-policy-rc.d-to-prevent-services-from-starting.patch
@@ -0,0 +1,46 @@
+From: Dan Nicholson <nicholson@endlessm.com>
+Date: Thu, 3 Jan 2019 11:31:45 -0600
+Subject: deb: Install policy-rc.d to prevent services from starting
+
+Per invoke-rc.d(8), a local policy script can be created at
+/usr/sbin/policy-rc.d to influence how services are started. When this
+script exits with code 101, the requested service is not started. This
+is independent of init system and is respected by all maintainer
+scripts that comply with debian policy.
+
+This is how debootstrap prevents services from running in the chroot. On
+more recent debian and ubuntu releases where systemd is in use, it will
+prevent services from starting by detecting that it's in a chroot, but
+this method works independently of the init system. In our case this
+fixes builds on Ubuntu Trusty where upstart is init. This change likely
+makes the hack to replace /sbin/start with a symlink to /sbin/true
+unnecessary. That hack is not comprehensive since it only handles the
+start action and not stop, restart, reload, etc.
+
+Forwarded: https://github.com/openSUSE/obs-build/pull/484
+Applied-upstream: commit:fdb38b34afa8c91eaad37582ab5cedbd06a7817d
+---
+ build-pkg-deb | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/build-pkg-deb b/build-pkg-deb
+index c5959c0..4437149 100644
+--- a/build-pkg-deb
++++ b/build-pkg-deb
+@@ -48,6 +48,16 @@ deb_setup() {
+ :>> $BUILD_ROOT/var/lib/dpkg/available
+ :>> $BUILD_ROOT/var/log/dpkg.log
+ :>> $BUILD_ROOT/etc/ld.so.conf
++
++ # Install a policy so that services are not started. See
++ # https://manpages.debian.org/unstable/init-system-helpers/invoke-rc.d.8.en.html
++ # for details.
++ mkdir -p $BUILD_ROOT/usr/sbin
++ cat > $BUILD_ROOT/usr/sbin/policy-rc.d <<EOF
++#!/bin/sh
++exit 101
++EOF
++ chmod 755 $BUILD_ROOT/usr/sbin/policy-rc.d
+ }
+
+ pkg_initdb_deb() {
diff --git a/debian/patches/deb-Show-version-of-each-package-that-we-preinstall.patch b/debian/patches/deb-Show-version-of-each-package-that-we-preinstall.patch
new file mode 100644
index 0000000..d80deb6
--- /dev/null
+++ b/debian/patches/deb-Show-version-of-each-package-that-we-preinstall.patch
@@ -0,0 +1,25 @@
+From: Simon McVittie <smcv@collabora.com>
+Date: Mon, 12 Nov 2018 17:08:17 +0000
+Subject: deb: Show version of each package that we preinstall
+
+If packages fail to unpack or configure during the preinstall step,
+it's useful for the log to indicate precisely which packages were used.
+
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+Forwarded: https://github.com/openSUSE/obs-build/pull/497
+---
+ build-pkg-deb | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/build-pkg-deb b/build-pkg-deb
+index 4437149..3741b55 100644
+--- a/build-pkg-deb
++++ b/build-pkg-deb
+@@ -137,6 +137,7 @@ pkg_preinstall_deb() {
+ elif test -f "control.tar.xz" ; then
+ $TAR -C .init_b_cache/scripts/control -J -f control.tar.xz
+ fi
++ grep '^Version:' .init_b_cache/scripts/control/control || echo 'Version: unknown'
+ if test -f "data.tar.gz" ; then
+ $TAR -z -f data.tar.gz
+ elif test -f "data.tar.xz" ; then
diff --git a/debian/patches/debootstrap-Print-the-exact-command-we-re-going-to-run.patch b/debian/patches/debootstrap-Print-the-exact-command-we-re-going-to-run.patch
new file mode 100644
index 0000000..398665a
--- /dev/null
+++ b/debian/patches/debootstrap-Print-the-exact-command-we-re-going-to-run.patch
@@ -0,0 +1,32 @@
+From: Simon McVittie <smcv@collabora.com>
+Date: Mon, 12 Nov 2018 16:58:56 +0000
+Subject: debootstrap: Print the exact command we're going to run
+
+debootstrap is not a simple command, and there are some subtleties to
+the options we use, so we should log exactly what we did.
+
+The incantation with `$(printf ' %q' "$@")` is to log the contents
+of $@, correctly shell-quoted to avoid ambiguity (in case there are
+spaces in an argument). It should expand to something like
+
+ running debootstrap: chroot /buildroot debootstrap --etc --etc...
+
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+Forwarded: https://github.com/openSUSE/obs-build/pull/497
+---
+ build-recipe-debootstrap | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap
+index 2e72fef..55c6191 100644
+--- a/build-recipe-debootstrap
++++ b/build-recipe-debootstrap
+@@ -53,7 +53,7 @@ recipe_build_debootstrap() {
+ echo force-unsafe-io > "$BUILD_ROOT/$myroot/etc/dpkg/dpkg.cfg.d/force-unsafe-io"
+
+ set -- chroot $BUILD_ROOT debootstrap --keep-debootstrap-dir --no-check-gpg --variant=buildd --arch="${arch}" --include="$FULL_PKG_LIST" "$dist" "$myroot" file:///.build.binaries
+- echo "running debootstrap..."
++ echo "running debootstrap:$(printf ' %q' "$@")..."
+ if ! "$@" || ! chroot $BUILD_ROOT dpkg --configure -a; then
+ cat $BUILD_ROOT/$myroot/debootstrap/debootstrap.log
+ cleanup_and_exit 1 "Failed to setup debootstrap chroot"
diff --git a/debian/patches/debootstrap-add-fallback-for-Debian-SID-distro.patch b/debian/patches/debootstrap-add-fallback-for-Debian-SID-distro.patch
new file mode 100644
index 0000000..82c1f3f
--- /dev/null
+++ b/debian/patches/debootstrap-add-fallback-for-Debian-SID-distro.patch
@@ -0,0 +1,39 @@
+From: =?utf-8?b?SMOpY3RvciBPcsOzbiBNYXJ0w61uZXo=?=
+ <hector.oron@collabora.co.uk>
+Date: Mon, 6 Nov 2017 15:55:02 +0100
+Subject: debootstrap: add fallback for Debian SID distro
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+ When attempting to build Debian unstable, distribution is
+ calculated using lsb, which relies on apt cache. As our
+ build systems lack apt cache and network we cannot detect
+ we are building for Debian SID (aka unstable).
+ For more background information see: DebianBug#845651
+
+Signed-off-by: Héctor Orón Martínez <hector.oron@collabora.co.uk>
+Tested-by: Héctor Orón Martínez <hector.oron@collabora.co.uk>
+Forwarded: https://github.com/openSUSE/obs-build/pull/460
+Last-Update: 2018-08-30
+---
+ build-recipe-debootstrap | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap
+index 2404fdc..f28cdfc 100644
+--- a/build-recipe-debootstrap
++++ b/build-recipe-debootstrap
+@@ -31,7 +31,11 @@ recipe_prepare_debootstrap() {
+
+ recipe_build_debootstrap() {
+ local arch=$(chroot $BUILD_ROOT su -c "dpkg-architecture -qDEB_BUILD_ARCH")
+- local dist=$(chroot $BUILD_ROOT su -c "lsb_release --codename --short")
++ if $(chroot $BUILD_ROOT grep -q '/sid' /etc/debian_version) ; then
++ local dist=unstable
++ else
++ local dist=$(chroot $BUILD_ROOT su -c "lsb_release --codename --short")
++ fi
+ local myroot=debootstraproot
+ test -d $BUILD_ROOT/.build.binaries || cleanup_and_exit 1
+ if test "$DO_INIT" = true -o ! -d "$BUILD_ROOT/.build.binaries/dists" ; then
diff --git a/debian/patches/series b/debian/patches/series
index 24ce1f5..a370ad6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,12 @@
-0001-Use-obs-build-in-locations-and-executable-names-inst.patch
-0002-Fix-Build-Zypp-parsecfg-expected-full-config-file-na.patch
+0001-Use-obs-build-in-locations-and-executable-names.patch
+0003-HACK-make-glibc-build.patch
+0005-dsc-keep-everything.patch
+build-recipe-dsc-don-t-rebuild-the-source-package.patch
+debootstrap-add-fallback-for-Debian-SID-distro.patch
+deb-Install-policy-rc.d-to-prevent-services-from-starting.patch
+build-recipe-dsc-Move-all-build-results-not-just-.deb-and.patch
+Log-the-version-number-during-startup.patch
+debootstrap-Print-the-exact-command-we-re-going-to-run.patch
+deb-Show-version-of-each-package-that-we-preinstall.patch
+build-recipe-dsc-List-contents-of-build-results.patch
+build-recipe-dsc-Show-information-about-the-build-chroot.patch