diff options
author | Héctor Orón Martínez <zumbi@debian.org> | 2018-03-05 00:43:17 +0100 |
---|---|---|
committer | Héctor Orón Martínez <zumbi@debian.org> | 2018-03-05 00:43:17 +0100 |
commit | 44825c65ec83022b176cee6e199624c8a445516e (patch) | |
tree | 26700140960f972e06d8eaa0fd9da31d675eb153 | |
parent | f16649f6e323883d7d79aed6c2f8122510eb2d38 (diff) |
Import Debian packaging
Signed-off-by: Héctor Orón Martínez <zumbi@debian.org>
27 files changed, 798 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..c9b6c57 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,90 @@ +obs-build (20180302-1) UNRELEASED; urgency=medium + + * New upstream release + + -- Héctor Orón Martínez <zumbi@debian.org> Mon, 05 Mar 2018 00:34:41 +0100 + +obs-build (20170201-3) unstable; urgency=medium + + [ Sjoerd Simons ] + * Added a selection of patches to improve full-distro builds: + - dsc-Keep-everything.patch + - deboostrap-Enable-dpkg-unsafe-io-usage.patch + - HACK-Make-glibc-build.patch + - debootstrap-generate-apt-caches.patch + + [ Andrew Lee (李健秋) ] + * Added depends to sudo, libarchive-tools. (Closes: #866580) + * debian/source/options: drop no-preparation as it breaks pbuilder. + + -- Andrew Lee (李健秋) <ajqlee@debian.org> Sat, 05 Aug 2017 05:24:36 +0800 + +obs-build (20170201-2) unstable; urgency=medium + + * Refine exist and import new patches: + - 0001-Correct-debootstrap-log-path.patch (Closes: #854563) + - 0002-deb-Force-unsafe-io-when-install-packages.patch + - 0003-snapcraft-Drop-duplicated-code.patch + - 0004-livebuild-Only-create-symlinks-after-dpkg-scanpackag.patch + - 0005-debootstrap-Ensure-etc-hosts-exists.patch + - 0006-debootstrap-Mount-virtual-filesystems-in-the-deboots.patch + (Closes: 854557) + - 0007-debootstrap-Always-try-to-unmount-binfmt_misc.patch + (Closes: #854559) + - 0008-debootstrap-Improve-devpts-mounting.patch (Closes: #854558) + * Add patch to prevent creation of an empty rcS. + + -- Andrew Lee (李健秋) <ajqlee@debian.org> Fri, 17 Feb 2017 19:40:45 +0800 + +obs-build (20170201-1) unstable; urgency=medium + + * New upstream release. (Closes: #853145) + * Refreshed 0001-Use-obs-build-in-locations-and-executable-names-inst.patch. + * Fix debootstrap recipe fails when building for xenial: (Closes: #853144) + - 0001-snapcraft-Drop-duplicated-code.patch + - 0002-livebuild-Only-create-symlinks-after-dpkg-scanpackag.patch + * Fix debootstrap build chroot not completely setup: (Closes: #853292) + - 0001-debootstrap-Ensure-etc-hosts-exists.patch + - 0002-debootstrap-Mount-virtual-filesystems-in-the-deboots.patch + * debian/rules: drop not executable fix that already included upstream. + + -- Andrew Lee (李健秋) <ajqlee@debian.org> Thu, 02 Feb 2017 21:45:10 +0800 + +obs-build (20160921-1) unstable; urgency=medium + + [ Andrew Lee (李健秋) ] + * New upstream release. (Closes: #786404, #796522) + * Drop 0002-Fix-Build-Zypp-parsecfg-expected-full-config-file-na.patch: + included upstream. + * Refreshed 0001-Use-obs-build-in-locations-and-executable-names-inst.patch. + * Bump standard-version to 3.9.8. + * debian/control: Added misc depends. + * debian/control: depends on debootstrap. + * debian/copyright: added missing gpl-2 and gpl-3 licenses paragraph. + + [ Héctor Orón Martínez ] + * debian/control: add new maintainership to RPM packaging team + * debian/control: add new uploaders Andrew and myself + + -- Héctor Orón Martínez <zumbi@debian.org> Fri, 23 Sep 2016 15:49:42 +0200 + +obs-build (20141024-1.1) unstable; urgency=medium + + * Non-maintainer upload. + * 0010_find-perm_slash.diff: Use "find -perm /x" instead of "find -perm +x". + Closes: #808918 + + -- Andreas Metzler <ametzler@debian.org> Tue, 29 Dec 2015 14:21:18 +0100 + +obs-build (20141024-1) unstable; urgency=medium + + * New upstream snapshot. + * Update copyright, explicit GPL 2 or 3. + + -- Dimitri John Ledkov <dimitri.j.ledkov@linux.intel.com> Sat, 25 Oct 2014 02:30:05 +0100 + +obs-build (20140918-1) unstable; urgency=medium + + * Initial release. (Closes: #762949) + + -- Dimitri John Ledkov <dimitri.j.ledkov@linux.intel.com> Wed, 01 Oct 2014 11:46:00 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..c084397 --- /dev/null +++ b/debian/control @@ -0,0 +1,20 @@ +Source: obs-build +Section: devel +Priority: extra +Maintainer: RPM packaging team <pkg-rpm-devel@lists.alioth.debian.org> +Uploaders: Dimitri John Ledkov <dimitri.j.ledkov@linux.intel.com>, + Andrew Lee (李健秋) <ajqlee@debian.org>, + Héctor Orón Martínez <zumbi@debian.org> +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.8 + +Package: obs-build +Architecture: all +Depends: + ${misc:Depends}, ${perl:Depends}, rpm, debootstrap, sudo, libarchive-tools +Recommends: rpm2cpio, osc, libcrypt-ssleay-perl +Description: scripts for building RPM/debian packages for multiple distributions + This package provides scripts for building RPM and debian packages in + contained environments for various build distributions. These tools + are use by Open Build Service workers and openSUSE distribution by + default. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..5df65f4 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,67 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: obs-build +Upstream-Contact: Adrian Schröter <adrian@suse.de> +Source: https://github.com/openSUSE/obs-build + + +Files: * +Copyright: 1997-2014 SuSE GmbH Nuernberg, Germany +License: GPL-2 or GPL-3 + +Files: debian/* +Copyright: 2014 Intel Corporation +License: GPL-2+ + This program is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 or 3 of the License, or (at your option) any later + version. + . + This program is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the GNU General Public License for more + details. + . + You should have received a copy of the GNU General Public + License along with this package; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301 USA + . + On Debian systems, the full text of the GNU General Public + License version 2 can be found in the file + `/usr/share/common-licenses/GPL-2'. + +License: GPL-2 + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + . + On Debian systems, the complete text of the GNU General + Public License can be found in `/usr/share/common-licenses/GPL-2'. + +License: GPL-3 + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; under version 3 of the License. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses>. + . + On Debian systems, the full text of the GNU General Public License + version 3 can be found in the file `/usr/share/common-licenses/GPL-3'. + diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..e845566 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README diff --git a/debian/links b/debian/links new file mode 100644 index 0000000..a6a9c11 --- /dev/null +++ b/debian/links @@ -0,0 +1 @@ +usr/lib/obs-build/configs/sl11.1.conf usr/lib/obs-build/configs/sles11.conf diff --git a/debian/patches/0001-Correct-debootstrap-log-path.patch b/debian/patches/0001-Correct-debootstrap-log-path.patch new file mode 100644 index 0000000..a90b31c --- /dev/null +++ b/debian/patches/0001-Correct-debootstrap-log-path.patch @@ -0,0 +1,29 @@ +From 017eb18799c4746c5b2ae77f07ff0c667e57774c Mon Sep 17 00:00:00 2001 +From: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +Date: Tue, 31 Jan 2017 09:22:22 +0100 +Subject: [PATCH 1/8] Correct debootstrap log path + +Debootstrap logs into the the debootstrapped root, so pull the log from +there rather then the build root. + +Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +--- + build-recipe-debootstrap | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap +index 65bbfbd..74049fc 100644 +--- a/build-recipe-debootstrap ++++ b/build-recipe-debootstrap +@@ -48,7 +48,7 @@ recipe_build_debootstrap() { + 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..." + if ! "$@" || ! chroot $BUILD_ROOT dpkg --configure -a; then +- cat $BUILD_ROOT/debootstrap/debootstrap.log ++ cat $BUILD_ROOT/$myroot/debootstrap/debootstrap.log + cleanup_and_exit 1 "Failed to setup debootstrap chroot" + fi + +-- +2.1.4 + 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-inst.patch new file mode 100644 index 0000000..68d4bd5 --- /dev/null +++ b/debian/patches/0001-Use-obs-build-in-locations-and-executable-names-inst.patch @@ -0,0 +1,63 @@ +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. + +Signed-off-by: Dimitri John Ledkov <dimitri.j.ledkov@intel.com> +--- + Makefile | 13 +++++++------ + build | 6 +++--- + 2 files changed, 10 insertions(+), 9 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -1,7 +1,7 @@ + VERSION=0.1 + SCM=$(shell if test -d .svn; then echo svn; elif test -d .git; then echo git; fi) + DATE=$(shell date +%Y%m%d%H%M) +-BUILD=build ++BUILD=obs-build + + INITVM_ARCH=$(shell bash -c '. common_functions ; build_host_arch; echo $$BUILD_INITVM_ARCH') + +@@ -74,11 +74,12 @@ + install -m644 build-pkg build-pkg-* $(DESTDIR)$(pkglibdir) + install -m644 *.pm baselibs_global*.conf lxc.conf $(DESTDIR)$(pkglibdir) + install -m644 configs/* $(DESTDIR)$(pkglibdir)/configs +- install -m644 build.1 $(DESTDIR)$(man1dir) +- install -m644 vc.1 $(DESTDIR)$(man1dir) +- install -m644 unrpm.1 $(DESTDIR)$(man1dir) +- ln -sf $(pkglibdir)/build $(DESTDIR)$(bindir)/build +- ln -sf $(pkglibdir)/vc $(DESTDIR)$(bindir)/buildvc ++ install -d $(DESTDIR)$(man1dir) ++ install -T -m644 build.1 $(DESTDIR)$(man1dir)/obs-build.1 ++ install -T -m644 vc.1 $(DESTDIR)$(man1dir)/obs-buildvc.1 ++ install -T -m644 unrpm.1 $(DESTDIR)$(man1dir)/unrpm.1 ++ 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 +--- a/build ++++ b/build +@@ -36,8 +36,8 @@ + 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 +-test -z "$BUILD_ROOT" && BUILD_ROOT=/var/tmp/build-root ++test -z "$BUILD_DIR" && BUILD_DIR=/usr/lib/obs-build ++test -z "$BUILD_ROOT" && BUILD_ROOT=/var/tmp/obs-build-root + test -z "$CONFIG_DIR" && CONFIG_DIR="$BUILD_DIR/configs" + + export BUILD_ARCH BUILD_HOST_ARCH BUILD_ROOT BUILD_RPMS BUILD_DIR BUILD_DEBUG +@@ -104,7 +104,7 @@ + RUN_SHELL= + CCACHE= + DLNOSIGNATURE= +-CACHE_DIR=/var/cache/build ++CACHE_DIR=/var/cache/obs-build + + + # This is for insserv diff --git a/debian/patches/0002-deb-Force-unsafe-io-when-install-packages.patch b/debian/patches/0002-deb-Force-unsafe-io-when-install-packages.patch new file mode 100644 index 0000000..042993b --- /dev/null +++ b/debian/patches/0002-deb-Force-unsafe-io-when-install-packages.patch @@ -0,0 +1,42 @@ +From 39456cc6f91538a4ad3cb328993b2b98c8d3757b Mon Sep 17 00:00:00 2001 +From: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +Date: Tue, 31 Jan 2017 10:17:18 +0100 +Subject: [PATCH 2/8] deb: Force unsafe io when install packages + +As the worker roots are transient there is little point in syncing +everything to the filesystem, force dpkg to use unsafe-io. + +unsafe-io has been present in dpkg 1.15.8.6, which is older then the +dpkg on any still supported debian or ubuntu release, so should be safe +to do unconditionally + +Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +--- + build-pkg-deb | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/build-pkg-deb b/build-pkg-deb +index 2465204..0849f60 100644 +--- a/build-pkg-deb ++++ b/build-pkg-deb +@@ -58,7 +58,7 @@ pkg_initdb_deb() { + rm -f $BUILD_ROOT/.init_b_cache/dpkg.deb + cp $BUILD_ROOT/.init_b_cache/rpms/dpkg.deb $BUILD_ROOT/.init_b_cache/dpkg.deb || cleanup_and_exit 1 + fi +- deb_chroot $BUILD_ROOT dpkg --install --force-depends .init_b_cache/dpkg.deb >/dev/null 2>&1 ++ deb_chroot $BUILD_ROOT dpkg --install --force-unsafe-io --force-depends .init_b_cache/dpkg.deb >/dev/null 2>&1 + } + + pkg_prepare_deb() { +@@ -66,7 +66,7 @@ pkg_prepare_deb() { + } + + pkg_install_deb() { +- ( deb_chroot $BUILD_ROOT dpkg --install --force-depends .init_b_cache/$PKG.deb 2>&1 || touch $BUILD_ROOT/exit ) | \ ++ ( deb_chroot $BUILD_ROOT dpkg --install --force-unsafe-io --force-depends .init_b_cache/$PKG.deb 2>&1 || touch $BUILD_ROOT/exit ) | \ + perl -ne '$|=1;/^(Configuration file|Installing new config file|Selecting previously deselected|Selecting previously unselected|\(Reading database|Unpacking |Setting up|Creating config file|Preparing to replace dpkg|Preparing to unpack )/||/^$/||print' + # ugly workaround for upstart system. some packages (procps) try + # to start a service in their configure phase. As we don't have +-- +2.1.4 + diff --git a/debian/patches/0003-snapcraft-Drop-duplicated-code.patch b/debian/patches/0003-snapcraft-Drop-duplicated-code.patch new file mode 100644 index 0000000..9de76a9 --- /dev/null +++ b/debian/patches/0003-snapcraft-Drop-duplicated-code.patch @@ -0,0 +1,97 @@ +From 68985d2edf7bb88b8d3405f242514f69e610b520 Mon Sep 17 00:00:00 2001 +From: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +Date: Fri, 27 Jan 2017 11:27:11 +0100 +Subject: [PATCH 3/8] snapcraft: Drop duplicated code + +Snapcraft has a copy of createrepo_debian from the livebuild recipe. +Given that build-recipe sources all the variations this means only one +of the two functions actually gets used. + +As the origin is clearly from the livebuild recipe, drop the snapcraft +copy. + +Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +--- + build-recipe-snapcraft | 66 -------------------------------------------------- + 1 file changed, 66 deletions(-) + +diff --git a/build-recipe-snapcraft b/build-recipe-snapcraft +index e4b5e98..1a54e5f 100644 +--- a/build-recipe-snapcraft ++++ b/build-recipe-snapcraft +@@ -42,72 +42,6 @@ recipe_prepare_snapcraft() { + : + } + +-createrepo_debian() { +- local DIR=${1} +- local ARCH=${2} +- local DIST=${3} +- +- if [ -z "${DIR}" -o ! -d ${DIR} -o ${DIR} = ${DIR##${BUILD_ROOT}} ] ; then +- return +- fi +- +- pushd ${DIR} >/dev/null +- +- # cleanup existing repository files +- rm -f Packages Packages.gz Release +- rm -fr dists +- +- mkdir -p dists/${DIST} +- # Suite is symlinked to Codename +- ln -s ${DIST} dists/stable +- +- # create Packages and Sources files +- mkdir -p dists/${DIST}/main/binary-${ARCH} +- mkdir -p dists/${DIST}/main/source +- cat > ${BUILD_ROOT}/.createrepo_debian.tmp.sh <<-EOF +- cd /.build.binaries || exit 1 +- dpkg-scanpackages -m . > dists/${DIST}/main/binary-${ARCH}/Packages +- gzip -c9 < dists/${DIST}/main/binary-${ARCH}/Packages \ +- > dists/${DIST}/main/binary-${ARCH}/Packages.gz +- dpkg-scansources . > dists/${DIST}/main/source/Sources +- gzip -c9 dists/${DIST}/main/source/Sources \ +- > dists/${DIST}/main/source/Sources.gz +- EOF +- chroot $BUILD_ROOT su -c "sh /.createrepo_debian.tmp.sh" - root +- local RESULT=$? +- rm -f $BUILD_ROOT/.createrepo_debian.tmp.sh +- [ "${RESULT}" != 0 ] && return +- +- # create Release file +- pushd dists/${DIST} >/dev/null +- cat > Release <<-EOF +- Origin: Debian +- Label: Debian +- Suite: stable +- Version: 7.1 +- Codename: ${DIST} +- Date: Sat, 15 Jun 2013 10:55:26 UTC +- Description: Debian repository created by build-recipe-livebuild +- Components: main +- EOF +- echo "SHA256:" >> Release +- for file in main/binary-${ARCH}/Packages* ; do +- local SUM=( $(sha256sum ${file}) ) +- local SIZE=$(stat -c '%s' ${file}) +- echo " ${SUM} ${SIZE} ${file}" >> Release +- done +- for file in main/source/Sources* ; do +- local SUM=( $(sha256sum ${file}) ) +- local SIZE=$(stat -c '%s' ${file}) +- echo " ${SUM} ${SIZE} ${file}" >> Release +- done +- popd >/dev/null +- +- # TODO: this is missing the signature with the private key +- +- popd >/dev/null +-} +- + collect_prebuild_parts() { + + mkdir -p $BUILD_ROOT/root/.local/share/snapcraft/ +-- +2.1.4 + diff --git a/debian/patches/0004-livebuild-Only-create-symlinks-after-dpkg-scanpackag.patch b/debian/patches/0004-livebuild-Only-create-symlinks-after-dpkg-scanpackag.patch new file mode 100644 index 0000000..e7ee58e --- /dev/null +++ b/debian/patches/0004-livebuild-Only-create-symlinks-after-dpkg-scanpackag.patch @@ -0,0 +1,45 @@ +From 0c9f074e26a601b81a4e4fff3b31b9a88f4c698a Mon Sep 17 00:00:00 2001 +From: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +Date: Fri, 27 Jan 2017 11:33:19 +0100 +Subject: [PATCH 4/8] livebuild: Only create symlinks after dpkg-scanpackages + +Some versions of dpkg have a bug where dpkg-scanpackages bails out if it +spots symlinks (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809219) + +Work around this by only setting up the symlinks *after* running +scanpackages + +Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +--- + build-recipe-livebuild | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/build-recipe-livebuild b/build-recipe-livebuild +index c53b69b..cfc0641 100644 +--- a/build-recipe-livebuild ++++ b/build-recipe-livebuild +@@ -56,8 +56,6 @@ createrepo_debian() { + rm -fr dists + + mkdir -p dists/${DIST} +- # Suite is symlinked to Codename +- ln -s ${DIST} dists/stable + + # create Packages and Sources files + mkdir -p dists/${DIST}/main/binary-${ARCH} +@@ -76,6 +74,12 @@ createrepo_debian() { + rm -f $BUILD_ROOT/.createrepo_debian.tmp.sh + [ "${RESULT}" != 0 ] && return + ++ # Only add symlinks after running dpkg-scanpackages to avoid ++ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809219, which is at ++ # least present in the Ubuntu xenial version of dpkg ++ # Suite is symlinked to Codename ++ ln -s ${DIST} dists/stable ++ + # create Release file + pushd dists/${DIST} >/dev/null + cat > Release <<-EOF +-- +2.1.4 + diff --git a/debian/patches/0005-debootstrap-Ensure-etc-hosts-exists.patch b/debian/patches/0005-debootstrap-Ensure-etc-hosts-exists.patch new file mode 100644 index 0000000..85010b6 --- /dev/null +++ b/debian/patches/0005-debootstrap-Ensure-etc-hosts-exists.patch @@ -0,0 +1,31 @@ +From 08c4e3c12ace96779547ecd1130088d544cb023d Mon Sep 17 00:00:00 2001 +From: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +Date: Tue, 31 Jan 2017 09:46:55 +0100 +Subject: [PATCH 5/8] debootstrap: Ensure /etc/hosts exists + +a debootstrap won't necesserily create /etc/hosts, so copy it from the +main buildroot if it's not there. + +Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +--- + build-recipe-debootstrap | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap +index 65bbfbd..ae52dc0 100644 +--- a/build-recipe-debootstrap ++++ b/build-recipe-debootstrap +@@ -61,6 +61,10 @@ recipe_build_debootstrap() { + chown "$ABUILD_UID:$ABUILD_GID" $BUILD_ROOT/$myroot/home/abuild + fi + ++ if ! test -e $BUILD_ROOT/$myroot/etc/hosts ; then ++ cp $BUILD_ROOT/etc/hosts $BUILD_ROOT/$myroot/etc/hosts ++ fi ++ + # move topdir over + mv "$BUILD_ROOT/$TOPDIR" "$BUILD_ROOT/$myroot/${TOPDIR%/*}" + +-- +2.1.4 + diff --git a/debian/patches/0006-debootstrap-Mount-virtual-filesystems-in-the-deboots.patch b/debian/patches/0006-debootstrap-Mount-virtual-filesystems-in-the-deboots.patch new file mode 100644 index 0000000..fc3a3c1 --- /dev/null +++ b/debian/patches/0006-debootstrap-Mount-virtual-filesystems-in-the-deboots.patch @@ -0,0 +1,44 @@ +From 4cb54f6ed94cb2ad94007cd72aa1bc40f384f319 Mon Sep 17 00:00:00 2001 +From: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +Date: Tue, 31 Jan 2017 09:48:10 +0100 +Subject: [PATCH 6/8] debootstrap: Mount virtual filesystems in the debootstrap + root + +For the debootstrap recipe the virtual filesystems also should be +mounted in the actual build root not just the main one. + +Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +--- + build-recipe-debootstrap | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap +index ae52dc0..5ae7cfc 100644 +--- a/build-recipe-debootstrap ++++ b/build-recipe-debootstrap +@@ -65,12 +65,22 @@ recipe_build_debootstrap() { + cp $BUILD_ROOT/etc/hosts $BUILD_ROOT/$myroot/etc/hosts + fi + ++ # Mount special filesystem in the debootstrap build root ++ mount -n -tproc none $BUILD_ROOT/$myroot/proc ++ mount -n -tdevpts -omode=0620,gid=5 none $BUILD_ROOT/$myroot/dev/pts ++ mkdir -p $BUILD_ROOT/$myroot/dev/shm ++ mount -n -ttmpfs none $BUILD_ROOT/$myroot/dev/shm ++ + # move topdir over + mv "$BUILD_ROOT/$TOPDIR" "$BUILD_ROOT/$myroot/${TOPDIR%/*}" + + # do the build + dsc_build "$BUILD_ROOT/$myroot" + ++ umount -n $BUILD_ROOT/$myroot/proc ++ umount -n $BUILD_ROOT/$myroot/dev/pts ++ umount -n $BUILD_ROOT/$myroot/dev/shm ++ + # move topdir back + mv "$BUILD_ROOT/$myroot/$TOPDIR" "$BUILD_ROOT/${TOPDIR%/*}" + +-- +2.1.4 + diff --git a/debian/patches/0007-debootstrap-Always-try-to-unmount-binfmt_misc.patch b/debian/patches/0007-debootstrap-Always-try-to-unmount-binfmt_misc.patch new file mode 100644 index 0000000..48c3b5d --- /dev/null +++ b/debian/patches/0007-debootstrap-Always-try-to-unmount-binfmt_misc.patch @@ -0,0 +1,26 @@ +From 7f0efeeba7f62a8266166f8def79ff503b7455bc Mon Sep 17 00:00:00 2001 +From: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +Date: Wed, 8 Feb 2017 11:22:18 +0100 +Subject: [PATCH 7/8] debootstrap: Always try to unmount binfmt_misc + +Some builds trigger binfmt_misc to be mounted. Make sure that gets +cleaned up. +--- + build-recipe-debootstrap | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap +index 5ae7cfc..e8e82ff 100644 +--- a/build-recipe-debootstrap ++++ b/build-recipe-debootstrap +@@ -77,6 +77,7 @@ recipe_build_debootstrap() { + # do the build + dsc_build "$BUILD_ROOT/$myroot" + ++ umount -n $BUILD_ROOT/$myroot/proc/sys/fs/binfmt_misc 2>/dev/null || true + umount -n $BUILD_ROOT/$myroot/proc + umount -n $BUILD_ROOT/$myroot/dev/pts + umount -n $BUILD_ROOT/$myroot/dev/shm +-- +2.1.4 + diff --git a/debian/patches/0008-debootstrap-Improve-devpts-mounting.patch b/debian/patches/0008-debootstrap-Improve-devpts-mounting.patch new file mode 100644 index 0000000..892c562 --- /dev/null +++ b/debian/patches/0008-debootstrap-Improve-devpts-mounting.patch @@ -0,0 +1,29 @@ +From fc08c45072851779ce67fa2f92e509dc39e5ed27 Mon Sep 17 00:00:00 2001 +From: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +Date: Wed, 8 Feb 2017 11:23:25 +0100 +Subject: [PATCH 8/8] debootstrap: Improve devpts mounting + +Debootstrap in all recent debian based distribution makes /dev/ptmx a +symlink to /dev/pts/ptmx. Adjust the ptmxmode mount option to give the +latter usable permissions and enable private instance usage (available +in linux since 2.6.29). +--- + build-recipe-debootstrap | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap +index e8e82ff..3ceca90 100644 +--- a/build-recipe-debootstrap ++++ b/build-recipe-debootstrap +@@ -67,7 +67,7 @@ recipe_build_debootstrap() { + + # Mount special filesystem in the debootstrap build root + mount -n -tproc none $BUILD_ROOT/$myroot/proc +- mount -n -tdevpts -omode=0620,gid=5 none $BUILD_ROOT/$myroot/dev/pts ++ mount -n -tdevpts -omode=0620,ptmxmode=0666,gid=5,newinstance, none $BUILD_ROOT/$myroot/dev/pts + mkdir -p $BUILD_ROOT/$myroot/dev/shm + mount -n -ttmpfs none $BUILD_ROOT/$myroot/dev/shm + +-- +2.1.4 + diff --git a/debian/patches/0010_find-perm_slash.diff b/debian/patches/0010_find-perm_slash.diff new file mode 100644 index 0000000..e29754e --- /dev/null +++ b/debian/patches/0010_find-perm_slash.diff @@ -0,0 +1,15 @@ +Description: Use "find -perm /x" instead of "find -perm +x". +Bug-Debian: https://bugs.debian.org/808918 +Origin: vendor + +--- obs-build-20141024.orig/build-vm ++++ obs-build-20141024/build-vm +@@ -605,7 +605,7 @@ vm_first_stage() { + unset start_time + if test ! -w /root ; then + # remove setuid bit if files belong to user to make e.g. mount work +- find $BUILD_ROOT/{bin,sbin,usr/bin,usr/sbin} -type f -uid $UID -perm +4000 -print0 | xargs -0 --no-run-if-empty chmod -s ++ find $BUILD_ROOT/{bin,sbin,usr/bin,usr/sbin} -type f -uid $UID -perm /4000 -print0 | xargs -0 --no-run-if-empty chmod -s + fi + copy_oldpackages + fi diff --git a/debian/patches/HACK-Make-glibc-build.patch b/debian/patches/HACK-Make-glibc-build.patch new file mode 100644 index 0000000..5db14a6 --- /dev/null +++ b/debian/patches/HACK-Make-glibc-build.patch @@ -0,0 +1,27 @@ +From: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +Date: Mon, 13 Mar 2017 14:28:10 +0100 +Subject: HACK: Make glibc build + +See: + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844420 + +Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +--- + build-recipe-debootstrap | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap +index e1c3200..85e02ad 100644 +--- a/build-recipe-debootstrap ++++ b/build-recipe-debootstrap +@@ -68,6 +68,10 @@ 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/deb-Don-t-create-an-empty-rcS.patch b/debian/patches/deb-Don-t-create-an-empty-rcS.patch new file mode 100644 index 0000000..db0755c --- /dev/null +++ b/debian/patches/deb-Don-t-create-an-empty-rcS.patch @@ -0,0 +1,25 @@ +From: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +Date: Thu, 23 Feb 2017 09:50:53 +0100 +Subject: deb: Don't create an empty rcS + +rcS is a configuration file created by initscripts, not entirely clear +why obs-build tries to create it. But if it does initscripts will ask +whether to keep/replace it interactively blocking the build. + +Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +--- + build-pkg-deb | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/build-pkg-deb b/build-pkg-deb +index 0849f60..cd71070 100644 +--- a/build-pkg-deb ++++ b/build-pkg-deb +@@ -48,7 +48,6 @@ deb_setup() { + :>> $BUILD_ROOT/var/lib/dpkg/available + :>> $BUILD_ROOT/var/log/dpkg.log + :>> $BUILD_ROOT/etc/ld.so.conf +- :>> $BUILD_ROOT/etc/default/rcS + } + + pkg_initdb_deb() { diff --git a/debian/patches/deboostrap-Enable-dpkg-unsafe-io-usage.patch b/debian/patches/deboostrap-Enable-dpkg-unsafe-io-usage.patch new file mode 100644 index 0000000..5cc53b3 --- /dev/null +++ b/debian/patches/deboostrap-Enable-dpkg-unsafe-io-usage.patch @@ -0,0 +1,27 @@ +From: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +Date: Mon, 13 Mar 2017 14:27:31 +0100 +Subject: deboostrap: Enable dpkg unsafe io usage + +To speed up dpkg a little bit one can turn on usage of unsafe-io to +lower the amount of sync() like calls it does. Enable this early in the +debootstrap run. + +Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +--- + build-recipe-debootstrap | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap +index c1ef4ad..e1c3200 100644 +--- a/build-recipe-debootstrap ++++ b/build-recipe-debootstrap +@@ -45,6 +45,9 @@ recipe_build_debootstrap() { + done + FULL_PKG_LIST="${FULL_PKG_LIST#,}" + rm -rf "$BUILD_ROOT/$myroot" ++ mkdir -p "$BUILD_ROOT/$myroot/etc/dpkg/dpkg.cfg.d" ++ 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..." + if ! "$@" || ! chroot $BUILD_ROOT dpkg --configure -a; then diff --git a/debian/patches/debootstrap-Also-mount-sysfs.patch b/debian/patches/debootstrap-Also-mount-sysfs.patch new file mode 100644 index 0000000..2ab8f36 --- /dev/null +++ b/debian/patches/debootstrap-Also-mount-sysfs.patch @@ -0,0 +1,32 @@ +From: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +Date: Mon, 20 Feb 2017 21:17:34 +0100 +Subject: debootstrap: Also mount sysfs + +At least the systemd testsuite assumes the build environment has /sys +mounted, so lets mount it. + +Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +--- + build-recipe-debootstrap | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap +index 8d761bd..c1ef4ad 100644 +--- a/build-recipe-debootstrap ++++ b/build-recipe-debootstrap +@@ -67,6 +67,7 @@ recipe_build_debootstrap() { + + # 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 + mount -n -tdevpts -omode=0620,ptmxmode=0666,gid=5,newinstance, none $BUILD_ROOT/$myroot/dev/pts + mkdir -p $BUILD_ROOT/$myroot/dev/shm + mount -n -ttmpfs none $BUILD_ROOT/$myroot/dev/shm +@@ -79,6 +80,7 @@ recipe_build_debootstrap() { + + umount -n $BUILD_ROOT/$myroot/proc/sys/fs/binfmt_misc 2>/dev/null || true + umount -n $BUILD_ROOT/$myroot/proc ++ umount -n $BUILD_ROOT/$myroot/sys + umount -n $BUILD_ROOT/$myroot/dev/pts + umount -n $BUILD_ROOT/$myroot/dev/shm + diff --git a/debian/patches/debootstrap-generate-apt-caches.patch b/debian/patches/debootstrap-generate-apt-caches.patch new file mode 100644 index 0000000..376260b --- /dev/null +++ b/debian/patches/debootstrap-generate-apt-caches.patch @@ -0,0 +1,26 @@ +From: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +Date: Mon, 13 Mar 2017 14:36:52 +0100 +Subject: debootstrap: generate apt caches + +Some packages seemingly rely on apt-cache (with populated caches) being +available during build. This seems an ugly assumption, but it does work on +the Debian buildd infrastructure so make it work on OBS as well. + +Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +--- + build-recipe-debootstrap | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap +index 85e02ad..2f2c058 100644 +--- a/build-recipe-debootstrap ++++ b/build-recipe-debootstrap +@@ -79,6 +79,8 @@ recipe_build_debootstrap() { + mkdir -p $BUILD_ROOT/$myroot/dev/shm + mount -n -ttmpfs none $BUILD_ROOT/$myroot/dev/shm + ++ chroot $BUILD_ROOT/$myroot apt-cache gencaches ++ + # move topdir over + mv "$BUILD_ROOT/$TOPDIR" "$BUILD_ROOT/$myroot/${TOPDIR%/*}" + diff --git a/debian/patches/dsc-Keep-everything.patch b/debian/patches/dsc-Keep-everything.patch new file mode 100644 index 0000000..f3c9a3b --- /dev/null +++ b/debian/patches/dsc-Keep-everything.patch @@ -0,0 +1,31 @@ +From: Sjoerd Simons <sjoerd.simons@collabora.co.uk> +Date: Mon, 13 Mar 2017 14:27:12 +0100 +Subject: dsc: Keep everything + +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> +--- + Build.pm | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/Build.pm b/Build.pm +index ccf8735..89b4af5 100644 +--- a/Build.pm ++++ b/Build.pm +@@ -532,7 +532,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/series b/debian/patches/series new file mode 100644 index 0000000..75f1846 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,17 @@ +#0001-Use-obs-build-in-locations-and-executable-names-inst.patch +#0010_find-perm_slash.diff +#0001-Correct-debootstrap-log-path.patch +#0002-deb-Force-unsafe-io-when-install-packages.patch +#0003-snapcraft-Drop-duplicated-code.patch +#0004-livebuild-Only-create-symlinks-after-dpkg-scanpackag.patch +0005-debootstrap-Ensure-etc-hosts-exists.patch +#0006-debootstrap-Mount-virtual-filesystems-in-the-deboots.patch +#0007-debootstrap-Always-try-to-unmount-binfmt_misc.patch +#0008-debootstrap-Improve-devpts-mounting.patch +#debootstrap-Also-mount-sysfs.patch +deb-Don-t-create-an-empty-rcS.patch +dsc-Keep-everything.patch +#deboostrap-Enable-dpkg-unsafe-io-usage.patch +HACK-Make-glibc-build.patch +debootstrap-generate-apt-caches.patch + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..9578f7f --- /dev/null +++ b/debian/rules @@ -0,0 +1,8 @@ +#!/usr/bin/make -f +%: + dh $@ + +override_dh_install: + dh_install + # file marked executable, fix it. + chmod a-x debian/obs-build/usr/lib/obs-build/build-validate-params diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000..f8f38d0 --- /dev/null +++ b/debian/source/options @@ -0,0 +1 @@ +extend-diff-ignore=configs/sles11.conf diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..65768a1 --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://download.opensuse.org/repositories/OBS:/Server:/Unstable/xUbuntu_12.04/build_(.*)\.orig\.tar\.gz |