From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1704382-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 1806D15812D
	for <garchives@archives.gentoo.org>; Mon, 30 Dec 2024 23:40:19 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 5E022E070D;
	Mon, 30 Dec 2024 23:40:18 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id DCBDDE070D
	for <gentoo-commits@lists.gentoo.org>; Mon, 30 Dec 2024 23:40:17 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id E1C8833BF08
	for <gentoo-commits@lists.gentoo.org>; Mon, 30 Dec 2024 23:40:16 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 4D0DB1732
	for <gentoo-commits@lists.gentoo.org>; Mon, 30 Dec 2024 23:40:15 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1735601992.b8fd4b35cb06f23abef59c607a136e40e58e5a33.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-fs/zfs/Manifest sys-fs/zfs/zfs-2.3.0_rc4.ebuild
X-VCS-Directories: sys-fs/zfs/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: b8fd4b35cb06f23abef59c607a136e40e58e5a33
X-VCS-Branch: master
Date: Mon, 30 Dec 2024 23:40:15 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: ac1ddcef-21b7-4ea2-89d5-dce83a192e74
X-Archives-Hash: 01174c633ba4b51916d21ddf19d9d7bc

commit:     b8fd4b35cb06f23abef59c607a136e40e58e5a33
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 30 23:39:52 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Dec 30 23:39:52 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b8fd4b35

sys-fs/zfs: add 2.3.0_rc4

Closes: https://bugs.gentoo.org/947252
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-fs/zfs/Manifest             |   2 +
 sys-fs/zfs/zfs-2.3.0_rc4.ebuild | 308 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 310 insertions(+)

diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
index 2f6207229ee7..3623d48abe5d 100644
--- a/sys-fs/zfs/Manifest
+++ b/sys-fs/zfs/Manifest
@@ -12,3 +12,5 @@ DIST zfs-2.3.0-rc1.tar.gz 33887119 BLAKE2B dd4e159bef6de216cc51c1dd22620e6edb5b7
 DIST zfs-2.3.0-rc1.tar.gz.asc 195 BLAKE2B f70e6223e94a3f79d6d685b2b06254fba845d79768c82b7a3fedb865b6e6c97499c497def0f4c3e4a2869fed88b0965650ae88d5eb72c0ffaed43c4479d3bf96 SHA512 26b395feaf03e2be20b75ef64e573aa98a0706c46a1eb57503925731bf0cb9bf7fef8a2cdcf163233bccd7da9f5aedc0cae73f0183f39e0f13dcf315b4a5d809
 DIST zfs-2.3.0-rc3.tar.gz 33897910 BLAKE2B 518e2c56130a71d4c35f27328184e882815e2ca5b0524e660e174176bee4fdc554e4d1c8264d71f84b6c9641c08088f96a5c35adb5ef6f21b814ccadf093a256 SHA512 1ac53d3a006580f4a32fa33dddd6600d8abac401ed9fc86a2950a8241e0a9dc4a8954a32c44b28b10f22ba7c5cbd8871d9f21c13ccc291c366e9745e83431723
 DIST zfs-2.3.0-rc3.tar.gz.asc 195 BLAKE2B 34685869cb8d4f911b3ce0a5098411ce4cb346310564b7ad5fbe9cfc50a3bbe7665c8daa36384b2d5f3ee1dad4b98d6d5bad5a6b8e2f45da35354428853f748d SHA512 1f32119b24c703dd5dbdcce63ddc97cd24f2052522cf1f2f9a4228691d0db7c136262d98b38f2d795a4edfce1d25b423c5bc4f65dbc008bd12f64acc24f3406e
+DIST zfs-2.3.0-rc4.tar.gz 33899889 BLAKE2B 97aabe9c020ab496e6fe621ecb34fd33b70b786664aee0ebdc1d9d8b0d8027bb092354451c882bf0a2954967414420b33b081a7302a4805dcf2e04a584b81463 SHA512 77bb0b8f9d8995edfc7ebb298c6b0a0834e89cd58410d8d4bc4e7f04ce04e26d486e9d0ce23dd22e74cff8e9a9e827ca9d3549885045265f8b17638e68f35f0f
+DIST zfs-2.3.0-rc4.tar.gz.asc 195 BLAKE2B 8c1b104c7cf88bc0415d13e4b4d7f21ec5d35722b09e977aa240d842cad36f51d1ae84fbb03d51e3408b7c1a427d56658b90e53109d1e3c6921ae772c256f122 SHA512 a0e74bbcc1062c7196e6e67c77175456ae995159b22c788c5f4c3026dfde662cfb396677b3aa46628576504bc38f374a191dec4ccd55c2b41685be408067b9ee

