From e374e165c2ee372e9c6d10860ea6ef47f180f6b2 Mon Sep 17 00:00:00 2001
From: V3n3RiX <venerix@koprulu.sector>
Date: Sun, 2 Oct 2022 07:12:21 +0100
Subject: gentoo auto-resync : 02:10:2022 - 07:12:21

---
 sys-apps/Manifest.gz                              | Bin 49386 -> 49383 bytes
 sys-apps/cpuid/Manifest                           |   2 +
 sys-apps/cpuid/cpuid-20220927.ebuild              |  35 ++
 sys-apps/hw-probe/Manifest                        |   2 +
 sys-apps/hw-probe/hw-probe-1.6.5.ebuild           |  63 +++
 sys-apps/systemd-utils/Manifest                   |   2 +
 sys-apps/systemd-utils/systemd-utils-251.5.ebuild | 524 +++++++++++++++++++++
 sys-apps/systemd/Manifest                         |   4 +-
 sys-apps/systemd/systemd-251.4.ebuild             |   2 +-
 sys-apps/systemd/systemd-251.5.ebuild             | 529 ++++++++++++++++++++++
 10 files changed, 1161 insertions(+), 2 deletions(-)
 create mode 100644 sys-apps/cpuid/cpuid-20220927.ebuild
 create mode 100644 sys-apps/hw-probe/hw-probe-1.6.5.ebuild
 create mode 100644 sys-apps/systemd-utils/systemd-utils-251.5.ebuild
 create mode 100644 sys-apps/systemd/systemd-251.5.ebuild

(limited to 'sys-apps')

diff --git a/sys-apps/Manifest.gz b/sys-apps/Manifest.gz
index 3ce4b196da52..9f4b5c96809c 100644
Binary files a/sys-apps/Manifest.gz and b/sys-apps/Manifest.gz differ
diff --git a/sys-apps/cpuid/Manifest b/sys-apps/cpuid/Manifest
index d4dc3aecc62e..72c1cf20f5a4 100644
--- a/sys-apps/cpuid/Manifest
+++ b/sys-apps/cpuid/Manifest
@@ -1,4 +1,6 @@
 AUX cpuid-20220620-makefile.patch 1359 BLAKE2B b16bd455de251f3989718fa56c1b19f97d79271998ccf774f74f0886ab8072be482e480604bfad462e0ac9c325470d12e80150e6fc588abfae629cd6499e0ea4 SHA512 680e477460679ae016c95d0e0c5cef916486629011b43cafb5f90c1c097b8c245d4c8b7861a20bdeee05b87b2220ad37a5ca589ff952dd9d7580ca301aac0ada
 DIST cpuid-20220812.src.tar.gz 137109 BLAKE2B 158f152d55b0d8f8ca2df59fc19b9f91142296ef4657b6b2b39ca401abfb26db822be7eadb3a4010847483e75aa213b64756dec6cc625db8c96c8fe8e2a8c468 SHA512 f57c1bb78bad3a9a0d210d5da2a57ea6ffeca83c677f20423dc11af551684ba417b8e5641559cf1d5077567937bd2b2350f232e317ff7be388727983be2c1f6a
+DIST cpuid-20220927.src.tar.gz 137355 BLAKE2B 70c51273fb87fe86a4bf1ddef938275474ad3af496cfdbc8e1b8e7dcf3f33b478340fcd3c8c49c6a0d2fe4927e399977e9c53cab118da0098eae2cc83cea51fc SHA512 f621c4cf8cbe027133442aa29018b9b52eb4d0e45a362cf613fee772456ac9e3347582c2feacb6d3358602f6da6425fcd88924e1ba937c89a5eaac43b1f9143f
 EBUILD cpuid-20220812.ebuild 600 BLAKE2B 1ebc72661435e3d658e51857de187ab6ebf663548f0431f18c5240350d70bf7bd3390503bb5b45d527f28697ff6eaf0ab093847bf812a109f405ba75f95760d8 SHA512 2a2860ba8cb11dcc186d3cfea20232055a184de370651887aacf9db71ffa6cb80594e057ff8f7a4a81f926f38ef1c148cb2a690f9c1ac371acf46dcb01a3e06a
+EBUILD cpuid-20220927.ebuild 602 BLAKE2B 0b44750e78eaccaa51fef6961672ee30daffe9d77ec413201a4779b94ecce53fa10539907cdd3d79d1f6dcdc5a3e542c8cfc0a10deaf6fac01d48b9bbffdf089 SHA512 7abdb0e2514f001cae3c99bd2f0e128a2d17e7ee2d38cbeb7d0043635b02747415ff3c3b3ac86fbd2313d2dc6351e1c0a0094c048fa4e4e0146e3fa5b0290d6d
 MISC metadata.xml 532 BLAKE2B 49d1eb34a9859763d42159adcf9a2dca3128af78aef52cedc4483950084238ba780bd841788f4b27eb72fc44e61c2c5bd264b6c6e2c57824ccf146b6ecad50e9 SHA512 f51db55a3cc5478afba39a42731122db8ac720af8685e093b6952efd2778c9f0668ac936d2a1cdacaf2586d62d0f13240d664a7bd4fbd18236c816e9e6745600
diff --git a/sys-apps/cpuid/cpuid-20220927.ebuild b/sys-apps/cpuid/cpuid-20220927.ebuild
new file mode 100644
index 000000000000..0f77190b474c
--- /dev/null
+++ b/sys-apps/cpuid/cpuid-20220927.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="Linux tool to dump x86 CPUID information about the CPUs"
+HOMEPAGE="http://www.etallen.com/cpuid.html"
+SRC_URI="http://www.etallen.com/${PN}/${P}.src.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+
+BDEPEND="
+	app-arch/gzip
+	dev-lang/perl
+"
+
+DOCS=( "ChangeLog" "FUTURE" )
+
+PATCHES=( "${FILESDIR}/${PN}-20220620-makefile.patch" )
+
+src_prepare() {
+	default
+
+	tc-export CC
+}
+
+src_install() {
+	emake BUILDROOT="${ED}" install
+
+	einstalldocs
+}
diff --git a/sys-apps/hw-probe/Manifest b/sys-apps/hw-probe/Manifest
index 6fe85d6b02d7..3840aff89d5c 100644
--- a/sys-apps/hw-probe/Manifest
+++ b/sys-apps/hw-probe/Manifest
@@ -1,4 +1,6 @@
 AUX README.gentoo 296 BLAKE2B df18c0796912c5cfe6e8f88427ea690512bfd519aa3502528df6f6936571497937a22f8edcd9e9143d915e648f9b341043141cc6d0ae35de55d22d44c0335f6e SHA512 4ae61b89352a4bbe70f4ea1b85eb19e58c2b81475722dda25c289fbe15e7e6e07df51b08471c5d3c5d7a3b12cc09ba599e0d2158dee68c9c66f60908d57b4326
 DIST hw-probe-1.6.4.tar.gz 162317 BLAKE2B 5fc5ddf032c6b2504430349089d95be5310a7ac7752a2b6c3c504240dae6572ee773f8360d6449e9122b20de904a7348a2bdc0af660de44f14cf37b16664ef2a SHA512 c812ebdb23f6b8a4df2f2849a29ecc1307c09f758aeb912face6e899510af69f9dee606fb0ff1807a6de1e89a5f7a8b3259b894cc823b9d25efbf26accf60ac4
