aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanct12 <danct12@disroot.org>2020-02-21 21:52:45 +0700
committerLeo <thinkabit.ukim@gmail.com>2020-02-21 14:11:17 -0300
commitb94680c47045c5341cb09867067098a02b00024e (patch)
treed8a8d9f47deab0d2312ec45d343cfa2fbaae3967
parent36e1ff18b4cab3b07307c1f87e37233549a19049 (diff)
downloadaports-b94680c47045c5341cb09867067098a02b00024e.tar.gz
aports-b94680c47045c5341cb09867067098a02b00024e.tar.bz2
aports-b94680c47045c5341cb09867067098a02b00024e.tar.xz
testing/schroot: new aport
Signed-off-by: Danct12 <danct12@disroot.org>
-rw-r--r--testing/schroot/APKBUILD81
-rw-r--r--testing/schroot/busybox-compat.patch50
-rw-r--r--testing/schroot/getent.patch25
-rw-r--r--testing/schroot/getmntent.patch60
-rw-r--r--testing/schroot/musl.patch51
-rw-r--r--testing/schroot/pam.d.schroot.patch20
-rw-r--r--testing/schroot/remove-networks.patch41
-rw-r--r--testing/schroot/schroot-cppunit.patch11
8 files changed, 339 insertions, 0 deletions
diff --git a/testing/schroot/APKBUILD b/testing/schroot/APKBUILD
new file mode 100644
index 0000000000..542f6fdead
--- /dev/null
+++ b/testing/schroot/APKBUILD
@@ -0,0 +1,81 @@
+# Contributor: Danct12 <danct12@disroot.org>
+# Maintainer: Danct12 <danct12@disroot.org>
+pkgname=schroot
+pkgver=1.6.10
+pkgrel=0
+pkgdesc="Allows users to execute shell commands under different root filesystems. (Successor to dchroot)."
+url="https://packages.qa.debian.org/s/schroot.html"
+arch="all"
+license="GPL-3.0-or-later"
+makedepends="autoconf automake boost-dev coreutils cppunit-dev groff gettext-dev libtool"
+subpackages="$pkgname-bash-completion:bashcomp:noarch $pkgname-dev $pkgname-doc $pkgname-lang"
+source="
+ http://http.debian.net/debian/pool/main/s/schroot/schroot_$pkgver.orig.tar.xz
+ http://http.debian.net/debian/pool/main/s/schroot/schroot_$pkgver-3+deb9u1.debian.tar.xz
+ busybox-compat.patch
+ getent.patch
+ getmntent.patch
+ musl.patch
+ pam.d.schroot.patch
+ remove-networks.patch
+ schroot-cppunit.patch
+ "
+options="suid !check" # failing testsuite (20 out of 23 passed)
+
+prepare() {
+ default_prepare
+
+ # shellcheck disable=SC2002
+ cat "$srcdir"/debian/patches/series | while read -r p; do
+ patch -p1 -i "$srcdir"/debian/patches/"$p"
+ done
+
+ # invalid sbuild_version
+ sed -i "s/@sbuild_version@/$pkgver/g" sbuild/sbuild.pc.in
+
+ ./bootstrap
+}
+
+build() {
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var \
+ --enable-dchroot \
+ --enable-lvm-snapshot \
+ --enable-btrfs-snapshot \
+ --with-bash-completion-dir=/usr/share/bash-completion/completions/ \
+ BTRFS=/sbin/btrfs \
+ BTRFSCTL=/sbin/btrfsctl \
+ LVCREATE=/sbin/lvcreate \
+ LVREMOVE=/sbin/lvremove
+ make
+}
+
+package() {
+ make DESTDIR="$pkgdir" install
+}
+
+bashcomp() {
+ depends=""
+ pkgdesc="Bash completion for $pkgname"
+ install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
+
+ mkdir -p "$subpkgdir"/usr/share/bash-completion
+ mv "$pkgdir"/usr/share/bash-completion/completions \
+ "$subpkgdir"/usr/share/bash-completion
+ rm -rf "$pkgdir"/usr/share/bash-completion
+}
+
+sha512sums="25155989c7811ab4c7bf3cdceaa8d0ffb12f08388143891def96fcd205f1cc401dad9a74f0e9a9ef8610d50174ff8319a8368401431dc87e1a11c0241e61fcbe schroot_1.6.10.orig.tar.xz
+5e6e3e0438151f4ce9a2a9a31c3a814091665efd17cbb050a4374d57d0f7eaf562182e2d075a014969d8a299d6b223c833267b5d7827802927cf7f317ffe54bc schroot_1.6.10-3+deb9u1.debian.tar.xz
+26fd02d3daf3a840685a1f58ffe95ecfa0405e8598eaf85484342a609d13f2c70b7393704cde5f1d85581b73269db2769ccb1d3a4744b05ed5e6675edf1f958d busybox-compat.patch
+fa37b263a59e170734bdfbb046259632baf71b809602f52d532cb3c7ea8c1b45384ebc335233fb983ee0f17e823f157dfb65e56fb511f73f4b261bcfe4fcca6f getent.patch
+21023b63665c6ab3993e8142e684b3d6086b35a15287db806a13013f5df3943383d8bb6063bc73a98d8cc548601ef89ad780e1e3a00b1bca3d239a4b217828e8 getmntent.patch
+c8a87b5d03adcd13bd103a3044da84782ac11eb0d38e1a3267ea41862f5de86c03442289074d0964a861c1bc09222fc2ca60efbe8818338fb4e0583e81a22ec8 musl.patch
+dcdbcb91e7960434ce2d7dc7eeea5b3bae65fa5800221c5cb6ffaf9aaaa45f9c2e0cdfdfe130de035095b2493364f1574dca73421043873adf65533f19791b8f pam.d.schroot.patch
+82542ed4db7f3e00d5531fb3af799f70502d3464db4182a128940db80675bf9b45b2e65a71c891b3b1ee6a6f8dff81c82b844ca65507f076cc54a293003e7088 remove-networks.patch
+229b0be8f45099af122139511bf8137ec01074df0865e33097e8baa80002a22b2e82ce338fb62a2b50ff33c0539242798f35dd9fc5438d3ea06aefc1d94663dd schroot-cppunit.patch"
diff --git a/testing/schroot/busybox-compat.patch b/testing/schroot/busybox-compat.patch
new file mode 100644
index 0000000000..98c0dc2d76
--- /dev/null
+++ b/testing/schroot/busybox-compat.patch
@@ -0,0 +1,50 @@
+diff --git a/etc/profile-templates/all/all/nssdatabases b/etc/profile-templates/all/all/nssdatabases
+index 42fa310..815ddce 100644
+--- a/etc/profile-templates/all/all/nssdatabases
++++ b/etc/profile-templates/all/all/nssdatabases
+@@ -4,4 +4,3 @@
+ passwd
+ shadow
+ group
+-gshadow
+diff --git a/etc/profile-templates/buildd/all/nssdatabases b/etc/profile-templates/buildd/all/nssdatabases
+index 42fa310..815ddce 100644
+--- a/etc/profile-templates/buildd/all/nssdatabases
++++ b/etc/profile-templates/buildd/all/nssdatabases
+@@ -4,4 +4,3 @@
+ passwd
+ shadow
+ group
+-gshadow
+diff --git a/etc/setup.d/20copyfiles b/etc/setup.d/20copyfiles
+index 2c01af9..e427d35 100755
+--- a/etc/setup.d/20copyfiles
++++ b/etc/setup.d/20copyfiles
+@@ -39,9 +39,9 @@ copy_file()
+ if [ -e "$2" ]; then
+
+ # Device and inode
+- da=$(/usr/bin/stat --format="%d %i" "$1")
++ da=$(/bin/stat -c "%d %i" "$1")
+ # This one can fail since it might not exist yet
+- db=$(/usr/bin/stat --format="%d %i" "$2" 2>/dev/null || :)
++ db=$(/bin/stat -c "%d %i" "$2" 2>/dev/null || :)
+
+ if [ "$da" = "$db" ]; then
+ COPY="false"
+diff --git a/etc/setup.d/20nssdatabases b/etc/setup.d/20nssdatabases
+index 6ea83c0..3f4019c 100755
+--- a/etc/setup.d/20nssdatabases
++++ b/etc/setup.d/20nssdatabases
+@@ -42,9 +42,9 @@ if [ $STAGE = "setup-start" ] || [ $STAGE = "setup-recover" ]; then
+ fi
+
+ # Device and inode
+- dr=$(/usr/bin/stat --format="%d %i" "/etc/$db")
++ dr=$(/bin/stat -c "%d %i" "/etc/$db")
+ # This one can fail since it might not exist yet
+- dc=$(/usr/bin/stat --format="%d %i" "${CHROOT_PATH}/etc/$db" 2>/dev/null || :)
++ dc=$(/bin/stat -c "%d %i" "${CHROOT_PATH}/etc/$db" 2>/dev/null || :)
+
+ # If the database inside and outside the chroot is the
+ # same, it's very likely that dup_nss would blank the
diff --git a/testing/schroot/getent.patch b/testing/schroot/getent.patch
new file mode 100644
index 0000000000..b89e63c1d4
--- /dev/null
+++ b/testing/schroot/getent.patch
@@ -0,0 +1,25 @@
+From 6ffdd152d3fb07921c02e739ce5b47d1e177e7e6 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Mon, 24 Aug 2015 18:39:16 +0200
+Subject: [PATCH] getent
+
+---
+ etc/setup.d/20nssdatabases | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git etc/setup.d/20nssdatabases etc/setup.d/20nssdatabases
+index 6f14c81..697bb1e 100755
+--- a/etc/setup.d/20nssdatabases
++++ b/etc/setup.d/20nssdatabases
+@@ -29,7 +29,7 @@ set -e
+ dup_nss()
+ {
+ info "Copying $1 database to $2"
+- getent "$1" > "$2"
++ getent "$1" > "$2" 2>/dev/null || cat "/etc/$1" > "$2"
+ }
+
+ if [ $STAGE = "setup-start" ] || [ $STAGE = "setup-recover" ]; then
+--
+2.5.0
+
diff --git a/testing/schroot/getmntent.patch b/testing/schroot/getmntent.patch
new file mode 100644
index 0000000000..8453bfb3a3
--- /dev/null
+++ b/testing/schroot/getmntent.patch
@@ -0,0 +1,60 @@
+From db62a534ebcf60391d9e0acffa641e60dfba18fb Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <abc@pompel.me>
+Date: Wed, 19 Sep 2018 10:36:36 +0200
+Subject: [PATCH] getmntent fix
+
+---
+ sbuild/sbuild-mntstream.cc | 15 ++-------------
+ sbuild/sbuild-mntstream.h | 3 +--
+ 2 files changed, 3 insertions(+), 15 deletions(-)
+
+diff --git sbuild/sbuild-mntstream.cc sbuild/sbuild-mntstream.cc
+index d376fe5..d7324e7 100644
+--- a/sbuild/sbuild-mntstream.cc
++++ b/sbuild/sbuild-mntstream.cc
+@@ -37,9 +37,7 @@ namespace
+ emap init_errors[] =
+ {
+ // TRANSLATORS: %1% = mount file name
+- emap(mntstream::MNT_OPEN, N_("Failed to open mount file ‘%1%’")),
+- // TRANSLATORS: %1% = mount file name
+- emap(mntstream::MNT_READ, N_("Failed to read mount file ‘%1%’"))
++ emap(mntstream::MNT_OPEN, N_("Failed to open mount file ‘%1%’"))
+ };
+
+ }
+@@ -109,16 +107,7 @@ mntstream::read(int quantity)
+ errno = 0;
+ entry = getmntent(mntfile);
+
+- if (entry == 0) // EOF or error
+- {
+- //std::cerr << "Mount file read error: ";
+- if (errno) // error
+- {
+- this->error_status = true;
+- throw error(this->file, MNT_READ, strerror(errno));
+- }
+- return;
+- }
++ if (entry == 0) return;
+
+ mntentry newentry(*entry); // make a mntentry
+ this->data.push_back(newentry); // push onto the end of the list
+diff --git sbuild/sbuild-mntstream.h sbuild/sbuild-mntstream.h
+index ea3d179..fffcdf4 100644
+--- a/sbuild/sbuild-mntstream.h
++++ b/sbuild/sbuild-mntstream.h
+@@ -49,8 +49,7 @@ namespace sbuild
+ /// Error codes.
+ enum error_code
+ {
+- MNT_OPEN, ///< Failed to open mount file.
+- MNT_READ ///< Failed to read mount file.
++ MNT_OPEN ///< Failed to open mount file.
+ };
+
+ /// Exception type.
+--
+2.19.0
+
diff --git a/testing/schroot/musl.patch b/testing/schroot/musl.patch
new file mode 100644
index 0000000000..8e27ad7e4c
--- /dev/null
+++ b/testing/schroot/musl.patch
@@ -0,0 +1,51 @@
+From 73936a423227aa78b7682bdd3edc20643763807b Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <abc@pompel.me>
+Date: Wed, 19 Sep 2018 11:22:47 +0200
+Subject: [PATCH] musl
+
+---
+ sbuild/sbuild-feature.cc | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git sbuild/sbuild-feature.cc sbuild/sbuild-feature.cc
+index 5ac4725..9902db3 100644
+--- a/sbuild/sbuild-feature.cc
++++ b/sbuild/sbuild-feature.cc
+@@ -20,6 +20,8 @@
+
+ #include <iostream>
+
++#include <libintl.h>
++
+ #include "sbuild-feature.h"
+
+ using namespace sbuild;
+--
+2.19.0
+
+diff --git a/sbuild/Makefile.am b/sbuild/Makefile.am
+index 03b5c7b..afa7638 100644
+--- a/sbuild/Makefile.am
++++ b/sbuild/Makefile.am
+@@ -222,7 +222,7 @@ pkgconfigdata_DATA = sbuild.pc
+ # Uncomment to build a versioned library
+ libsbuild_version = -version-info $(SBUILD_CURRENT_INTERFACE):$(SBUILD_INTERFACE_AGE):$(SBUILD_BINARY_AGE)
+ libsbuild_la_LDFLAGS = $(libsbuild_version) \
+- -rpath $(libdir) -no-undefined
++ -rpath $(libdir) -no-undefined -lintl
+
+ EXTRA_DIST = \
+ CMakeLists.txt \
+diff --git a/test/Makefile.in b/test/Makefile.in
+index ce78448..efbc287 100644
+--- a/test/Makefile.in
++++ b/test/Makefile.in
+@@ -334,7 +334,7 @@ am__v_CC_1 =
+ CCLD = $(CC)
+ LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+- $(AM_LDFLAGS) $(LDFLAGS) -o $@
++ $(AM_LDFLAGS) $(LDFLAGS) -lcppunit -o $@
+ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+ am__v_CCLD_0 = @echo " CCLD " $@;
diff --git a/testing/schroot/pam.d.schroot.patch b/testing/schroot/pam.d.schroot.patch
new file mode 100644
index 0000000000..ec63323b0b
--- /dev/null
+++ b/testing/schroot/pam.d.schroot.patch
@@ -0,0 +1,20 @@
+--- a/etc/pam/schroot
++++ b/etc/pam/schroot
+@@ -23,13 +23,9 @@
+ # time restrainst on schroot usage.
+ # account requisite pam_time.so
+
+-# The standard Unix authentication modules, used with
+-# NIS (man nsswitch) as well as normal /etc/passwd and
+-# /etc/shadow entries.
+-@include common-auth
+-@include common-account
+-@include common-session
+-
++account required pam_unix.so
++session required pam_unix.so
++
+ # Sets up user limits, please uncomment and read /etc/security/limits.conf
+ # to enable this functionality.
+ # session required pam_limits.so
+
diff --git a/testing/schroot/remove-networks.patch b/testing/schroot/remove-networks.patch
new file mode 100644
index 0000000000..7506669348
--- /dev/null
+++ b/testing/schroot/remove-networks.patch
@@ -0,0 +1,41 @@
+From e59bc1b6c6535ec8ab8a57004351718ab2677196 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <abc@pompel.me>
+Date: Wed, 19 Sep 2018 12:36:41 +0200
+Subject: [PATCH] remove networks
+
+---
+ etc/profile-templates/buildd/all/copyfiles | 1 -
+ etc/profile-templates/default/all/nssdatabases | 1 -
+ etc/profile-templates/desktop/all/nssdatabases | 1 -
+ 3 files changed, 3 deletions(-)
+
+diff --git etc/profile-templates/buildd/all/copyfiles etc/profile-templates/buildd/all/copyfiles
+index fe18fb3..2469d3e 100644
+--- a/etc/profile-templates/buildd/all/copyfiles
++++ b/etc/profile-templates/buildd/all/copyfiles
+@@ -3,4 +3,3 @@
+ # <source and destination>
+ /etc/hosts
+ /etc/resolv.conf
+-/etc/networks
+diff --git etc/profile-templates/default/all/nssdatabases etc/profile-templates/default/all/nssdatabases
+index a9f1319..22efe1b 100644
+--- a/etc/profile-templates/default/all/nssdatabases
++++ b/etc/profile-templates/default/all/nssdatabases
+@@ -1,4 +1,3 @@
+ services
+ protocols
+-networks
+ hosts
+diff --git etc/profile-templates/desktop/all/nssdatabases etc/profile-templates/desktop/all/nssdatabases
+index a9f1319..22efe1b 100644
+--- a/etc/profile-templates/desktop/all/nssdatabases
++++ b/etc/profile-templates/desktop/all/nssdatabases
+@@ -1,4 +1,3 @@
+ services
+ protocols
+-networks
+ hosts
+--
+2.19.0
+
diff --git a/testing/schroot/schroot-cppunit.patch b/testing/schroot/schroot-cppunit.patch
new file mode 100644
index 0000000000..3e11c73fd4
--- /dev/null
+++ b/testing/schroot/schroot-cppunit.patch
@@ -0,0 +1,11 @@
+--- a/configure.ac 2017-05-20 09:50:30.146864516 +0000
++++ b/configure.ac 2017-05-20 09:51:26.216792794 +0000
+@@ -336,7 +336,7 @@
+ [HAVE_UUID=yes],
+ [HAVE_UUID=no])
+
+-AM_PATH_CPPUNIT([1.10.0], [HAVE_CPPUNIT=yes])
++PKG_CHECK_MODULES([CPPUNIT], [cppunit], [HAVE_CPPUNIT=yes], [HAVE_CPPUNIT=no])
+ AM_CONDITIONAL([USE_UNIT_TESTS], [test -n "$HAVE_CPPUNIT"])
+
+ SCHROOT_CFLAGS="$UUID_CFLAGS"