Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/
Date: Thu, 27 Aug 2020 08:24:11
Message-Id: 1598515706.cb9038f5a96b76706f4ff4eda26b33871232ecb3.gyakovlev@gentoo
1 commit: cb9038f5a96b76706f4ff4eda26b33871232ecb3
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 27 07:57:04 2020 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 27 08:08:26 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb9038f5
7
8 sys-fs/zfs: revbump 2.0.0_rc1, add new useflags
9
10 Bug: https://bugs.gentoo.org/701522
11 Package-Manager: Portage-3.0.4, Repoman-3.0.1
12 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
13
14 sys-fs/zfs/zfs-2.0.0_rc1-r1.ebuild | 223 +++++++++++++++++++++++++++++++++++++
15 1 file changed, 223 insertions(+)
16
17 diff --git a/sys-fs/zfs/zfs-2.0.0_rc1-r1.ebuild b/sys-fs/zfs/zfs-2.0.0_rc1-r1.ebuild
18 new file mode 100644
19 index 00000000000..55317293ed4
20 --- /dev/null
21 +++ b/sys-fs/zfs/zfs-2.0.0_rc1-r1.ebuild
22 @@ -0,0 +1,223 @@
23 +# Copyright 1999-2020 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +DISTUTILS_OPTIONAL=1
29 +PYTHON_COMPAT=( python3_{6,7} )
30 +
31 +inherit autotools bash-completion-r1 distutils-r1 flag-o-matic linux-info pam systemd toolchain-funcs udev usr-ldscript
32 +
33 +DESCRIPTION="Userland utilities for ZFS Linux kernel module"
34 +HOMEPAGE="https://github.com/openzfs/zfs"
35 +
36 +if [[ ${PV} == "9999" ]] ; then
37 + inherit git-r3 linux-mod
38 + EGIT_REPO_URI="https://github.com/openzfs/zfs.git"
39 +else
40 + MY_P="${P/_rc/-rc}"
41 + SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz"
42 + KEYWORDS="~amd64 ~arm64 ~ppc64"
43 + S="${WORKDIR}/${P%_rc?}"
44 +fi
45 +
46 +LICENSE="BSD-2 CDDL MIT"
47 +SLOT="0"
48 +IUSE="custom-cflags debug kernel-builtin libressl minimal nls pam python +rootfs test-suite static-libs"
49 +
50 +DEPEND="
51 + net-libs/libtirpc[static-libs?]
52 + sys-apps/util-linux[static-libs?]
53 + sys-libs/zlib[static-libs(+)?]
54 + virtual/awk
55 + virtual/libudev[static-libs(-)?]
56 + libressl? ( dev-libs/libressl:0=[static-libs?] )
57 + !libressl? ( dev-libs/openssl:0=[static-libs?] )
58 + !minimal? ( ${PYTHON_DEPS} )
59 + pam? ( sys-libs/pam )
60 + python? (
61 + virtual/python-cffi[${PYTHON_USEDEP}]
62 + )
63 +"
64 +
65 +BDEPEND="virtual/awk
66 + virtual/pkgconfig
67 + nls? ( sys-devel/gettext )
68 + python? (
69 + dev-python/setuptools[${PYTHON_USEDEP}]
70 + )
71 +"
72 +
73 +RDEPEND="${DEPEND}
74 + !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV} )
75 + !prefix? ( virtual/udev )
76 + sys-fs/udev-init-scripts
77 + rootfs? (
78 + app-arch/cpio
79 + app-misc/pax-utils
80 + !<sys-kernel/genkernel-3.5.1.1
81 + )
82 + test-suite? (
83 + sys-apps/kmod[tools]
84 + sys-apps/util-linux
85 + sys-devel/bc
86 + sys-block/parted
87 + sys-fs/lsscsi
88 + sys-fs/mdadm
89 + sys-process/procps
90 + )
91 +"
92 +
93 +REQUIRED_USE="
94 + !minimal? ( ${PYTHON_REQUIRED_USE} )
95 + python? ( !minimal )
96 + test-suite? ( !minimal )
97 +"
98 +
99 +RESTRICT="test"
100 +
101 +PATCHES=( "${FILESDIR}/bash-completion-sudo.patch" )
102 +
103 +pkg_setup() {
104 + if use kernel_linux && use test-suite; then
105 + linux-info_pkg_setup
106 +
107 + if ! linux_config_exists; then
108 + ewarn "Cannot check the linux kernel configuration."
109 + else
110 + if use test-suite; then
111 + if linux_chkconfig_present BLK_DEV_LOOP; then
112 + eerror "The ZFS test suite requires loop device support enabled."
113 + eerror "Please enable it:"
114 + eerror " CONFIG_BLK_DEV_LOOP=y"
115 + eerror "in /usr/src/linux/.config or"
116 + eerror " Device Drivers --->"
117 + eerror " Block devices --->"
118 + eerror " [X] Loopback device support"
119 + fi
120 + fi
121 + fi
122 + fi
123 +}
124 +
125 +src_prepare() {
126 + default
127 +
128 + if [[ ${PV} == "9999" ]]; then
129 + eautoreconf
130 + else
131 + # Set revision number
132 + sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release"
133 + fi
134 +
135 + if use python; then
136 + pushd contrib/pyzfs >/dev/null || die
137 + distutils-r1_src_prepare
138 + popd >/dev/null || die
139 + fi
140 +
141 + # prevent errors showing up on zfs-mount stop, #647688
142 + # openrc will unmount all filesystems anyway.
143 + sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die
144 +}
145 +
146 +src_configure() {
147 + use custom-cflags || strip-flags
148 + use minimal || python_setup
149 +
150 + local myconf=(
151 + --bindir="${EPREFIX}/bin"
152 + --enable-shared
153 + --enable-systemd
154 + --enable-sysvinit
155 + --localstatedir="${EPREFIX}/var"
156 + --sbindir="${EPREFIX}/sbin"
157 + --with-config=user
158 + --with-dracutdir="${EPREFIX}/usr/lib/dracut"
159 + --with-linux="${KV_DIR}"
160 + --with-linux-obj="${KV_OUT_DIR}"
161 + --with-udevdir="$(get_udevdir)"
162 + --with-pamconfigsdir="${EPREFIX}/unwanted_files"
163 + --with-pammoduledir="$(getpam_mod_dir)"
164 + --with-systemdunitdir="$(systemd_get_systemunitdir)"
165 + --with-systemdpresetdir="${EPREFIX}/lib/systemd/system-preset"
166 + $(use_enable debug)
167 + $(use_enable nls)
168 + $(use_enable pam)
169 + $(use_enable python pyzfs)
170 + $(use_enable static-libs static)
171 + $(usex minimal --without-python --with-python="${EPYTHON}")
172 + )
173 +
174 + econf "${myconf[@]}"
175 +}
176 +
177 +src_compile() {
178 + default
179 + if use python; then
180 + pushd contrib/pyzfs >/dev/null || die
181 + distutils-r1_src_compile
182 + popd >/dev/null || die
183 + fi
184 +}
185 +
186 +src_install() {
187 + default
188 +
189 + gen_usr_ldscript -a uutil nvpair zpool zfs zfs_core
190 +
191 + use pam && { rm -rv "${ED}/unwanted_files" || die ; }
192 +
193 + use test-suite || { rm -r "${ED}/usr/share/zfs" || die ; }
194 +
195 + if ! use static-libs; then
196 + find "${ED}/" -name '*.la' -delete || die
197 + fi
198 +
199 + dobashcomp contrib/bash_completion.d/zfs
200 + bashcomp_alias zfs zpool
201 +
202 + # strip executable bit from conf.d file
203 + fperms 0644 /etc/conf.d/zfs
204 +
205 + if use python; then
206 + pushd contrib/pyzfs >/dev/null || die
207 + distutils-r1_src_install
208 + popd >/dev/null || die
209 + fi
210 +
211 + # enforce best available python implementation
212 + use minimal || python_fix_shebang "${ED}/bin"
213 +}
214 +
215 +pkg_postinst() {
216 + if use rootfs; then
217 + if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then
218 + elog "root on zfs requires initramfs to boot"
219 + elog "the following packages known to provide one and tested on regular basis:"
220 + elog " sys-kernel/dracut"
221 + elog " sys-kernel/genkernel"
222 + fi
223 + fi
224 +
225 + if ! use kernel-builtin && [[ ${PV} = "9999" ]]; then
226 + einfo "Adding ${P} to the module database to ensure that the"
227 + einfo "kernel modules and userland utilities stay in sync."
228 + update_moduledb
229 + fi
230 +
231 + [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \
232 + einfo "You should add zfs-import to the boot runlevel."
233 + [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \
234 + einfo "You should add zfs-mount to the boot runlevel."
235 + [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \
236 + einfo "You should add zfs-share to the default runlevel."
237 + [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \
238 + einfo "You should add zfs-zed to the default runlevel."
239 +}
240 +
241 +pkg_postrm() {
242 + if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then
243 + remove_moduledb
244 + fi
245 +}