+DIST hw-probe-1.6.5.tar.gz 163190 BLAKE2B 1d2ceb152d387018f427cd623897f8c4cc8828a6952c54bb9caa673797ac347b64d9daffcddeca16e8274e5ad42c2cff22efe3330209da1eee5476636167f0ad SHA512 68d6709ca4efe82e0e5de3b580c68f76fa31384af0c53645b6609cee14b944a410e58b12ac13f879d8d86220c1088cfaad17dc6edd24cf27700e449add6f6488
 EBUILD hw-probe-1.6.4.ebuild 2308 BLAKE2B e1619f4d5de09a5d7d2d2b55623d2db2ea5cd3833ac62c49b65fc8e1bc4af837c5f13bb50570d4a402949203b88035874d87c725eb563552816ac3c2afc065e5 SHA512 03e09dc195acb9f079e8980e6a3cd74cfe4da63a846fd177e27888b047ea974345a6a6d5c50eec59e8ac20899857f143cd268065727c0fe631737f81e0839f07
+EBUILD hw-probe-1.6.5.ebuild 2310 BLAKE2B e0be3c494d1c55e417aa6cda7fb5dce20fbdfde3c7a6a8912dea50d689429d76f1070cc04fbe2d38818db82284d4b14a73ad11bfa3d91f0d07f5d8b999bdc63c SHA512 ff0384687c15d332a47e890f49efae9da2a153eebcd971510b7f47704c10a72b87a1e829cf1faa7a47584259b68aeb1b2742ca38ea46782cbeb7db33cb12061d
 MISC metadata.xml 647 BLAKE2B 522741fd8d5f7b64d686ce02dd5ccd7d9ba42df1e50a3e51921fa17c110c6db114ee22d5a903c8bb61a2a5f3884fad5e8b1a929a062af111fd52faf047638ab1 SHA512 ef6e4af1150d72b3cc26ba56267dae006ae8a19a8df2606a9f02df0dc6b091f0bd3dd9caee2171e896dd7b5e582b853f228e899dbd9281dd07b435a1da1f6b7b
diff --git a/sys-apps/hw-probe/hw-probe-1.6.5.ebuild b/sys-apps/hw-probe/hw-probe-1.6.5.ebuild
new file mode 100644
index 000000000000..89965032f4b0
--- /dev/null
+++ b/sys-apps/hw-probe/hw-probe-1.6.5.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit optfeature readme.gentoo-r1
+
+DESCRIPTION="A tool to probe for hardware, check it's operability and find drivers"
+HOMEPAGE="https://github.com/linuxhw/hw-probe/"
+SRC_URI="https://github.com/linuxhw/hw-probe/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+
+RDEPEND="
+	dev-lang/perl
+	dev-perl/Digest-SHA1
+	net-misc/curl
+	sys-apps/dmidecode
+	sys-apps/edid-decode
+	sys-apps/hwinfo
+	sys-apps/pciutils
+	sys-apps/smartmontools
+	sys-apps/usbutils
+	virtual/perl-Data-Dumper
+"
+
+src_compile() {
+	:;
+}
+
+src_install() {
+	default
+
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	readme.gentoo_print_elog
+
+	optfeature "showing Machine Check Exceptions." app-admin/mcelog
+	optfeature "showing additional I/O statistics." app-admin/sysstat
+	optfeature "showing display data channel (ddc) information." app-misc/ddcutil
+	optfeature "showing smart card (reader) information." dev-libs/opensc
+	optfeature "showing Vulkan GPU hardware information." dev-util/vulkan-tools
+	optfeature "showing information of attached scanners." media-gfx/sane-backends
+	optfeature "showing GPU information provided by MESA." media-libs/mesa
+	optfeature "showing zeroconf statistics." net-dns/avahi
+	optfeature "showing HP printer statistics." net-print/hplip
+	optfeature "showing status about rfkill switches on communication devices." net-wireless/rfkill
+	optfeature "showing additional CPU capabilities." sys-apps/cpuid
+	optfeature "showing hard disk (HDD, SSD, ..) capabilities." sys-apps/hdparm
+	optfeature "showing available I2C sensors." sys-apps/i2c-tools
+	optfeature "showing additional hardware and system information detected by inxi." sys-apps/inxi
+	optfeature "showing information about tested memory for faults." sys-apps/memtester
+	optfeature "showing 'Plug & Play' devices." sys-apps/pnputils
+	optfeature "showing systemd boot process information." sys-apps/systemd
+	optfeature "showing ACPI statistics and tables." sys-power/iasl
+	optfeature "showing information about NUMA." sys-process/numactl
+	optfeature "showing additional GPU information provided by MESA progs." x11-apps/mesa-progs
+	optfeature "showing available Xinput devices." x11-apps/xinput
+}
diff --git a/sys-apps/systemd-utils/Manifest b/sys-apps/systemd-utils/Manifest
index 667614b003a9..c85e4fd161c4 100644
--- a/sys-apps/systemd-utils/Manifest
+++ b/sys-apps/systemd-utils/Manifest
@@ -4,5 +4,7 @@ AUX systemd-tmpfiles-setup 329 BLAKE2B 7b4d801ec7c29a3d6073c47af8fa1c9fa670b3762
 AUX systemd-tmpfiles-setup-dev 342 BLAKE2B 95956e57d4f2aa10a09f23c08045ceed6fac3c569ee604a83707310f074740a41832d2e3fa3b528a3816202132e18be50ce40dbcded9430031ed9a2a172d3187 SHA512 3c5e29fc5bc2829984458149de1186075eec48775983376a8b47da162cbf4892754f19a3b277170f8b759a862bb5d910789da1db2bbf8447d6dacccb411be222
 DIST systemd-musl-patches-251.2.tar.gz 28512 BLAKE2B 4ac6a5220dab8409962a3954af2fb2484af718d0f282129957236ce241fbe8538a90d507a96c7c3d86f4f408ab784a6888b37486405d3276e7734a1bd5aa9680 SHA512 6e56b62234ac54929faea5a7cad699d0b932f869b48e3ba4e1f349a88653b7c787efec24a09b00290c3dc566614e3c1dc2f3c04f04e943f513108a91eca1be82
 DIST systemd-stable-251.4.tar.gz 11440203 BLAKE2B 58a0ee4adcc9d35b15b9cc98b3da81d1103b61a6c0bee722468a5113cd7d6de1d40c46ef964ba9ecc4746e81b516ae4b2f1d046874d62db066735c652592612e SHA512 7bbfadd80b88a4c3510a5e4e3572e4eab71dafbf6289da038e552988e09ee8da16da3c9bb8a4fbbde6c6236e0e3c352b0a33f9ee0b84f10241f3499383387738
+DIST systemd-stable-251.5.tar.gz 11444428 BLAKE2B 96df35dae789b11ead1960e1139046972a29c41f74ca800e0fafd84e6a8c238f8d4a30e2991ee94e07e866bc0c3137774ee116f276ac1203cca85254ccf91913 SHA512 2c645a694d45a2670920115529c5f34001153dafe26e5c4e65f8d1a37922a351569d056fc002f1af72dfc173988f93e11893460f64b497e3d5fc339083dcb2fa
 EBUILD systemd-utils-251.4-r2.ebuild 12095 BLAKE2B 21014fadfa7a5ea04e2cabde58ff7a5c404c28feb224680309c49f3f056b2b0af92688d245f17f42896e71bd1e59879ed070c691dfadaaa29e90580a3a216038 SHA512 f3bb8010c6162fc601b95eebc297ae8f3f5256bd6a20c70423aec1c90854744c773f63affe3f610c3b28ab795f5579cfb45ec57f70cb5eb6121c4347a7f45e95
