summaryrefslogtreecommitdiff
path: root/dev-util/schroot
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
commitb590c8d7572b727d565cc0b8ff660d43569845de (patch)
tree06f7a4102ea4e845df8b66660f252920d52952f9 /dev-util/schroot
parent24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff)
downloadbaldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip
Adding metadata
Diffstat (limited to 'dev-util/schroot')
-rw-r--r--dev-util/schroot/Manifest2
-rw-r--r--dev-util/schroot/files/06zfscloneopts44
-rw-r--r--dev-util/schroot/files/11gentoo61
-rw-r--r--dev-util/schroot/files/schroot-1.6.13-resize-reserve.patch99
-rw-r--r--dev-util/schroot/files/schroot-1.6.13_p2-boost-1.85.0.patch43
-rw-r--r--dev-util/schroot/files/schroot-1.6.13_p7-boost-1.89.0.patch20
-rw-r--r--dev-util/schroot/files/schroot-1.6.13_p7-build-fixes.patch72
-rw-r--r--dev-util/schroot/files/schroot-1.6.13_p7-cmake4.patch12
-rw-r--r--dev-util/schroot/files/schroot.confd9
-rw-r--r--dev-util/schroot/files/schroot.initd41
-rw-r--r--dev-util/schroot/files/schroot.tmpfilesd2
-rw-r--r--dev-util/schroot/files/schroot_prompt.sh1
-rw-r--r--dev-util/schroot/metadata.xml15
-rw-r--r--dev-util/schroot/schroot-1.6.13_p7-r2.ebuild168
14 files changed, 589 insertions, 0 deletions
diff --git a/dev-util/schroot/Manifest b/dev-util/schroot/Manifest
new file mode 100644
index 000000000000..4e50ee7918b2
--- /dev/null
+++ b/dev-util/schroot/Manifest
@@ -0,0 +1,2 @@
+DIST schroot-1.6.13.tar.gz 687581 BLAKE2B 5054407e545f39258df7598dbc233a836f6a86a02b4d0f3368109fd3edaea543fde6f81cfc6fedcdd6124490a3d5bc4d3a7e113ebe5ba2cfe7ec2c204f9cd0f4 SHA512 a250a02eb2384f1c27a9ff6479b77647a7a19b96b3b4e9d63e32a5dabe6ef3a3b1e2efaf98ddd9db93ded50fc93595ce545b0f0247c4a9e481349adafe806c2d
+DIST schroot_1.6.13-7.debian.tar.xz 120000 BLAKE2B 2b83cf53afbb5a2191f158cc9fdd7d0c46c0c4e6a1c0be96bb9c81574088471abfa4cda295108391b480c15d32d61f410f1ab9160f0d9d8a5b8ef6c300fcb60f SHA512 720519bb63642d675c3f301f2e9c31365712dea870806aa2e8b4aa437523413a4a2a5f06bccce1030d96cbf4d7b2fd0fb19f304d129d41b03e97e4e81165d9fe
diff --git a/dev-util/schroot/files/06zfscloneopts b/dev-util/schroot/files/06zfscloneopts
new file mode 100644
index 000000000000..e66f0885e78f
--- /dev/null
+++ b/dev-util/schroot/files/06zfscloneopts
@@ -0,0 +1,44 @@
+#!/bin/sh
+# Copyright © 2020 Georgy Yakovlev <gyakovlev@gentoo.org>
+#
+# schroot 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 3 of the License, or
+# (at your option) any later version.
+#
+# schroot 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/>.
+#
+#####################################################################
+
+set -e
+
+. "$SETUP_DATA_DIR/common-data"
+. "$SETUP_DATA_DIR/common-functions"
+. "$SETUP_DATA_DIR/common-config"
+
+if [ "$CHROOT_TYPE" = "zfs-snapshot" ] && [ -n "$CHROOT_ZFS_CLONE_NAME" ]; then
+
+ if [ $STAGE = "setup-start" ]; then
+
+ if ! zfs list "$CHROOT_ZFS_CLONE_NAME" >/dev/null 2>&1; then
+ fatal "Dataset '$CHROOT_ZFS_CLONE_NAME' does not exist"
+ fi
+
+ if [ "${ZFS_CLONE_OPTIONS+set}" = "set" ]; then
+ if [ "$VERBOSE" = "verbose" ]; then
+ zfs set $ZFS_CLONE_OPTIONS \
+ "$CHROOT_ZFS_CLONE_NAME"
+ else
+ zfs set $ZFS_CLONE_OPTIONS \
+ "$CHROOT_ZFS_CLONE_NAME" > /dev/null
+ fi
+ fi
+ fi
+fi
diff --git a/dev-util/schroot/files/11gentoo b/dev-util/schroot/files/11gentoo
new file mode 100644
index 000000000000..ddf2df305c68
--- /dev/null
+++ b/dev-util/schroot/files/11gentoo
@@ -0,0 +1,61 @@
+#!/bin/sh
+# Copyright © 2020 Georgy Yakovlev <gyakovlev@gentoo.org>
+#
+# schroot 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 3 of the License, or
+# (at your option) any later version.
+#
+# schroot 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/>.
+#
+#####################################################################
+
+set -e
+
+. "$SETUP_DATA_DIR/common-data"
+. "$SETUP_DATA_DIR/common-functions"
+. "$SETUP_DATA_DIR/common-config"
+
+if [ "$VERBOSE" = "verbose" ]; then
+ VERBOSE_OPT="true"
+fi
+
+if [ "${PORTAGE_BASE_TMPDIR+set}" = "set" ] ; then
+ if [ "$STAGE" = "setup-start" ]; then
+ if [ ! -d "$PORTAGE_BASE_TMPDIR" ]; then
+ fatal "$PORTAGE_BASE_TMPDIR does not exist or not a directory"
+ fi
+ if [ "x$SESSION_ID" = x ]; then
+ fatal "SESSION_ID is not set"
+ fi
+ if [ ! -d "$PORTAGE_BASE_TMPDIR/schroot-$SESSION_ID" ]; then
+ mkdir ${VERBOSE_OPT+-v} \
+ "$PORTAGE_BASE_TMPDIR/schroot-$SESSION_ID"
+ fi
+ mkdir -p ${VERBOSE_OPT+-v} "$CHROOT_MOUNT_LOCATION/var/tmp/portage"
+ mount --make-private -o bind ${VERBOSE_OPT+-v}\
+ "$PORTAGE_BASE_TMPDIR/schroot-$SESSION_ID" \
+ "$CHROOT_MOUNT_LOCATION/var/tmp/portage"
+
+ elif [ "$STAGE" = "setup-stop" ]; then
+ if [ "$CHROOT_SESSION_PURGE" = true ] || \
+ [ "${CHROOT_NAME/#*_master/m}" = "m" ]; then
+ umount ${VERBOSE_OPT+-v} \
+ "$CHROOT_MOUNT_LOCATION/var/tmp/portage"
+ if [ -d "$PORTAGE_BASE_TMPDIR/schroot-$SESSION_ID" ]; then
+ if [ "x$SESSION_ID" != x ]; then
+ rm -fr ${VERBOSE_OPT+-v} \
+ "$PORTAGE_BASE_TMPDIR/schroot-$SESSION_ID"
+ fi
+ fi
+ fi
+
+ fi
+fi
diff --git a/dev-util/schroot/files/schroot-1.6.13-resize-reserve.patch b/dev-util/schroot/files/schroot-1.6.13-resize-reserve.patch
new file mode 100644
index 000000000000..066894a16ecc
--- /dev/null
+++ b/dev-util/schroot/files/schroot-1.6.13-resize-reserve.patch
@@ -0,0 +1,99 @@
+https://codeberg.org/shelter/reschroot/pulls/6
+
+From 6d7a762d6d630548ed558e0de8ddf04f3b0a69fc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@aarsen.me>
+Date: Sat, 14 Jan 2023 22:53:20 +0100
+Subject: [PATCH] sbuild-util: use resize instead of reserve
+
+Using reserved but uninitialized space is invalid, and, additionally,
+reserve is not required to allocate memory or change the buffer size at
+all.
+--- a/sbuild/sbuild-util.cc
++++ b/sbuild/sbuild-util.cc
+@@ -624,17 +624,17 @@ void
+ sbuild::passwd::query_uid (uid_t uid)
+ {
+ buffer_type::size_type size = 1 << 7;
+- buffer.reserve(size);
++ buffer.resize(size);
+ int error;
+
+ ::passwd *pwd_result;
+
+ while ((error = getpwuid_r(uid, this,
+- &buffer[0], buffer.capacity(),
++ &buffer[0], buffer.size(),
+ &pwd_result)) == ERANGE)
+ {
+ size <<= 1;
+- buffer.reserve(size);
++ buffer.resize(size);
+ }
+
+ if (pwd_result)
+@@ -647,17 +647,17 @@ void
+ sbuild::passwd::query_name (const char *name)
+ {
+ buffer_type::size_type size = 1 << 8;
+- buffer.reserve(size);
++ buffer.resize(size);
+ int error;
+
+ ::passwd *pwd_result;
+
+ while ((error = getpwnam_r(name, this,
+- &buffer[0], buffer.capacity(),
++ &buffer[0], buffer.size(),
+ &pwd_result)) == ERANGE)
+ {
+ size <<= 1;
+- buffer.reserve(size);
++ buffer.resize(size);
+ }
+
+ if (pwd_result)
+@@ -733,17 +733,17 @@ void
+ sbuild::group::query_gid (gid_t gid)
+ {
+ buffer_type::size_type size = 1 << 7;
+- buffer.reserve(size);
++ buffer.resize(size);
+ int error;
+
+ ::group *grp_result;
+
+ while ((error = getgrgid_r(gid, this,
+- &buffer[0], buffer.capacity(),
++ &buffer[0], buffer.size(),
+ &grp_result)) == ERANGE)
+ {
+ size <<= 1;
+- buffer.reserve(size);
++ buffer.resize(size);
+ }
+
+ if (grp_result)
+@@ -756,17 +756,17 @@ void
+ sbuild::group::query_name (const char *name)
+ {
+ buffer_type::size_type size = 1 << 8;
+- buffer.reserve(size);
++ buffer.resize(size);
+ int error;
+
+ ::group *grp_result;
+
+ while ((error = getgrnam_r(name, this,
+- &buffer[0], buffer.capacity(),
++ &buffer[0], buffer.size(),
+ &grp_result)) == ERANGE)
+ {
+ size <<= 1;
+- buffer.reserve(size);
++ buffer.resize(size);
+ }
+
+ if (grp_result)
+--
+2.30.2
+
diff --git a/dev-util/schroot/files/schroot-1.6.13_p2-boost-1.85.0.patch b/dev-util/schroot/files/schroot-1.6.13_p2-boost-1.85.0.patch
new file mode 100644
index 000000000000..627981a97b7d
--- /dev/null
+++ b/dev-util/schroot/files/schroot-1.6.13_p2-boost-1.85.0.patch
@@ -0,0 +1,43 @@
+https://bugs.gentoo.org/930499
+https://bugs.gentoo.org/933188
+--- a/sbuild/sbuild-chroot-config.cc
++++ b/sbuild/sbuild-chroot-config.cc
+@@ -31,6 +31,7 @@
+ #include <cstdlib>
+ #include <cstring>
+
++#include <boost/filesystem/directory.hpp>
+ #include <boost/filesystem/operations.hpp>
+
+ #include <sys/types.h>
+--- a/sbuild/sbuild-run-parts.cc
++++ b/sbuild/sbuild-run-parts.cc
+@@ -29,6 +29,7 @@
+ #include <syslog.h>
+
+ #include <boost/format.hpp>
++#include <boost/filesystem/directory.hpp>
+ #include <boost/filesystem/operations.hpp>
+
+ using boost::format;
+--- a/sbuild/sbuild-util.cc
++++ b/sbuild/sbuild-util.cc
+@@ -35,8 +35,6 @@
+ #include <time.h>
+ #endif
+
+-#include <boost/filesystem/convenience.hpp>
+-
+ using namespace sbuild;
+
+ namespace
+--- a/test/sbuild-run-parts.cc
++++ b/test/sbuild-run-parts.cc
+@@ -23,6 +23,7 @@
+ #include <iostream>
+ #include <sstream>
+
++#include <boost/filesystem/exception.hpp>
+ #include <boost/filesystem/operations.hpp>
+
+ #include <cppunit/extensions/HelperMacros.h>
diff --git a/dev-util/schroot/files/schroot-1.6.13_p7-boost-1.89.0.patch b/dev-util/schroot/files/schroot-1.6.13_p7-boost-1.89.0.patch
new file mode 100644
index 000000000000..102b4a965732
--- /dev/null
+++ b/dev-util/schroot/files/schroot-1.6.13_p7-boost-1.89.0.patch
@@ -0,0 +1,20 @@
+Fix build with boost-1.89.0
+From: https://codeberg.org/shelter/reschroot/issues/33
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 35da3380..fa4b55db 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -59,7 +59,11 @@ find_package(Threads REQUIRED)
+
+ include(FindBoost)
+ find_package(Boost REQUIRED
+- COMPONENTS filesystem system iostreams program_options regex)
++ COMPONENTS filesystem iostreams program_options regex)
++if(Boost_MAJOR_VERSION EQUAL 1 AND Boost_MINOR_VERSION LESS 69)
++ list(APPEND BOOST_REQUIRED_COMPONENTS system)
++ find_package(Boost REQUIRED COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
++endif()
+
+ # HEADER CHECKS
+ include(CheckIncludeFileCXX)
diff --git a/dev-util/schroot/files/schroot-1.6.13_p7-build-fixes.patch b/dev-util/schroot/files/schroot-1.6.13_p7-build-fixes.patch
new file mode 100644
index 000000000000..aff18c084731
--- /dev/null
+++ b/dev-util/schroot/files/schroot-1.6.13_p7-build-fixes.patch
@@ -0,0 +1,72 @@
+https://codeberg.org/shelter/reschroot/pulls/5
+https://bugs.gentoo.org/739034
+https://bugs.gentoo.org/715514
+
+From 56b0c8ac846c18002e32e93629ae04a0a6281706 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Mon, 26 Sep 2022 20:52:54 +0100
+Subject: [PATCH 1/3] Fix libcxx build without <tr1/*> (use <memory> if
+ available)
+
+With Clang & libcxx 15, tr1/* doesn't seem to be available,
+which is fine, as we can use the proper <memory> header
+instead.
+
+We already do this in several other locations. Fall back
+to tr1 and Boost as before.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/bin/schroot-base/schroot-base-options.h
++++ b/bin/schroot-base/schroot-base-options.h
+@@ -27,7 +27,9 @@
+ #include <string>
+ #include <stdexcept>
+
+-#ifdef HAVE_TR1_MEMORY
++#ifdef HAVE_MEMORY_SHARED_PTR
++#include <memory>
++#elif HAVE_TR1_MEMORY
+ #include <tr1/memory>
+ #elif HAVE_BOOST_SHARED_PTR_HPP
+ #include <boost/shared_ptr.hpp>
+--- a/bin/schroot/schroot-options-base.h
++++ b/bin/schroot/schroot-options-base.h
+@@ -27,7 +27,9 @@
+ #include <string>
+ #include <vector>
+
+-#ifdef HAVE_TR1_MEMORY
++#ifdef HAVE_MEMORY_SHARED_PTR
++#include <memory>
++#elif HAVE_TR1_MEMORY
+ #include <tr1/memory>
+ #elif HAVE_BOOST_SHARED_PTR_HPP
+ #include <boost/shared_ptr.hpp>
+From 5b00d06a567fe71328124ea53b92ddbd1bd8c6fd Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Mon, 26 Sep 2022 20:54:45 +0100
+Subject: [PATCH 3/3] Add <libintl.h> include for musl
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes error:
+```
+/var/tmp/portage/dev-util/schroot-1.6.10_p7/work/schroot-1.6.10/sbuild/sbuild-feature.cc: In static member function ‘static std::ostream& sbuild::feature::print_features(std::ostream&)’:
+/var/tmp/portage/dev-util/schroot-1.6.10_p7/work/schroot-1.6.10/sbuild/sbuild-feature.cc:48:40: error: ‘gettext’ was not declared in this scope
+ 48 | stream << feature % pos->first % gettext(pos->second.c_str());
+ | ^~~~~~~
+```
+
+Bug: https://bugs.gentoo.org/715514
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/sbuild/sbuild-feature.cc
++++ b/sbuild/sbuild-feature.cc
+@@ -19,6 +19,7 @@
+ #include <config.h>
+
+ #include <iostream>
++#include <libintl.h>
+
+ #include "sbuild-feature.h"
+
diff --git a/dev-util/schroot/files/schroot-1.6.13_p7-cmake4.patch b/dev-util/schroot/files/schroot-1.6.13_p7-cmake4.patch
new file mode 100644
index 000000000000..4f18357ebb7f
--- /dev/null
+++ b/dev-util/schroot/files/schroot-1.6.13_p7-cmake4.patch
@@ -0,0 +1,12 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -13,8 +13,7 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+-cmake_minimum_required(VERSION 2.8.12)
+-cmake_policy(VERSION 2.8.12)
++cmake_minimum_required(VERSION 3.17)
+
+ project(schroot)
+
diff --git a/dev-util/schroot/files/schroot.confd b/dev-util/schroot/files/schroot.confd
new file mode 100644
index 000000000000..b62263175721
--- /dev/null
+++ b/dev-util/schroot/files/schroot.confd
@@ -0,0 +1,9 @@
+# This is a configuration file for /etc/init.d/schroot; it allows you
+# to perform common modifications to the behavior of schroot
+# initialization without editing the init script.
+
+# What do we want to do with "orphan" sessions when starting or
+# restarting? Recover them (leave empty or set to "recover") or just
+# end them (set to "end")?
+SESSIONS_RECOVER="recover"
+
diff --git a/dev-util/schroot/files/schroot.initd b/dev-util/schroot/files/schroot.initd
new file mode 100644
index 000000000000..be58c3a0f2d0
--- /dev/null
+++ b/dev-util/schroot/files/schroot.initd
@@ -0,0 +1,41 @@
+#!/sbin/openrc-run
+
+depend() {
+ need localmount
+ after net netmount
+}
+
+start() {
+ local msg param
+ case "${SESSIONS_RECOVER}" in
+ end)
+ msg="Ending"
+ param="--end-session"
+ ;;
+ recover|"")
+ msg="Recovering"
+ param="--recover-session"
+ ;;
+ *)
+ ewarn "Invalid value \"$SESSIONS_RECOVER\" for \$SESSIONS_RECOVER, using \"recover\""
+ msg="Recovering"
+ param="--recover-session"
+ ;;
+ esac
+
+ einfo "$msg schroot sessions"
+ eindent
+ local chroot
+ local chroots="$(schroot --all-sessions --list --quiet)"
+ if [ -n "$chroots" ]; then
+ for chroot in $chroots; do
+ ebegin "$chroot"
+ schroot --chroot=$chroot $param
+ eend $?
+ done
+ else
+ einfo "(none)"
+ fi
+ eoutdent
+ einfo "...done"
+}
diff --git a/dev-util/schroot/files/schroot.tmpfilesd b/dev-util/schroot/files/schroot.tmpfilesd
new file mode 100644
index 000000000000..0c91363a9da9
--- /dev/null
+++ b/dev-util/schroot/files/schroot.tmpfilesd
@@ -0,0 +1,2 @@
+d /run/schroot/mount 0755 root root -
+L /var/lib/schroot/mount - - - - /run/schroot/mount
diff --git a/dev-util/schroot/files/schroot_prompt.sh b/dev-util/schroot/files/schroot_prompt.sh
new file mode 100644
index 000000000000..bd72f2ce5b83
--- /dev/null
+++ b/dev-util/schroot/files/schroot_prompt.sh
@@ -0,0 +1 @@
+[[ -f /etc/debian_chroot ]] && PS1="chr: $(< /etc/debian_chroot) ${PS1}"
diff --git a/dev-util/schroot/metadata.xml b/dev-util/schroot/metadata.xml
new file mode 100644
index 000000000000..7f6a20634758
--- /dev/null
+++ b/dev-util/schroot/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <use>
+ <flag name="btrfs">Enable support for chroots using btrfs snapshots</flag>
+ <flag name="dchroot">Enables the building of a wrapper named "dchroot", replacing <pkg>sys-apps/dchroot</pkg>
+ </flag>
+ <flag name="lvm">Enable support for chroots using LVM snapshots</flag>
+ <flag name="zfs">Enable support for chroots using ZFS shapshots/clones</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:debian:schroot</remote-id>
+ </upstream>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/dev-util/schroot/schroot-1.6.13_p7-r2.ebuild b/dev-util/schroot/schroot-1.6.13_p7-r2.ebuild
new file mode 100644
index 000000000000..232ec74a48b6
--- /dev/null
+++ b/dev-util/schroot/schroot-1.6.13_p7-r2.ebuild
@@ -0,0 +1,168 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 cmake dot-a pam tmpfiles
+
+MY_P=${PN}_${PV/_p/-}
+
+DESCRIPTION="Utility to execute commands in a chroot environment"
+HOMEPAGE="https://codeberg.org/shelter/reschroot"
+SRC_URI="https://codeberg.org/shelter/reschroot/archive/release/re${P/%_p*}.tar.gz -> ${P/%_p*}.tar.gz
+ mirror://debian/pool/main/${PN::1}/${PN}/${MY_P}.debian.tar.xz"
+S="${WORKDIR}/re${PN}"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~arm64 ~ppc64 ~riscv x86"
+IUSE="btrfs +dchroot debug doc lvm nls pam test zfs"
+RESTRICT="!test? ( test )"
+
+COMMON_DEPEND="
+ dev-libs/boost:=
+ >=sys-apps/util-linux-2.16
+ btrfs? ( >=sys-fs/btrfs-progs-0.19-r2 )
+ lvm? ( sys-fs/lvm2 )
+ pam? ( sys-libs/pam )
+ zfs? ( sys-fs/zfs )
+"
+
+DEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils
+ sys-apps/groff
+ doc? (
+ app-text/doxygen
+ media-gfx/graphviz
+ )
+ nls? (
+ >=app-text/po4a-0.40
+ sys-devel/gettext
+ )
+ test? ( >=dev-util/cppunit-1.10.0 )
+"
+#sys-apps/debianutils
+RDEPEND="${COMMON_DEPEND}
+ dchroot? ( !sys-apps/dchroot )
+ nls? ( virtual/libintl )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.6.13_p7-build-fixes.patch
+
+ # https://codeberg.org/shelter/reschroot/pulls/6
+ "${FILESDIR}"/${PN}-1.6.13-resize-reserve.patch
+
+ "${FILESDIR}"/${PN}-1.6.13_p2-boost-1.85.0.patch
+
+ "${FILESDIR}"/${PN}-1.6.13_p7-cmake4.patch # bug #953913
+
+ # https://codeberg.org/shelter/reschroot/issues/33
+ "${FILESDIR}"/${PN}-1.6.13_p7-boost-1.89.0.patch
+)
+
+src_unpack() {
+ unpack "${P/%_p*}".tar.gz
+ cd "${S}"
+ unpack ${MY_P}.debian.tar.xz
+}
+
+src_prepare() {
+ sed -i -e 's/warn(/message(WARNING /' man/CMakeLists.txt || die
+ eapply "${S}"/debian/patches/*.patch
+ cmake_src_prepare
+}
+
+src_configure() {
+ lto-guarantee-fat
+
+ local mycmakeargs=(
+ -Dbtrfs-snapshot=$(usex btrfs)
+ -Ddchroot=$(usex dchroot)
+ -Ddchroot-dsa=$(usex dchroot)
+ -Ddebug=$(usex debug)
+ -Ddoxygen=$(usex doc)
+ -Dlvm-snapshot=$(usex lvm)
+ -Dnls=$(usex nls)
+ -Dpam=$(usex pam)
+ -Dtest=$(usex test)
+ -Dzfs-snapshot=$(usex zfs)
+ -Dbash_completion_dir="$(get_bashcompdir)"
+ -DCMAKE_INSTALL_SYSCONFDIR="${EPREFIX}/etc"
+ -DCMAKE_INSTALL_LOCALSTATEDIR="${EPREFIX}/var"
+ -DSCHROOT_MOUNT_DIR="${EPREFIX}/run/${PN}/mount"
+
+ -DCMAKE_POLICY_DEFAULT_CMP0167="OLD" # FindBoost
+ -DBoost_NO_BOOST_CMAKE=ON # https://bugs.gentoo.org/791712 and https://bugs.gentoo.org/752120
+ )
+ if ! use nls; then
+ mycmakeargs+=(-DPO4A_EXECUTABLE=NOTFOUND)
+ fi
+
+ cmake_src_configure
+}
+
+src_compile() {
+ cmake_src_compile all $(usev doc)
+}
+
+src_test() {
+ if [[ ${EUID} -ne 0 ]]; then
+ ewarn "Disabling tests because you are not root"
+ return 0
+ fi
+ # -j1 to prevent race between test/setup-test-data and test/cleanup-test-data
+ cmake_src_test -j1
+}
+
+src_install() {
+ cmake_src_install
+
+ strip-lto-bytecode
+
+ # debian-stype PS1 for chroot
+ # checks for /etc/debian_chroot file, which is created by schroot
+ insinto /etc/bash/bashrc.d
+ doins "${FILESDIR}/schroot_prompt.sh"
+
+ # gentoo /var/tmp/portage handler
+ # e.g. portage.base.tmpdir=/var/tmp/portage in config file
+ # will use a subdirectory of hosts $PORTAGE_TMPDIR
+ exeinto /etc/schroot/setup.d
+ doexe "${FILESDIR}/11gentoo"
+
+ # support for zfs clone options.
+ # zfs.clone.options=com.sun:auto-snapshot=false
+ if use zfs; then
+ exeinto /etc/schroot/setup.d
+ doexe "${FILESDIR}/06zfscloneopts"
+ fi
+
+ keepdir /etc/schroot/chroot.d # bug 961345
+ keepdir /var/lib/schroot/{session,unpack,union/{overlay,underlay}}
+
+ docinto contrib/setup.d
+ dodoc contrib/setup.d/05customdir contrib/setup.d/09fsck contrib/setup.d/10mount-ssh
+
+ newdoc debian/schroot.NEWS NEWS.debian
+
+ newinitd "${FILESDIR}"/schroot.initd schroot
+ newconfd "${FILESDIR}"/schroot.confd schroot
+ newtmpfiles "${FILESDIR}"/schroot.tmpfilesd schroot.conf
+
+ if use doc; then
+ docinto html/sbuild
+ dodoc "${BUILD_DIR}"/doc/sbuild/html/*
+ docinto html/schroot
+ dodoc "${BUILD_DIR}"/doc/schroot/html/*
+ fi
+
+ if use pam; then
+ rm -f "${ED}"/etc/pam.d/schroot
+ pamd_mimic_system schroot auth account session
+ fi
+}
+
+pkg_postinst() {
+ tmpfiles_process ${PN}.conf
+}