diff --git a/sys-fs/zfs/zfs-2.3.0_rc4.ebuild b/sys-fs/zfs/zfs-2.3.0_rc4.ebuild
new file mode 100644
index 000000000000..53bc008f5132
--- /dev/null
+++ b/sys-fs/zfs/zfs-2.3.0_rc4.ebuild
@@ -0,0 +1,308 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_OPTIONAL=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript
+
+DESCRIPTION="Userland utilities for ZFS Linux kernel module"
+HOMEPAGE="https://github.com/openzfs/zfs"
+
+if [[ ${PV} == "9999" ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/openzfs/zfs.git"
+else
+	VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/openzfs.asc
+	inherit verify-sig
+
+	MY_P="${P/_rc/-rc}"
+	SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz"
+	SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )"
+	S="${WORKDIR}/${MY_P}"
+
+	if [[ ${PV} != *_rc* ]]; then
+		KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~sparc"
+	fi
+fi
+
+LICENSE="BSD-2 CDDL MIT"
+# just libzfs soname major for now.
+# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered.
+# see libsoversion_check() below as well
+SLOT="0/6"
+IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite unwind"
+
+DEPEND="
+	dev-libs/openssl:=
+	net-libs/libtirpc:=
+	sys-apps/util-linux
+	sys-libs/zlib
+	virtual/libudev:=
+	!minimal? ( ${PYTHON_DEPS} )
+	pam? ( sys-libs/pam )
+	python? (
+		$(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*')
+	)
+	unwind? ( sys-libs/libunwind:= )
+"
+
+BDEPEND="
+	app-alternatives/awk
+	virtual/pkgconfig
+	nls? ( sys-devel/gettext )
+	python? (
+		${DISTUTILS_DEPS}
+		|| (
+			dev-python/packaging[${PYTHON_USEDEP}]
+			dev-python/distlib[${PYTHON_USEDEP}]
+		)
+	)
+"
+
+if [[ ${PV} != "9999" ]] ; then
+	BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )"
+fi
+
+# awk is used for some scripts, completions, and the Dracut module
+RDEPEND="
+	${DEPEND}
+	!kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= )
+	!prefix? ( virtual/udev )
+	app-alternatives/awk
+	sys-fs/udev-init-scripts
+	dist-kernel? ( virtual/dist-kernel:= )
+	rootfs? (
+		app-alternatives/cpio
+		app-misc/pax-utils
+	)
+	selinux? ( sec-policy/selinux-zfs )
+	test-suite? (
+		app-shells/ksh
+		sys-apps/kmod[tools]
+		sys-apps/util-linux
+		app-alternatives/bc
+		sys-block/parted
+		sys-fs/lsscsi
+		sys-fs/mdadm
+		sys-process/procps
+	)
+"
+
+# PDEPEND in this form is needed to trick portage suggest
+# enabling dist-kernel if only 1 package have it set, without suggesting to disable
+PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )"
+
+REQUIRED_USE="
+	!minimal? ( ${PYTHON_REQUIRED_USE} )
+	python? ( !minimal )
+	test-suite? ( !minimal )
+"
+
+RESTRICT="test"
+
+PATCHES=(
+	"${FILESDIR}"/2.1.5-dracut-zfs-missing.patch
+)
+
+pkg_pretend() {
+	use rootfs || return 0
+
+	if has_version virtual/dist-kernel && ! use dist-kernel; then
+		ewarn "You have virtual/dist-kernel installed, but"
+		ewarn "USE=\"dist-kernel\" is not enabled for ${CATEGORY}/${PN}"
+		ewarn "It's recommended to globally enable dist-kernel USE flag"
+		ewarn "to auto-trigger initrd rebuilds with kernel updates"
+	fi
+}
+
+pkg_setup() {
+	if use kernel_linux; then
+		linux-info_pkg_setup
+
+		if ! linux_config_exists; then
+			ewarn "Cannot check the linux kernel configuration."
+		else
+			if use test-suite; then
+				if linux_chkconfig_present BLK_DEV_LOOP; then
+					eerror "The ZFS test suite requires loop device support enabled."
+					eerror "Please enable it:"
+					eerror "    CONFIG_BLK_DEV_LOOP=y"
+					eerror "in /usr/src/linux/.config or"
+					eerror "    Device Drivers --->"
+					eerror "        Block devices --->"
+					eerror "            [X] Loopback device support"
+				fi
+			fi
+		fi
+	fi
+}
+
+libsoversion_check() {
+	local bugurl libzfs_sover
+	bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages"
+
+	libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \
+		| grep -Eo '[0-9]+:[0-9]+:[0-9]+')"
+	libzfs_sover="${libzfs_sover%%:*}"
+
+	if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then
+		echo
+		eerror "BUG BUG BUG BUG BUG BUG BUG BUG"
+		eerror "ebuild subslot does not match libzfs soversion!"
+		eerror "libzfs soversion: ${libzfs_sover}"
+		eerror "ebuild value: $(ver_cut 2 ${SLOT})"
+		eerror "This is a bug in the ebuild, please use the following URL to report it"
+		eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot"
+		echo
+		# we want to abort for releases, but just print a warning for live ebuild
+		# to keep package installable
+		[[  ${PV} == "9999" ]] || die
+	fi
+}
+
+src_prepare() {
+	default
+	libsoversion_check
+
+	# Run unconditionally (bug #792627)
+	eautoreconf
+
+	if [[ ${PV} != "9999" ]]; then
+		# Set revision number
+		sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release"
+	fi
+
+	if use python; then
+		pushd contrib/pyzfs >/dev/null || die
+		distutils-r1_src_prepare
+		popd >/dev/null || die
+	fi
+
+	# Tries to use /etc/conf.d which we reserve for OpenRC
+	sed -i -e '/EnvironmentFile/d' etc/systemd/system/zfs*.in || die
+
+	# prevent errors showing up on zfs-mount stop, #647688
+	# openrc will unmount all filesystems anyway.
+	sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die
+}
+
+src_configure() {
+	use custom-cflags || strip-flags
+	use minimal || python_setup
+
+	local myconf=(
+		--bindir="${EPREFIX}/bin"
+		--enable-shared
+		--enable-sysvinit
+		--localstatedir="${EPREFIX}/var"
+		--sbindir="${EPREFIX}/sbin"
+		--with-config=user
+		--with-dracutdir="${EPREFIX}/usr/lib/dracut"
+		--with-linux="${KV_DIR}"
+		--with-linux-obj="${KV_OUT_DIR}"
+		--with-udevdir="$(get_udevdir)"
+		--with-pamconfigsdir="${EPREFIX}/unwanted_files"
+		--with-pammoduledir="$(getpam_mod_dir)"
+		--with-systemdunitdir="$(systemd_get_systemunitdir)"
+		--with-systemdpresetdir="$(systemd_get_systempresetdir)"
+		--with-vendor=gentoo
+		# Building zfs-mount-generator.c on musl breaks as strndupa
+		# isn't available. But systemd doesn't support musl anyway, so
+		# just disable building it.
+		# UPDATE: it has been fixed since,
+		# https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a
+		# but we still leave it as this for now.
+		$(use_enable !elibc_musl systemd)
+		$(use_enable debug)
+		$(use_enable nls)
+		$(use_enable pam)
+		$(use_enable python pyzfs)
+		$(use_with unwind libunwind)
+		--disable-static
+		$(usex minimal --without-python --with-python="${EPYTHON}")
+	)
+
+	econf "${myconf[@]}"
+}
+
+src_compile() {
+	default
+	if use python; then
+		pushd contrib/pyzfs >/dev/null || die
+		distutils-r1_src_compile
+		popd >/dev/null || die
+	fi
+}
+
+src_install() {
+	default
+
+	gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool
+
+	use pam && { rm -rv "${ED}/unwanted_files" || die ; }
+
+	use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; }
+
+	find "${ED}" -name '*.la' -delete || die
+
+	dobashcomp contrib/bash_completion.d/zfs
+	bashcomp_alias zfs zpool
+
+	# strip executable bit from conf.d file
+	fperms 0644 /etc/conf.d/zfs
+
+	if use python; then
+		pushd contrib/pyzfs >/dev/null || die
+		distutils-r1_src_install
+		popd >/dev/null || die
+	fi
+
+	# enforce best available python implementation
+	use minimal || python_fix_shebang "${ED}/bin"
+}
+
+pkg_postinst() {
+	udev_reload
+
+	# we always need userspace utils in sync with zfs-kmod
+	# so force initrd update for userspace as well, to avoid
+	# situation when zfs-kmod trigger initrd rebuild before
+	# userspace component is rebuilt
+	# KV_* variables are provided by linux-info.eclass
+	if [[ -z ${ROOT} ]] && use dist-kernel; then
+		dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}"
+	fi
+
+	if use rootfs; then
+		if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then
+			elog "Root on zfs requires an initramfs to boot"
+			elog "The following packages provide one and are tested on a regular basis:"
+			elog "  sys-kernel/dracut ( preferred, module maintained by zfs developers )"
+			elog "  sys-kernel/genkernel"
+		fi
+	fi
+
+	if systemd_is_booted || has_version sys-apps/systemd; then
+		einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset"
+		einfo "for default zfs systemd service configuration"
+	else
+		[[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \
+			einfo "You should add zfs-import to the boot runlevel."
+		[[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \
+			einfo "You should add zfs-load-key to the boot runlevel."
+		[[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \
+			einfo "You should add zfs-mount to the boot runlevel."
+		[[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \
+			einfo "You should add zfs-share to the default runlevel."
+		[[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \
+			einfo "You should add zfs-zed to the default runlevel."
+	fi
+}
+
+pkg_postrm() {
+	udev_reload
+}