+EBUILD systemd-utils-251.5.ebuild 12004 BLAKE2B 813622adb081673984af0142e4fcec51259441bcc31d2cd2985cd93c31ab6790a82081469525b6e3a05e9fe17f9cc581f717903aefa267aeb5167edebf714521 SHA512 3cfc14f2d5d0570dc6be9d4ad1ad9ebcc17c59970e5840a02a84bda6d80f35b33facddd46554a1857ecc38fc6e69875681e292d57a2dc32205e4e2f88a377c54
 MISC metadata.xml 713 BLAKE2B 1dcb5d9949600c9a8c8ac0c005ffa03b2ca91293a932fa96092a24c094e9fb29f2cf063af041432c12daec4aa4e60d11ea77ed0a423e188095f995c68e75b91a SHA512 46d167a6d898abfc56130e373d232c18fb3ef8865755379fa7678c049515458e7354b7a8cab3bf3faa7326932cccceb0b0745b4695ab9bea492bc2344abf9da4
diff --git a/sys-apps/systemd-utils/systemd-utils-251.5.ebuild b/sys-apps/systemd-utils/systemd-utils-251.5.ebuild
new file mode 100644
index 000000000000..9350a1bda9be
--- /dev/null
+++ b/sys-apps/systemd-utils/systemd-utils-251.5.ebuild
@@ -0,0 +1,524 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PYTHON_COMPAT=( python3_{8..11} )
+
+QA_PKGCONFIG_VERSION=$(ver_cut 1)
+
+inherit bash-completion-r1 flag-o-matic meson-multilib python-any-r1 toolchain-funcs udev usr-ldscript
+
+DESCRIPTION="Utilities split out from systemd for OpenRC users"
+HOMEPAGE="https://systemd.io/"
+
+if [[ ${PV} == *.* ]]; then
+	MY_P="systemd-stable-${PV}"
+	S="${WORKDIR}/${MY_P}"
+	SRC_URI="https://github.com/systemd/systemd-stable/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.tar.gz"
+else
+	MY_P="systemd-${PV}"
+	S="${WORKDIR}/${MY_P}"
+	SRC_URI="https://github.com/systemd/systemd/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.tar.gz"
+fi
+
+MUSL_PATCHSET="systemd-musl-patches-251.2"
+SRC_URI+=" elibc_musl? ( https://dev.gentoo.org/~floppym/dist/${MUSL_PATCHSET}.tar.gz )"
+
+LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="+acl boot +kmod selinux split-usr sysusers +tmpfiles test +udev"
+REQUIRED_USE="|| ( boot tmpfiles sysusers udev )"
+RESTRICT="!test? ( test )"
+
+COMMON_DEPEND="
+	elibc_musl? ( >=sys-libs/musl-1.2.3 )
+	selinux? ( sys-libs/libselinux:0= )
+	tmpfiles? (
+		acl? ( sys-apps/acl:0= )
+	)
+	udev? (
+		>=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
+		sys-libs/libcap:0=[${MULTILIB_USEDEP}]
+		virtual/libcrypt:=[${MULTILIB_USEDEP}]
+		acl? ( sys-apps/acl:0= )
+		kmod? ( >=sys-apps/kmod-15:0= )
+	)
+	!udev? (
+		>=sys-apps/util-linux-2.30:0=
+		sys-libs/libcap:0=
+		virtual/libcrypt:=
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	>=sys-kernel/linux-headers-3.11
+	boot? ( >=sys-boot/gnu-efi-3.0.2 )
+"
+RDEPEND="${COMMON_DEPEND}
+	boot? ( !<sys-boot/systemd-boot-250 )
+	tmpfiles? ( !<sys-apps/systemd-tmpfiles-250 )
+	udev? (
+		acct-group/audio
+		acct-group/cdrom
+		acct-group/dialout
+		acct-group/disk
+		acct-group/input
+		acct-group/kmem
+		acct-group/kvm
+		acct-group/lp
+		acct-group/render
+		acct-group/sgx
+		acct-group/tape
+		acct-group/tty
+		acct-group/video
+		!sys-apps/gentoo-systemd-integration
+		!sys-apps/hwids[udev]
+		!<sys-fs/udev-250
+		!sys-fs/eudev
+	)
+	!sys-apps/systemd
+"
+PDEPEND="
+	udev? ( >=sys-fs/udev-init-scripts-34 )
+"
+BDEPEND="
+	$(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]')
+	app-text/docbook-xml-dtd:4.2
+	app-text/docbook-xml-dtd:4.5
+	app-text/docbook-xsl-stylesheets
+	dev-libs/libxslt
+	dev-util/gperf
+	>=sys-apps/coreutils-8.16
+	sys-devel/gettext
+	virtual/pkgconfig
+"
+
+TMPFILES_OPTIONAL=1
+UDEV_OPTIONAL=1
+
+python_check_deps() {
+	python_has_version "dev-python/jinja[${PYTHON_USEDEP}]"
+}
+
+QA_EXECSTACK="usr/lib/systemd/boot/efi/*"
+QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*"
+
+src_prepare() {
+	local PATCHES=(
+		# Breaks Clang. Revert the commit for now and force off F_S=3.
+		"${FILESDIR}/251-revert-fortify-source-3-fix.patch"
+	)
+
+	if use elibc_musl; then
+		PATCHES+=( "${WORKDIR}/${MUSL_PATCHSET}" )
+		# Applied upstream in 251.3
+		rm "${WORKDIR}/${MUSL_PATCHSET}/0001-Add-sys-file.h-for-LOCK_.patch" || die
+	fi
+	default
+
+	# Remove install_rpath; we link statically
+	local rpath_pattern="install_rpath : rootlibexecdir,"
+	grep -q -e "${rpath_pattern}" meson.build || die
+	sed -i -e "/${rpath_pattern}/d" meson.build || die
+}
+
+src_configure() {
+	# Broken with FORTIFY_SOURCE=3 without a patch. And the patch
+	# wasn't backported to 250.x, but it turns out to break Clang
+	# anyway:  bug #841770.
+	#
+	# Our toolchain sets F_S=2 by default w/ >= -O2, so we need
+	# to unset F_S first, then explicitly set 2, to negate any default
+	# and anything set by the user if they're choosing 3 (or if they've
+	# modified GCC to set 3).
+	#
+	if is-flagq '-O[23]' || is-flagq '-Ofast' ; then
+		# We can't unconditionally do this b/c we fortify needs
+		# some level of optimisation.
+		filter-flags -D_FORTIFY_SOURCE=3
+		append-cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
+	fi
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local emesonargs=(
+		$(meson_use split-usr)
+		$(meson_use split-usr split-bin)
+		-Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")"
+		-Drootlibdir="${EPREFIX}/usr/$(get_libdir)"
+		-Dsysvinit-path=
+		$(meson_native_use_bool boot efi)
+		$(meson_native_use_bool boot gnu-efi)
+		$(meson_native_use_bool boot kernel-install)
+		$(meson_native_use_bool selinux)
+		$(meson_native_use_bool sysusers)
+		$(meson_use test tests)
+		$(meson_native_use_bool tmpfiles)
+		$(meson_use udev hwdb)
+
+		-Defi-libdir="${ESYSROOT}/usr/$(get_libdir)"
+
+		# Link staticly with libsystemd-shared
+		-Dlink-boot-shared=false
+		-Dlink-udev-shared=false
+
+		# systemd-tmpfiles has a separate "systemd-tmpfiles.standalone" target
+		-Dstandalone-binaries=true
+
+		# Disable all optional features
+		-Dadm-group=false
+		-Danalyze=false
+		-Dapparmor=false
+		-Daudit=false
+		-Dbacklight=false
+		-Dbinfmt=false
+		-Dbzip2=false
+		-Dcoredump=false
+		-Ddbus=false
+		-Delfutils=false
+		-Denvironment-d=false
+		-Dfdisk=false
+		-Dgcrypt=false
+		-Dglib=false
+		-Dgshadow=false
+		-Dgnutls=false
+		-Dhibernate=false
+		-Dhostnamed=false
+		-Didn=false
+		-Dima=false
+		-Dinitrd=false
+		-Dfirstboot=false
+		-Dldconfig=false
+		-Dlibcryptsetup=false
+		-Dlibcurl=false
+		-Dlibfido2=false
+		-Dlibidn=false
+		-Dlibidn2=false
+		-Dlibiptc=false
+		-Dlocaled=false
+		-Dlogind=false
+		-Dlz4=false
+		-Dmachined=false
+		-Dmicrohttpd=false
+		-Dnetworkd=false
+		-Dnscd=false
+		-Dnss-myhostname=false
+		-Dnss-resolve=false
+		-Dnss-systemd=false
+		-Doomd=false
+		-Dopenssl=false
+		-Dp11kit=false
+		-Dpam=false
+		-Dpcre2=false
+		-Dpolkit=false
+		-Dportabled=false
+		-Dpstore=false
+		-Dpwquality=false
+		-Drandomseed=false
+		-Dresolve=false
+		-Drfkill=false
+		-Dseccomp=false
+		-Dsmack=false
+		-Dsysext=false
+		-Dtimedated=false
+		-Dtimesyncd=false
+		-Dtpm=false
+		-Dqrencode=false
+		-Dquotacheck=false
+		-Duserdb=false
+		-Dutmp=false
+		-Dvconsole=false
+		-Dwheel-group=false
+		-Dxdg-autostart=false
+		-Dxkbcommon=false
+		-Dxz=false
+		-Dzlib=false
+		-Dzstd=false
+	)
+
+	if use tmpfiles || use udev; then
+		emesonargs+=( $(meson_native_use_bool acl) )
+	else
+		emesonargs+=( -Dacl=false )
+	fi
+
+	if use udev; then
+		emesonargs+=( $(meson_native_use_bool kmod) )
+	else
+		emesonargs+=( -Dkmod=false )
+	fi
+
+	if use elibc_musl; then
+		# Avoid redefinition of struct ethhdr.
+		append-cppflags -D__UAPI_DEF_ETHHDR=0
+	fi
+
+	if multilib_is_native_abi || use udev; then
+		meson_src_configure
+	fi
+}
+
+efi_arch() {
+	case "$(tc-arch)" in
+		amd64) echo x64 ;;
+		arm)   echo arm ;;
+		arm64) echo aa64 ;;
+		x86)   echo x86 ;;
+	esac
+}
+
+multilib_src_compile() {
+	local targets=()
+	if multilib_is_native_abi; then
+		if use boot; then
+			targets+=(
+				bootctl
+				kernel-install
+				man/bootctl.1
+				man/kernel-install.8
+				src/boot/efi/linux$(efi_arch).{efi,elf}.stub
+				src/boot/efi/systemd-boot$(efi_arch).efi
+			)
+		fi
+		if use sysusers; then
+			targets+=(
+				systemd-sysusers.standalone
+				man/sysusers.d.5
+				man/systemd-sysusers.8
+			)
+			if use test; then
+				targets+=(
+					systemd-runtest.env
+				)
+			fi
+		fi
+		if use tmpfiles; then
+			targets+=(
+				systemd-tmpfiles.standalone
+				man/tmpfiles.d.5
+				man/systemd-tmpfiles.8
+			)
+			if use test; then
+				targets+=( test-tmpfiles )
+			fi
+		fi
+		if use udev; then
+			targets+=(
+				udevadm
+				systemd-hwdb
+				src/udev/ata_id
+				src/udev/cdrom_id
+				src/udev/fido_id
+				src/udev/mtd_probe
+				src/udev/scsi_id
+				src/udev/udev.pc
+				src/udev/v4l_id
+				man/udev.conf.5
+				man/systemd.link.5
+				man/hwdb.7
+				man/udev.7
+				man/systemd-hwdb.8
+				man/systemd-udevd.service.8
+				man/udevadm.8
+				hwdb.d/60-autosuspend-chromiumos.hwdb
+				rules.d/50-udev-default.rules
+				rules.d/64-btrfs.rules
+			)
+			if use test; then
+				targets+=(
+					# Used by udev-test.pl
+					systemd-detect-virt
+					test/sys
+					test-udev
+
+					test-fido-id-desc
+					test-udev-builtin
+					test-udev-event
+					test-udev-netlink
+					test-udev-node
+					test-udev-util
+				)
+			fi
+		fi
+	fi
+	if use udev; then
+		targets+=(
+			udev:shared_library
+			src/libudev/libudev.pc
+		)
+		if use test; then
+			targets+=(
+				test-libudev
+				test-libudev-sym
+				test-udev-device-thread
+			)
+		fi
+	fi
+	if multilib_is_native_abi || use udev; then
+		meson_src_compile "${targets[@]}"
+	fi
+}
+
+multilib_src_test() {
+	local tests=()
+	if multilib_is_native_abi; then
+		if use sysusers; then
+			tests+=(
+				test-sysusers.standalone
+			)
+		fi
+		if use tmpfiles; then
+			tests+=(
+				test-systemd-tmpfiles.standalone
+				test-tmpfiles
+			)
+		fi
+		if use udev; then
+			tests+=(
+				rule-syntax-check
+				test-fido-id-desc
+				test-udev-builtin
+				test-udev-event
+				test-udev-netlink
+				test-udev-node
+				test-udev-util
+			)
+			if [[ -w /dev ]]; then
+				tests+=( udev-test )
+			else
+				ewarn "Skipping udev-test (needs write access to /dev)"
+			fi
+		fi
+	fi
+	if use udev; then
+		tests+=(
+			test-libudev
+			test-libudev-sym
+			test-udev-device-thread
+		)
+	fi
+	if [[ ${#tests[@]} -ne 0 ]]; then
+		meson_src_test "${tests[@]}"
+	fi
+}
+
+src_install() {
+	local rootprefix="$(usex split-usr '' /usr)"
+	meson-multilib_src_install
+}
+
+multilib_src_install() {
+	if multilib_is_native_abi; then
+		if use boot; then
+			into /usr
+			dobin bootctl kernel-install
+			doman man/{bootctl.1,kernel-install.8}
+			insinto usr/lib/systemd/boot/efi
+			doins src/boot/efi/{linux$(efi_arch).{efi,elf}.stub,systemd-boot$(efi_arch).efi}
+		fi
+		if use sysusers; then
+			into "${rootprefix:-/}"
+			newbin systemd-sysusers{.standalone,}
+			doman man/{systemd-sysusers.8,sysusers.d.5}
+		fi
+		if use tmpfiles; then
+			into "${rootprefix:-/}"
+			newbin systemd-tmpfiles{.standalone,}
+			doman man/{systemd-tmpfiles.8,tmpfiles.d.5}
+		fi
+		if use udev; then
+			into "${rootprefix:-/}"
+			dobin udevadm systemd-hwdb
+			dosym ../../bin/udevadm "${rootprefix}"/lib/systemd/systemd-udevd
+
+			exeinto "${rootprefix}"/lib/udev
+			doexe src/udev/{ata_id,cdrom_id,fido_id,mtd_probe,scsi_id,v4l_id}
+
+			insinto "${rootprefix}"/lib/udev/rules.d
+			doins rules.d/*.rules
+
+			insinto "${rootprefix}"/lib/udev/hwdb.d
+			doins hwdb.d/*.hwdb
+
+			insinto /usr/share/pkgconfig
+			doins src/udev/udev.pc
+
+			doman man/{udev.conf.5,systemd.link.5,hwdb.7,systemd-hwdb.8,udev.7,udevadm.8}
+			newman man/systemd-udevd.service.8 systemd-udevd.8
+		fi
+	fi
+	if use udev; then
+		meson_install --no-rebuild --tags libudev
+		gen_usr_ldscript -a udev
+		insinto "/usr/$(get_libdir)/pkgconfig"
+		doins src/libudev/libudev.pc
+	fi
+}
+
+multilib_src_install_all() {
+	einstalldocs
+	if use boot; then
+		into /usr
+		exeinto usr/lib/kernel/install.d
+		doexe src/kernel-install/*.install
+		dobashcomp shell-completion/bash/bootctl
+		insinto /usr/share/zsh/site-functions
+		doins shell-completion/zsh/{_bootctl,_kernel-install}
+	fi
+	if use tmpfiles; then
+		doinitd "${FILESDIR}"/systemd-tmpfiles-setup
+		doinitd "${FILESDIR}"/systemd-tmpfiles-setup-dev
+		insinto /usr/share/zsh/site-functions
+		doins shell-completion/zsh/_systemd-tmpfiles
+	fi
+	if use udev; then
+		doheader src/libudev/libudev.h
+
+		insinto /etc/udev
+		doins src/udev/udev.conf
+		keepdir /etc/udev/{hwdb.d,rules.d}
+
+		insinto "${rootprefix}"/lib/systemd/network
+		doins network/99-default.link
+
+		# Remove to avoid conflict with elogind
+		# https://bugs.gentoo.org/856433
+		rm rules.d/70-power-switch.rules || die
+		insinto /lib/udev/rules.d
+		doins rules.d/*.rules
+		doins "${FILESDIR}"/40-gentoo.rules
+
+		insinto /lib/udev/hwdb.d
+		doins hwdb.d/*.hwdb
+
+		dobashcomp shell-completion/bash/udevadm
+
+		insinto /usr/share/zsh/site-functions
+		doins shell-completion/zsh/_udevadm
+	fi
+}
+
+add_service() {
+	local initd=$1
+	local runlevel=$2
+
+	ebegin "Adding '${initd}' service to the '${runlevel}' runlevel"
+	mkdir -p "${EROOT}/etc/runlevels/${runlevel}" &&
+	ln -snf "${EPREFIX}/etc/init.d/${initd}" "${EROOT}/etc/runlevels/${runlevel}/${initd}"
+	eend $?
+}
+
+pkg_postinst() {
+	if [[ -z ${REPLACING_VERSIONS} ]]; then
+		add_service systemd-tmpfiles-setup-dev sysinit
+		add_service systemd-tmpfiles-setup boot
+	fi
+	if use udev; then
+		ebegin "Updating hwdb"
+		systemd-hwdb --root="${ROOT}" update
+		eend $?
+		udev_reload
+	fi
+}
diff --git a/sys-apps/systemd/Manifest b/sys-apps/systemd/Manifest
index 1487e606e591..eb8155eef186 100644
--- a/sys-apps/systemd/Manifest
+++ b/sys-apps/systemd/Manifest
@@ -7,7 +7,9 @@ AUX nsswitch.conf 734 BLAKE2B 5f5a7821a84f6c8aa31fe9a68c29a1a0f24be578d427a623f1
 AUX systemd-user.pam 122 BLAKE2B cccc07cab47dfc0481438e503c34fa1a0b2c6b1f8ab282197719a523421d2a526f19230bb459e0347cbeb2046e35a407c78178a3fb5b79619e987cbc4ac7d5e4 SHA512 c5437677ff00fbb45798fe594e8d61b1c2bfc2d103105d7bd82e476240452477ac263700800f5d0ba91ddc895eb85f4517d5cb15c80611ec1680a686d47cd781
 DIST systemd-stable-251.3.tar.gz 11435458 BLAKE2B 544238536848ab390b2476d5ad95d33998674be50020b8db0627bb9d0c86be6576c404ce786b01ceec86f1c75b174c6fc2d7e0d7fbab802a78f48c9d0915c2b8 SHA512 fb5b8dc1742562ef95469e90d406cfb6dfcb337860ad1208b460414b88ff0565071bde797d195faa62761206abc881829de6b1009e5d727cad2dfe0764310d5f
 DIST systemd-stable-251.4.tar.gz 11440203 BLAKE2B 58a0ee4adcc9d35b15b9cc98b3da81d1103b61a6c0bee722468a5113cd7d6de1d40c46ef964ba9ecc4746e81b516ae4b2f1d046874d62db066735c652592612e SHA512 7bbfadd80b88a4c3510a5e4e3572e4eab71dafbf6289da038e552988e09ee8da16da3c9bb8a4fbbde6c6236e0e3c352b0a33f9ee0b84f10241f3499383387738
+DIST systemd-stable-251.5.tar.gz 11444428 BLAKE2B 96df35dae789b11ead1960e1139046972a29c41f74ca800e0fafd84e6a8c238f8d4a30e2991ee94e07e866bc0c3137774ee116f276ac1203cca85254ccf91913 SHA512 2c645a694d45a2670920115529c5f34001153dafe26e5c4e65f8d1a37922a351569d056fc002f1af72dfc173988f93e11893460f64b497e3d5fc339083dcb2fa
 EBUILD systemd-251.3.ebuild 15507 BLAKE2B a5b9463fe2f440b01ab987b134fb147f88a811393e8122f2e404ca8163c7805cf42844292da3dbed72140e188958ccd67f11fc000c94b2e76aea0054a7a0606e SHA512 d1cd4e249b30fe9f975c4a70d7efd08b718dab197d84de621ab2e407299de764a1b47dc7d5df60028e3a2a5feedc9824b5d295a71c5583c369cc8283565de281
-EBUILD systemd-251.4.ebuild 15507 BLAKE2B 029709d318486fec25bebb409fa6a4d57741b5653e77722be5fe306820c0ea0e73036955406e5f1cbfebeb1f8b08fbd6da5a283d195763c6834abf8f0624ead3 SHA512 48e379d8b9a91b662c3400938f622f4f7f47c3a890892cb73a3b77fa21ec849ef7237797a2bca9c702115a51378cd180a4fa7bc33cd2f2c95d27c6cdc7136343
+EBUILD systemd-251.4.ebuild 15502 BLAKE2B 9c32b7812ce4660295199025e9da9d7aed979369f3d2275b4892bea90b356c520930675cadbaa98b1beccdc4f560c0720e854df76293a2c8acef02333e06ddb4 SHA512 b31f0361384923e6172b52232534c6f0a884d9fda7883794718292966863a95a990a159a43ac4513641f4967e318f2c6d7eac4631a452391db4396122d727b7e
+EBUILD systemd-251.5.ebuild 15510 BLAKE2B 6230fd24121c666d23af77e4eac37a1647c9271c4cfd7731acae7fd0c2392c048b6113b94a79e54066d77c6866e4700648ced41b54245068aca926705c8975cd SHA512 b2a54d4ed138e47dd41463c2e30f3c0b992cad176e2c46bebb98e115283863c242460e3de6049b7ac5817d7d0e62c25b46336686ad82b75cd759770f14c42d09
 EBUILD systemd-9999.ebuild 15374 BLAKE2B 932ea3a520d8e5371dc88d6bb474a0068141a9565332652589fc5d944a5e55cc81985ca5e05acb3d2c554da4355bcf3f80c6584469ac2bad41604c5dd8c9a099 SHA512 f26a179ce91729627b7c6c78ea8ca6515696bc330f1f012b2b02d15a5134028fe5066f03b0a4b78cfde77d37eafdda75731a5ff8dec82c694c49547f61c839bf
 MISC metadata.xml 2545 BLAKE2B fc424b7f9e471860cba69b6f11ea2094c70f125cd55c42ea77e4549a399680c4444119c79424c266828a284b0214001421f760477b1341844dddd2d474d70c33 SHA512 f0b8c4614e3c88d123916bb3399d6025ab30ff839849b136a29e1960bf0c50699b3f09b5307f40b77cc8c5566c20b11de2364a08311adceb15507df3e4bb0565
diff --git a/sys-apps/systemd/systemd-251.4.ebuild b/sys-apps/systemd/systemd-251.4.ebuild
index 77e48349d5ef..487bf56cfcf6 100644
--- a/sys-apps/systemd/systemd-251.4.ebuild
+++ b/sys-apps/systemd/systemd-251.4.ebuild
@@ -23,7 +23,7 @@ else
 	MY_P=${MY_PN}-${MY_PV}
 	S=${WORKDIR}/${MY_P}
 	SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz"
-	KEYWORDS="~alpha ~amd64 ~arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+	KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
 fi
 
 inherit bash-completion-r1 flag-o-matic linux-info meson-multilib pam python-any-r1 systemd toolchain-funcs udev usr-ldscript
diff --git a/sys-apps/systemd/systemd-251.5.ebuild b/sys-apps/systemd/systemd-251.5.ebuild
new file mode 100644
index 000000000000..df1093c4548c
--- /dev/null
+++ b/sys-apps/systemd/systemd-251.5.ebuild
@@ -0,0 +1,529 @@
+# Copyright 2011-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_{8..11} )
+
+# Avoid QA warnings
+TMPFILES_OPTIONAL=1
+UDEV_OPTIONAL=1
+
+QA_PKGCONFIG_VERSION=$(ver_cut 1)
+
+if [[ ${PV} == 9999 ]]; then
+	EGIT_REPO_URI="https://github.com/systemd/systemd.git"
+	inherit git-r3
+else
+	if [[ ${PV} == *.* ]]; then
+		MY_PN=systemd-stable
+	else
+		MY_PN=systemd
+	fi
+	MY_PV=${PV/_/-}
+	MY_P=${MY_PN}-${MY_PV}
+	S=${WORKDIR}/${MY_P}
+	SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz"
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+fi
+
+inherit bash-completion-r1 flag-o-matic linux-info meson-multilib pam python-any-r1 systemd toolchain-funcs udev usr-ldscript
+
+DESCRIPTION="System and service manager for Linux"
+HOMEPAGE="http://systemd.io/"
+
+LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
+SLOT="0/2"
+IUSE="
+	acl apparmor audit build cgroup-hybrid cryptsetup curl +dns-over-tls elfutils
+	fido2 +gcrypt gnuefi gnutls homed http idn importd iptables +kmod
+	+lz4 lzma +openssl pam pcre pkcs11 policykit pwquality qrcode
+	+resolvconf +seccomp selinux split-usr +sysv-utils test tpm vanilla xkb +zstd
+"
+REQUIRED_USE="
+	dns-over-tls? ( || ( gnutls openssl ) )
+	homed? ( cryptsetup pam openssl )
+	importd? ( curl lzma || ( gcrypt openssl ) )
+	pwquality? ( homed )
+"
+RESTRICT="!test? ( test )"
+
+MINKV="4.15"
+
+COMMON_DEPEND="
+	>=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
+	sys-libs/libcap:0=[${MULTILIB_USEDEP}]
+	virtual/libcrypt:=[${MULTILIB_USEDEP}]
+	acl? ( sys-apps/acl:0= )
+	apparmor? ( sys-libs/libapparmor:0= )
+	audit? ( >=sys-process/audit-2:0= )
+	cryptsetup? ( >=sys-fs/cryptsetup-2.0.1:0= )
+	curl? ( net-misc/curl:0= )
+	elfutils? ( >=dev-libs/elfutils-0.158:0= )
+	fido2? ( dev-libs/libfido2:0= )
+	gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
+	gnutls? ( >=net-libs/gnutls-3.6.0:0= )
+	http? ( >=net-libs/libmicrohttpd-0.9.33:0=[epoll(+)] )
+	idn? ( net-dns/libidn2:= )
+	importd? (
+		app-arch/bzip2:0=
+		sys-libs/zlib:0=
+	)
+	kmod? ( >=sys-apps/kmod-15:0= )
+	lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] )
+	lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
+	iptables? ( net-firewall/iptables:0= )
+	openssl? ( >=dev-libs/openssl-1.1.0:0= )
+	pam? ( sys-libs/pam:=[${MULTILIB_USEDEP}] )
+	pkcs11? ( app-crypt/p11-kit:0= )
+	pcre? ( dev-libs/libpcre2 )
+	pwquality? ( dev-libs/libpwquality:0= )
+	qrcode? ( media-gfx/qrencode:0= )
+	seccomp? ( >=sys-libs/libseccomp-2.3.3:0= )
+	selinux? ( sys-libs/libselinux:0= )
+	tpm? ( app-crypt/tpm2-tss:0= )
+	xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
+	zstd? ( >=app-arch/zstd-1.4.0:0=[${MULTILIB_USEDEP}] )
+"
+
+# Newer linux-headers needed by ia64, bug #480218
+DEPEND="${COMMON_DEPEND}
+	>=sys-kernel/linux-headers-${MINKV}
+	gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
+"
+
+# baselayout-2.2 has /run
+RDEPEND="${COMMON_DEPEND}
+	>=acct-group/adm-0-r1
+	>=acct-group/wheel-0-r1
+	>=acct-group/kmem-0-r1
+	>=acct-group/tty-0-r1
+	>=acct-group/utmp-0-r1
+	>=acct-group/audio-0-r1
+	>=acct-group/cdrom-0-r1
+	>=acct-group/dialout-0-r1
+	>=acct-group/disk-0-r1
+	>=acct-group/input-0-r1
+	>=acct-group/kvm-0-r1
+	>=acct-group/lp-0-r1
+	>=acct-group/render-0-r1
+	acct-group/sgx
+	>=acct-group/tape-0-r1
+	acct-group/users
+	>=acct-group/video-0-r1
+	>=acct-group/systemd-journal-0-r1
+	>=acct-user/root-0-r1
+	acct-user/nobody
+	>=acct-user/systemd-journal-remote-0-r1
+	>=acct-user/systemd-coredump-0-r1
+	>=acct-user/systemd-network-0-r1
+	acct-user/systemd-oom
+	>=acct-user/systemd-resolve-0-r1
+	>=acct-user/systemd-timesync-0-r1
+	>=sys-apps/baselayout-2.2
+	selinux? (
+		sec-policy/selinux-base-policy[systemd]
+		sec-policy/selinux-ntp
+	)
+	sysv-utils? (
+		!sys-apps/openrc[sysv-utils(-)]
+		!sys-apps/sysvinit
+	)
+	!sysv-utils? ( sys-apps/sysvinit )
+	resolvconf? ( !net-dns/openresolv )
+	!build? ( || (
+		sys-apps/util-linux[kill(-)]
+		sys-process/procps[kill(+)]
+		sys-apps/coreutils[kill(-)]
+	) )
+	!sys-apps/hwids[udev]
+	!sys-auth/nss-myhostname
+	!sys-fs/eudev
+	!sys-fs/udev
+"
+
+# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
+PDEPEND=">=sys-apps/dbus-1.9.8[systemd]
+	>=sys-fs/udev-init-scripts-34
+	policykit? ( sys-auth/polkit )
+	!vanilla? ( sys-apps/gentoo-systemd-integration )"
+
+BDEPEND="
+	app-arch/xz-utils:0
+	dev-util/gperf
+	>=dev-util/meson-0.46
+	>=sys-apps/coreutils-8.16
+	sys-devel/gettext
+	virtual/pkgconfig
+	test? (
+		app-text/tree
+		dev-lang/perl
+		sys-apps/dbus
+	)
+	app-text/docbook-xml-dtd:4.2
+	app-text/docbook-xml-dtd:4.5
+	app-text/docbook-xsl-stylesheets
+	dev-libs/libxslt:0
+	$(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]')
+	$(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]')
+"
+
+python_check_deps() {
+	python_has_version "dev-python/jinja[${PYTHON_USEDEP}]" &&
+	python_has_version "dev-python/lxml[${PYTHON_USEDEP}]"
+}
+
+QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*"
+QA_EXECSTACK="usr/lib/systemd/boot/efi/*"
+
+pkg_pretend() {
+	if [[ ${MERGE_TYPE} != buildonly ]]; then
+		if use test && has pid-sandbox ${FEATURES}; then
+			ewarn "Tests are known to fail with PID sandboxing enabled."
+			ewarn "See https://bugs.gentoo.org/674458."
+		fi
+
+		local CONFIG_CHECK=" ~BINFMT_MISC ~BLK_DEV_BSG ~CGROUPS
+			~CGROUP_BPF ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE
+			~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS
+			~TIMERFD ~TMPFS_XATTR ~UNIX ~USER_NS
+			~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH
+			~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
+			~!SYSFS_DEPRECATED_V2"
+
+		use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
+		use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER"
+
+		if kernel_is -ge 5 10 20; then
+			CONFIG_CHECK+=" ~KCMP"
+		else
+			CONFIG_CHECK+=" ~CHECKPOINT_RESTORE"
+		fi
+
+		if kernel_is -ge 4 18; then
+			CONFIG_CHECK+=" ~AUTOFS_FS"
+		else
+			CONFIG_CHECK+=" ~AUTOFS4_FS"
+		fi
+
+		if linux_config_exists; then
+			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+			if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then
+				ewarn "It's recommended to set an empty value to the following kernel config option:"
+				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+			fi
+			if linux_chkconfig_present X86; then
+				CONFIG_CHECK+=" ~DMIID"
+			fi
+		fi
+
+		if kernel_is -lt ${MINKV//./ }; then
+			ewarn "Kernel version at least ${MINKV} required"
+		fi
+
+		check_extra_config
+	fi
+}
+
+pkg_setup() {
+	:
+}
+
+src_unpack() {
+	default
+	[[ ${PV} != 9999 ]] || git-r3_src_unpack
+}
+
+src_prepare() {
+	local PATCHES=(
+		# Breaks Clang. Revert the commit for now and force off F_S=3.
+		# bug #841770.
+		"${FILESDIR}/251-revert-fortify-source-3-fix.patch"
+	)
+
+	if ! use vanilla; then
+		PATCHES+=(
+			"${FILESDIR}/gentoo-generator-path-r2.patch"
+			"${FILESDIR}/gentoo-systemctl-disable-sysv-sync-r1.patch"
+			"${FILESDIR}/gentoo-journald-audit.patch"
+		)
+	fi
+
+	# Fails with split-usr.
+	sed -i -e '2i exit 77' test/test-rpm-macros.sh || die
+
+	default
+}
+
+src_configure() {
+	# Prevent conflicts with i686 cross toolchain, bug 559726
+	tc-export AR CC NM OBJCOPY RANLIB
+
+	# Broken with FORTIFY_SOURCE=3 without a patch. We have to revert
+	# the upstream patch for it because it breaks Clang: bug #841770.
+	#
+	# Our toolchain sets F_S=2 by default w/ >= -O2, so we need
+	# to unset F_S first, then explicitly set 2, to negate any default
+	# and anything set by the user if they're choosing 3 (or if they've
+	# modified GCC to set 3).
+	#
+	if is-flagq '-O[23]' || is-flagq '-Ofast' ; then
+		# We can't unconditionally do this b/c we fortify needs
+		# some level of optimisation.
+		filter-flags -D_FORTIFY_SOURCE=3
+		append-cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
+	fi
+
+	python_setup
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=(
+		--localstatedir="${EPREFIX}/var"
+		-Dsupport-url="https://gentoo.org/support/"
+		-Dpamlibdir="$(getpam_mod_dir)"
+		# avoid bash-completion dep
+		-Dbashcompletiondir="$(get_bashcompdir)"
+		$(meson_use split-usr)
+		$(meson_use split-usr split-bin)
+		-Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")"
+		-Drootlibdir="${EPREFIX}/usr/$(get_libdir)"
+		# Avoid infinite exec recursion, bug 642724
+		-Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit"
+		# no deps
+		-Dima=true
+		-Ddefault-hierarchy=$(usex cgroup-hybrid hybrid unified)
+		# Optional components/dependencies
+		$(meson_native_use_bool acl)
+		$(meson_native_use_bool apparmor)
+		$(meson_native_use_bool audit)
+		$(meson_native_use_bool cryptsetup libcryptsetup)
+		$(meson_native_use_bool curl libcurl)
+		$(meson_native_use_bool dns-over-tls dns-over-tls)
+		$(meson_native_use_bool elfutils)
+		$(meson_native_use_bool fido2 libfido2)
+		$(meson_use gcrypt)
+		$(meson_native_use_bool gnuefi gnu-efi)
+		$(meson_native_use_bool gnutls)
+		-Defi-includedir="${ESYSROOT}/usr/include/efi"
+		-Defi-libdir="${ESYSROOT}/usr/$(get_libdir)"
+		$(meson_native_use_bool homed)
+		$(meson_native_use_bool http microhttpd)
+		$(meson_native_use_bool idn)
+		$(meson_native_use_bool importd)
+		$(meson_native_use_bool importd bzip2)
+		$(meson_native_use_bool importd zlib)
+		$(meson_native_use_bool kmod)
+		$(meson_use lz4)
+		$(meson_use lzma xz)
+		$(meson_use zstd)
+		$(meson_native_use_bool iptables libiptc)
+		$(meson_native_use_bool openssl)
+		$(meson_use pam)
+		$(meson_native_use_bool pkcs11 p11kit)
+		$(meson_native_use_bool pcre pcre2)
+		$(meson_native_use_bool policykit polkit)
+		$(meson_native_use_bool pwquality)
+		$(meson_native_use_bool qrcode qrencode)
+		$(meson_native_use_bool seccomp)
+		$(meson_native_use_bool selinux)
+		$(meson_native_use_bool tpm tpm2)
+		$(meson_native_use_bool test dbus)
+		$(meson_native_use_bool xkb xkbcommon)
+		-Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
+		# Breaks screen, tmux, etc.
+		-Ddefault-kill-user-processes=false
+		-Dcreate-log-dirs=false
+
+		# multilib options
+		$(meson_native_true backlight)
+		$(meson_native_true binfmt)
+		$(meson_native_true coredump)
+		$(meson_native_true environment-d)
+		$(meson_native_true firstboot)
+		$(meson_native_true hibernate)
+		$(meson_native_true hostnamed)
+		$(meson_native_true ldconfig)
+		$(meson_native_true localed)
+		$(meson_native_true man)
+		$(meson_native_true networkd)
+		$(meson_native_true quotacheck)
+		$(meson_native_true randomseed)
+		$(meson_native_true rfkill)
+		$(meson_native_true sysusers)
+		$(meson_native_true timedated)
+		$(meson_native_true timesyncd)
+		$(meson_native_true tmpfiles)
+		$(meson_native_true vconsole)
+	)
+
+	meson_src_configure "${myconf[@]}"
+}
+
+multilib_src_test() {
+	unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR
+	meson_src_test
+}
+
+multilib_src_install_all() {
+	local rootprefix=$(usex split-usr '' /usr)
+	local sbin=$(usex split-usr sbin bin)
+
+	# meson doesn't know about docdir
+	mv "${ED}"/usr/share/doc/{systemd,${PF}} || die
+
+	einstalldocs
+	dodoc "${FILESDIR}"/nsswitch.conf
+
+	if ! use resolvconf; then
+		rm -f "${ED}${rootprefix}/${sbin}"/resolvconf || die
+	fi
+
+	rm "${ED}"/etc/init.d/README || die
+	rm "${ED}${rootprefix}"/lib/systemd/system-generators/systemd-sysv-generator || die
+
+	if ! use sysv-utils; then
+		rm "${ED}${rootprefix}/${sbin}"/{halt,init,poweroff,reboot,runlevel,shutdown,telinit} || die
+		rm "${ED}"/usr/share/man/man1/init.1 || die
+		rm "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 || die
+	fi
+
+	if ! use resolvconf && ! use sysv-utils && ! use split-usr; then
+		rmdir "${ED}${rootprefix}"/sbin || die
+	fi
+
+	# https://bugs.gentoo.org/761763
+	rm -r "${ED}"/usr/lib/sysusers.d || die
+
+	# Preserve empty dirs in /etc & /var, bug #437008
+	keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d}
+	keepdir /etc/kernel/install.d
+	keepdir /etc/systemd/{network,system,user}
+	keepdir /etc/udev/rules.d
+
+	keepdir /etc/udev/hwdb.d
+
+	keepdir "${rootprefix}"/lib/systemd/{system-sleep,system-shutdown}
+	keepdir /usr/lib/{binfmt.d,modules-load.d}
+	keepdir /usr/lib/systemd/user-generators
+	keepdir /var/lib/systemd
+	keepdir /var/log/journal
+
+	# Symlink /etc/sysctl.conf for easy migration.
+	dosym ../../../etc/sysctl.conf /usr/lib/sysctl.d/99-sysctl.conf
+
+	if use pam; then
+		newpamd "${FILESDIR}"/systemd-user.pam systemd-user
+	fi
+
+	if use split-usr; then
+		# Avoid breaking boot/reboot
+		dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd
+		dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown
+	fi
+
+	gen_usr_ldscript -a systemd udev
+}
+
+migrate_locale() {
+	local envd_locale_def="${EROOT}/etc/env.d/02locale"
+	local envd_locale=( "${EROOT}"/etc/env.d/??locale )
+	local locale_conf="${EROOT}/etc/locale.conf"
+
+	if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
+		# If locale.conf does not exist...
+		if [[ -e ${envd_locale} ]]; then
+			# ...either copy env.d/??locale if there's one
+			ebegin "Moving ${envd_locale} to ${locale_conf}"
+			mv "${envd_locale}" "${locale_conf}"
+			eend ${?} || FAIL=1
+		else
+			# ...or create a dummy default
+			ebegin "Creating ${locale_conf}"
+			cat > "${locale_conf}" <<-EOF
+				# This file has been created by the sys-apps/systemd ebuild.
+				# See locale.conf(5) and localectl(1).
+
+				# LANG=${LANG}
+			EOF
+			eend ${?} || FAIL=1
+		fi
+	fi
+
+	if [[ ! -L ${envd_locale} ]]; then
+		# now, if env.d/??locale is not a symlink (to locale.conf)...
+		if [[ -e ${envd_locale} ]]; then
+			# ...warn the user that he has duplicate locale settings
+			ewarn
+			ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
+			ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
+			ewarn "and create the symlink with the following command:"
+			ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
+			ewarn
+		else
+			# ...or just create the symlink if there's nothing here
+			ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
+			ln -n -s ../locale.conf "${envd_locale_def}"
+			eend ${?} || FAIL=1
+		fi
+	fi
+}
+
+pkg_preinst() {
+	if ! use split-usr; then
+		local dir
+		for dir in bin sbin lib; do
+			if [[ ! ${EROOT}/${dir} -ef ${EROOT}/usr/${dir} ]]; then
+				eerror "\"${EROOT}/${dir}\" and \"${EROOT}/usr/${dir}\" are not merged."
+				eerror "One of them should be a symbolic link to the other one."
+				FAIL=1
+			fi
+		done
+		if [[ ${FAIL} ]]; then
+			eerror "Migration to system layout with merged directories must be performed before"
+			eerror "rebuilding ${CATEGORY}/${PN} with USE=\"-split-usr\" to avoid run-time breakage."
+			die "System layout with split directories still used"
+		fi
+	fi
+}
+
+pkg_postinst() {
+	systemd_update_catalog
+
+	# Keep this here in case the database format changes so it gets updated
+	# when required.
+	systemd-hwdb --root="${ROOT}" update
+
+	udev_reload || FAIL=1
+
+	# Bug 465468, make sure locales are respected, and ensure consistency
+	# between OpenRC & systemd
+	migrate_locale
+
+	if [[ -z ${REPLACING_VERSIONS} ]]; then
+		if type systemctl &>/dev/null; then
+			systemctl --root="${ROOT:-/}" enable getty@.service remote-fs.target || FAIL=1
+		fi
+		elog "To enable a useful set of services, run the following:"
+		elog "  systemctl preset-all --preset-mode=enable-only"
+	fi
+
+	if [[ -L ${EROOT}/var/lib/systemd/timesync ]]; then
+		rm "${EROOT}/var/lib/systemd/timesync"
+	fi
+
+	if [[ ${FAIL} ]]; then
+		eerror "One of the postinst commands failed. Please check the postinst output"
+		eerror "for errors. You may need to clean up your system and/or try installing"
+		eerror "systemd again."
+		eerror
+	fi
+}
+
+pkg_prerm() {
+	# If removing systemd completely, remove the catalog database.
+	if [[ ! ${REPLACED_BY_VERSION} ]]; then
+		rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
+	fi
+}
-- 
cgit v1.2.3