From 612f80cc07be4fd37647a1264fe6498a9edd24d3 Mon Sep 17 00:00:00 2001 From: Justin Wind Date: Wed, 6 Jan 2021 14:34:20 -0800 Subject: [PATCH] update old zfs for python --- sys-fs/zfs/Manifest | 1 + sys-fs/zfs/zfs-0.7.13-r100.ebuild | 218 ++++++++++++++++++++++++++++++ 2 files changed, 219 insertions(+) create mode 100644 sys-fs/zfs/zfs-0.7.13-r100.ebuild diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest index 14df7dd..01ffcc0 100644 --- a/sys-fs/zfs/Manifest +++ b/sys-fs/zfs/Manifest @@ -7,5 +7,6 @@ AUX zfs-init.sh.in 582 BLAKE2B 27e5c1aff398c42178b3d7c005e91a1f8f3afa303a22e49c9 AUX zfs.service.in 335 BLAKE2B a18ad1d70975df98cfb7b5196ad17b7197d5eb59cac2ccb3b9243f111c6c882c3480eb6396e347eac91670e3a67d7f122953d6fa82ec61a6467163b788b31858 SHA512 7a167b389723e5f55fea6956e5546e46c89ebf3e2d1c25f6b56c357e6d3ffc765226549d78cdeb79b4dc90c798ec6326a13996215b40eb49179376e32c3c3287 DIST zfs-0.7.13.tar.gz 6614047 BLAKE2B c59c46287715779eb04d69333b0a417fa9865eb0d61c642b043188c4c97d4eed369f76a48327326ed1d4dd608ff95d91d20d26c80ed0b120a8fcd5f83cea638f SHA512 457d8f110b68c9656194cd3738b216d5d807d680e5cfc6ed1f3cf5ebde67860476387c6b862ba3ba7f972d8945075963e6c325543ab84468e3eff5dbce68476e EBUILD zfs-0.7.13-r1.ebuild 6276 BLAKE2B b2aafe81b97e72249710bbed0282afe8e03aaf5029236d5b12d3089ef58458b9615f1f60f89b1473097321b8182704a5ba2964fb94b86f03a20d269029351264 SHA512 3547d9918e2b082299dbbaf39310ecaa780f44c2c7ece907b6149b3cff98ce68fc73846c303d579112453aaa6763bd029ccd24ab330c1578432a44da73a0d816 +EBUILD zfs-0.7.13-r100.ebuild 6276 BLAKE2B 199d5ed0971c76c1df238e43a3095f7a3cb9ec9a0228392b0b133b5fd1b688ff92009a10314070114c08d36dd25c5a01bcde5d56027c6a0e14b165260743681e SHA512 f70e08f6c445e87b5ae8808772eac8620aec4cd63fdc4cd9f3ee8f429c5f2dfdef140b2d6a9ae1c59665c032a2fc6d124ad6f722f6521335d3b5cf1dccb79718 EBUILD zfs-0.7.13-r2.ebuild 6340 BLAKE2B a351568c54fecd31574471e164f41e1909fe6096ac68211664ef6a90435c59c4189a5ed9a1356867a81941a17874c8580b6a27ec0caef49976afdda655bb8571 SHA512 4a17ca33411e286f19ae8d4c6eaee42cad9a2db024a83b6355f0f33db0fcbd83ca138f3e4b88a2b14cc3fded942edf4bd22f4588afc6082e608e02ced2d59b10 MISC metadata.xml 751 BLAKE2B 84331bb699e48773412c2b3a26786e746428a111b64d1a309d0acd6f2454220e917a6650b2a35e88269f77c725f848493f46516adf72a0deb149dbb1e0275bf3 SHA512 a16f2fff439157fa1910926bd5b90ccfc3cab262fe7b41e5565b645f29774b14f1d9ac11aceaee57b8685ec1c782d826e08715559fb0b2e06031a165ca5f6295 diff --git a/sys-fs/zfs/zfs-0.7.13-r100.ebuild b/sys-fs/zfs/zfs-0.7.13-r100.ebuild new file mode 100644 index 0000000..96bf44c --- /dev/null +++ b/sys-fs/zfs/zfs-0.7.13-r100.ebuild @@ -0,0 +1,218 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" +PYTHON_COMPAT=( python3_7 ) + +if [ ${PV} == "9999" ] ; then + inherit git-r3 linux-mod + AUTOTOOLS_AUTORECONF="1" + EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git" +else + SRC_URI="https://github.com/zfsonlinux/${PN}/releases/download/${P}/${P}.tar.gz" + KEYWORDS="amd64" +fi + +inherit autotools-utils bash-completion-r1 flag-o-matic linux-info python-single-r1 systemd toolchain-funcs udev usr-ldscript + +DESCRIPTION="Userland utilities for ZFS Linux kernel module" +HOMEPAGE="https://zfsonlinux.org/" + +LICENSE="BSD-2 CDDL MIT" +SLOT="0" +IUSE="custom-cflags debug kernel-builtin +rootfs systemd test-suite static-libs" +RESTRICT="test" + +COMMON_DEPEND=" + net-libs/libtirpc + sys-apps/util-linux[static-libs?] + sys-libs/zlib[static-libs(+)?] + virtual/awk +" +DEPEND="${COMMON_DEPEND} + virtual/pkgconfig +" + +RDEPEND="${COMMON_DEPEND} + ${PYTHON_DEPS} + !=sys-apps/grep-2.13* + !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* ) + !sys-fs/zfs-fuse + !prefix? ( virtual/udev ) + test-suite? ( + sys-apps/util-linux + sys-devel/bc + sys-block/parted + sys-fs/lsscsi + sys-fs/mdadm + sys-process/procps + virtual/modutils + ) + rootfs? ( + app-arch/cpio + app-misc/pax-utils + !" + eerror " Block devices --->" + eerror " [ ] Loopback device support" + fi + fi + fi + fi +} + +src_prepare() { + # Update paths + sed -e "s|/sbin/lsmod|/bin/lsmod|" \ + -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \ + -e "s|/sbin/parted|/usr/sbin/parted|" \ + -i scripts/common.sh.in || die + + autotools-utils_src_prepare +} + +src_configure() { + use custom-cflags || strip-flags + local myeconfargs=( + --bindir="${EPREFIX}/bin" + --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-systemdunitdir="$(systemd_get_systemunitdir)" + --with-systemdpresetdir="${EPREFIX}/lib/systemd/system-preset" + $(use_enable debug) + $(use_enable systemd) + ) + autotools-utils_src_configure + + # prepare systemd unit and helper script + cat "${FILESDIR}/zfs.service.in" | \ + sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \ + -e "s:@sysconfdir@:${EPREFIX}/etc:g" \ + > "${T}/zfs.service" || die + cat "${FILESDIR}/zfs-init.sh.in" | \ + sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \ + -e "s:@sysconfdir@:${EPREFIX}/etc:g" \ + > "${T}/zfs-init.sh" || die +} + +src_install() { + autotools-utils_src_install + gen_usr_ldscript -a uutil nvpair zpool zfs zfs_core + use test-suite || rm -rf "${ED}usr/share/zfs" + + newbashcomp "${FILESDIR}/bash-completion-r1" zfs + bashcomp_alias zfs zpool + + exeinto /usr/libexec + doexe "${T}/zfs-init.sh" + systemd_dounit "${T}/zfs.service" + + # enforce selected python implementation + python_fix_shebang "${ED}/bin" +} + +pkg_postinst() { + if ! use kernel-builtin && [ ${PV} = "9999" ] + then + einfo "Adding ${P} to the module database to ensure that the" + einfo "kernel modules and userland utilities stay in sync." + update_moduledb + fi + + if [ -e "${EROOT}etc/runlevels/boot/zfs" ] + then + einfo 'The zfs boot script has been split into the zfs-import,' + einfo 'zfs-mount and zfs-share scripts.' + einfo + einfo 'You had the zfs script in your boot runlevel. For your' + einfo 'convenience, it has been automatically removed and the three' + einfo 'scripts that replace it have been configured to start.' + einfo 'The zfs-import and zfs-mount scripts have been added to the boot' + einfo 'runlevel while the zfs-share script is in the default runlevel.' + + rm "${EROOT}etc/runlevels/boot/zfs" + ln -snf "${EROOT}etc/init.d/zfs-import" \ + "${EROOT}etc/runlevels/boot/zfs-import" + ln -snf "${EROOT}etc/init.d/zfs-mount" \ + "${EROOT}etc/runlevels/boot/zfs-mount" + ln -snf "${EROOT}etc/init.d/zfs-share" \ + "${EROOT}etc/runlevels/default/zfs-share" + else + [ -e "${EROOT}etc/runlevels/boot/zfs-import" ] || \ + einfo "You should add zfs-import 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." + fi + + if [ -e "${EROOT}etc/runlevels/default/zed" ] + then + einfo 'The downstream OpenRC zed script has replaced by the upstream' + einfo 'OpenRC zfs-zed script.' + einfo + einfo 'You had the zed script in your default runlevel. For your' + einfo 'convenience, it has been automatically removed and the zfs-zed' + einfo 'script that replaced it has been configured to start.' + + rm "${EROOT}etc/runlevels/boot/zed" + ln -snf "${EROOT}etc/init.d/zfs-sed" \ + "${EROOT}etc/runlevels/default/zfs-zed" + else + [ -e "${EROOT}etc/runlevels/default/zfs-zed" ] || \ + einfo "You should add zfs-zed to the default runlevel." + fi + + if [ -e "${EROOT}etc/runlevels/shutdown/zfs-shutdown" ] + then + einfo "The zfs-shutdown script is obsolete. Removing it from runlevel." + rm "${EROOT}etc/runlevels/shutdown/zfs-shutdown" + fi + + systemd_reenable zfs-zed.service + systemd_reenable zfs-import-cache.service + systemd_reenable zfs-import-scan.service + systemd_reenable zfs-mount.service + systemd_reenable zfs-share.service + systemd_reenable zfs-import.target + systemd_reenable zfs.target + systemd_reenable zfs.service +} + +pkg_postrm() { + if ! use kernel-builtin && [ ${PV} = "9999" ] + then + remove_moduledb + fi +} -- 2.45.2