Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/
Date: Wed, 22 Sep 2021 01:19:28
Message-Id: 1632273554.5f6a04ba0322d9d03e367e7a7a46581c01f97d60.sam@gentoo
1 commit: 5f6a04ba0322d9d03e367e7a7a46581c01f97d60
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 22 00:49:37 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 22 01:19:14 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5f6a04ba
7
8 sys-fs/zfs: add 2.0.6
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 sys-fs/zfs/Manifest | 2 +
13 sys-fs/zfs/zfs-2.0.6.ebuild | 292 ++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 294 insertions(+)
15
16 diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
17 index 26db11b413c..0cad7488b20 100644
18 --- a/sys-fs/zfs/Manifest
19 +++ b/sys-fs/zfs/Manifest
20 @@ -1,6 +1,8 @@
21 DIST zfs-0.8.6.tar.gz 9295260 BLAKE2B 45424d710aaf75a05f766ae523ae157a24b5cbdcefe72a59e4cede81e42f7a92ae7f01150388437b78cd49f3d28b9664599f2a624516e6b3f1073497194a99f2 SHA512 626b172554f39a5c70f6ea5c599a92fae52534590d1b0273de2bbfc3676d29dff0eade8ca17e5f179a59870c12bc758fb53b7900f8a1fdbdef3a9161b93f9cce
22 DIST zfs-2.0.5.tar.gz 13166149 BLAKE2B 4505c43a3b9a6c2b925383d00bbd9f17505290ded83f9bd3f08211769fa39254742340bdda65efd53f87f1708138517f91f8a43c01f3ce4191de200c84c77754 SHA512 ee1b3f0347442ee649a7ee8a2bb08208e011eea994076d30dd08dcd51dab29df0ff369b0c6e709346fa7de69cb07e0ffdceb34f01edb93d414578d1ffc6051ba
23 DIST zfs-2.0.5.tar.gz.asc 836 BLAKE2B 6bc53160ce650f63c717b67116fb754c7a8196c9aa99bb6e43f0145bb30a0446a1ba5695b8207b085435da289fa0058643201ef2f8827e12b0803ab20b0df305 SHA512 91e73a8da45e4f49113fc1af684143902a23c9cf5e59f8cd2f3a1214aeff57af63a7fa05dbe3fa0465f002521b89a43d6086d765d03209d83a41761d56b358aa
24 +DIST zfs-2.0.6.tar.gz 13192941 BLAKE2B 3a83303b016ec4259c286af8a9ceb281829d26508d411df91dd94193bca8c3155ef0ba63604e95f6add5f0c6cf6d100b0f567efc33b6c484c9ff811924da6ccd SHA512 52a5576eed21868b2a3d63d05d3d8c35b5e59ee88c7ddab1dc070644539f9acd56bde43ba5e965ad951a6d50a014fb429a7977d2ab1a2bfcadd92ea78dd57bf8
25 +DIST zfs-2.0.6.tar.gz.asc 836 BLAKE2B 065eba3361ef4234acc67df0236ab9a6737ba9fe5a706be98b55dd64d10360160ca787d8873f27451a2107225ae657dc4cab20a7c2a268cd2de64c8d82d0327a SHA512 123569ecfcee22ac462160acf61b120144c774bc5c0d46a50d2b7312f7565da1a9d780e1a6207dba5834917c66d5b852763e4a3162378d5c9bb90b0dfde35c5c
26 DIST zfs-2.1.0.tar.gz 34810470 BLAKE2B f7cc1cde711c255bacb000207b8e9a594105d18601a503d75a2a3055ed29ca941e148492fe52809f81a250848cfb5868b3d1c42860464a3d7d744a416db08929 SHA512 2121b90a1d4d92353801c48a2e34e2dd42bd295dacc3c30aa77cde967a1326e17c983bdd6905552421df0a652c09e84b3d4d2ba01001e053b8afb12e189c046f
27 DIST zfs-2.1.0.tar.gz.asc 195 BLAKE2B d5a7c01c7fd1798a235d5bc9ba89353a85978ac8bb1eaec1c587b8cc6d7cd24b0d7613c465a8da7ba29a172e4ebd6e465f893145d9dd7adf11d7e3858fea835a SHA512 1c5c8d20adbcc27c5e5d760a84e258a897dee7c3950ef1eb56f3ef6bd1c85516c7776ce30b3e63229cd65315d43e06b5e04c587e9483b96b00adb42d24749c1a
28 DIST zfs-2.1.1.tar.gz 34836374 BLAKE2B 09ee6bd30e8266342bd975454086049c3fd9142e7dacfe52166575c20e3c92688f9b457d75b2a2068fc281e65f78e1d47450545504cdf8bc31e23663545d7800 SHA512 b69ce764a9f7438ec2c90f86be02abfd684c67cd38de876374e3e6f4b2f82a75d86fa70205def2ba454ad27e52ec8d955ebc4ba456e91d397129a54ea849c19c
29
30 diff --git a/sys-fs/zfs/zfs-2.0.6.ebuild b/sys-fs/zfs/zfs-2.0.6.ebuild
31 new file mode 100644
32 index 00000000000..4b474020cd7
33 --- /dev/null
34 +++ b/sys-fs/zfs/zfs-2.0.6.ebuild
35 @@ -0,0 +1,292 @@
36 +# Copyright 1999-2021 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=7
40 +
41 +DISTUTILS_OPTIONAL=1
42 +DISTUTILS_USE_SETUPTOOLS=manual
43 +PYTHON_COMPAT=( python3_{7,8,9} )
44 +
45 +inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript
46 +
47 +DESCRIPTION="Userland utilities for ZFS Linux kernel module"
48 +HOMEPAGE="https://github.com/openzfs/zfs"
49 +
50 +if [[ ${PV} == "9999" ]]; then
51 + inherit git-r3 linux-mod
52 + EGIT_REPO_URI="https://github.com/openzfs/zfs.git"
53 +else
54 + VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/openzfs.asc
55 + inherit verify-sig
56 +
57 + MY_P="${P/_rc/-rc}"
58 + SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz"
59 + SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )"
60 + S="${WORKDIR}/${P%_rc?}"
61 +
62 + if [[ ${PV} != *_rc* ]]; then
63 + KEYWORDS="~amd64 ~arm64 ~ppc64"
64 + fi
65 +fi
66 +
67 +LICENSE="BSD-2 CDDL MIT"
68 +# just libzfs soname major for now.
69 +# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered.
70 +# see libsoversion_check() below as well
71 +SLOT="0/4"
72 +IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite"
73 +
74 +DEPEND="
75 + net-libs/libtirpc
76 + sys-apps/util-linux
77 + sys-libs/zlib
78 + virtual/libudev:=
79 + dev-libs/openssl:0=
80 + !minimal? ( ${PYTHON_DEPS} )
81 + pam? ( sys-libs/pam )
82 + python? (
83 + virtual/python-cffi[${PYTHON_USEDEP}]
84 + )
85 +"
86 +
87 +BDEPEND="virtual/awk
88 + virtual/pkgconfig
89 + nls? ( sys-devel/gettext )
90 + python? (
91 + dev-python/setuptools[${PYTHON_USEDEP}]
92 + )
93 +"
94 +
95 +if [[ ${PV} != "9999" ]] ; then
96 + BDEPEND+=" verify-sig? ( app-crypt/openpgp-keys-openzfs )"
97 +fi
98 +
99 +# awk is used for some scripts, completions, and the Dracut module
100 +RDEPEND="${DEPEND}
101 + !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:=[dist-kernel?] )
102 + !prefix? ( virtual/udev )
103 + sys-fs/udev-init-scripts
104 + virtual/awk
105 + dist-kernel? ( virtual/dist-kernel:= )
106 + rootfs? (
107 + app-arch/cpio
108 + app-misc/pax-utils
109 + !<sys-kernel/genkernel-3.5.1.1
110 + )
111 + test-suite? (
112 + sys-apps/kmod[tools]
113 + sys-apps/util-linux
114 + sys-devel/bc
115 + sys-block/parted
116 + sys-fs/lsscsi
117 + sys-fs/mdadm
118 + sys-process/procps
119 + )
120 +"
121 +
122 +REQUIRED_USE="
123 + !minimal? ( ${PYTHON_REQUIRED_USE} )
124 + python? ( !minimal )
125 + test-suite? ( !minimal )
126 +"
127 +
128 +RESTRICT="test"
129 +
130 +PATCHES=(
131 + "${FILESDIR}/bash-completion-sudo.patch"
132 + "${FILESDIR}/2.0.4-scrub-timers.patch"
133 +)
134 +
135 +pkg_pretend() {
136 + use rootfs || return 0
137 +
138 + if has_version virtual/dist-kernel && ! use dist-kernel; then
139 + ewarn "You have virtual/dist-kernel installed, but"
140 + ewarn "USE=\"dist-kernel\" is not enabled for ${CATEGORY}/${PN}"
141 + ewarn "It's recommended to globally enable dist-kernel USE flag"
142 + ewarn "to auto-trigger initrd rebuilds with kernel updates"
143 + fi
144 +}
145 +
146 +pkg_setup() {
147 + if use kernel_linux; then
148 + linux-info_pkg_setup
149 +
150 + if ! linux_config_exists; then
151 + ewarn "Cannot check the linux kernel configuration."
152 + else
153 + if use test-suite; then
154 + if linux_chkconfig_present BLK_DEV_LOOP; then
155 + eerror "The ZFS test suite requires loop device support enabled."
156 + eerror "Please enable it:"
157 + eerror " CONFIG_BLK_DEV_LOOP=y"
158 + eerror "in /usr/src/linux/.config or"
159 + eerror " Device Drivers --->"
160 + eerror " Block devices --->"
161 + eerror " [X] Loopback device support"
162 + fi
163 + fi
164 + fi
165 + fi
166 +}
167 +
168 +libsoversion_check() {
169 +
170 + local bugurl libzfs_sover
171 + bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages"
172 +
173 + libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \
174 + | grep -Eo '[0-9]+:[0-9]+:[0-9]+')"
175 + libzfs_sover="${libzfs_sover%%:*}"
176 +
177 + if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then
178 + echo
179 + eerror "BUG BUG BUG BUG BUG BUG BUG BUG"
180 + eerror "ebuild subslot does not match libzfs soversion!"
181 + eerror "libzfs soversion: ${libzfs_sover}"
182 + eerror "ebuild value: $(ver_cut 2 ${SLOT})"
183 + eerror "This is a bug in the ebuild, please use the following URL to report it"
184 + eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot"
185 + echo
186 + # we want to abort for releases, but just print a warning for live ebuild
187 + # to keep package installable
188 + [[ ${PV} == "9999" ]] || die
189 + fi
190 +}
191 +
192 +src_prepare() {
193 + default
194 + libsoversion_check
195 +
196 + # Run unconditionally (bug #792627)
197 + eautoreconf
198 +
199 + if [[ ${PV} != "9999" ]]; then
200 + # Set revision number
201 + sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release"
202 + fi
203 +
204 + if use python; then
205 + pushd contrib/pyzfs >/dev/null || die
206 + distutils-r1_src_prepare
207 + popd >/dev/null || die
208 + fi
209 +
210 + # prevent errors showing up on zfs-mount stop, #647688
211 + # openrc will unmount all filesystems anyway.
212 + sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die
213 +}
214 +
215 +src_configure() {
216 + use custom-cflags || strip-flags
217 + use minimal || python_setup
218 +
219 + local myconf=(
220 + --bindir="${EPREFIX}/bin"
221 + --enable-shared
222 + --enable-systemd
223 + --enable-sysvinit
224 + --localstatedir="${EPREFIX}/var"
225 + --sbindir="${EPREFIX}/sbin"
226 + --with-config=user
227 + --with-dracutdir="${EPREFIX}/usr/lib/dracut"
228 + --with-linux="${KV_DIR}"
229 + --with-linux-obj="${KV_OUT_DIR}"
230 + --with-udevdir="$(get_udevdir)"
231 + --with-pamconfigsdir="${EPREFIX}/unwanted_files"
232 + --with-pammoduledir="$(getpam_mod_dir)"
233 + --with-systemdunitdir="$(systemd_get_systemunitdir)"
234 + --with-systemdpresetdir="${EPREFIX}/lib/systemd/system-preset"
235 + --with-vendor=gentoo
236 + $(use_enable debug)
237 + $(use_enable nls)
238 + $(use_enable pam)
239 + $(use_enable python pyzfs)
240 + --disable-static
241 + $(usex minimal --without-python --with-python="${EPYTHON}")
242 + )
243 +
244 + econf "${myconf[@]}"
245 +}
246 +
247 +src_compile() {
248 + default
249 + if use python; then
250 + pushd contrib/pyzfs >/dev/null || die
251 + distutils-r1_src_compile
252 + popd >/dev/null || die
253 + fi
254 +}
255 +
256 +src_install() {
257 + default
258 +
259 + gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool
260 +
261 + use pam && { rm -rv "${ED}/unwanted_files" || die ; }
262 +
263 + use test-suite || { rm -r "${ED}/usr/share/zfs" || die ; }
264 +
265 + find "${ED}" -name '*.la' -delete || die
266 +
267 + dobashcomp contrib/bash_completion.d/zfs
268 + bashcomp_alias zfs zpool
269 +
270 + # strip executable bit from conf.d file
271 + fperms 0644 /etc/conf.d/zfs
272 +
273 + if use python; then
274 + pushd contrib/pyzfs >/dev/null || die
275 + distutils-r1_src_install
276 + popd >/dev/null || die
277 + fi
278 +
279 + # enforce best available python implementation
280 + use minimal || python_fix_shebang "${ED}/bin"
281 +}
282 +
283 +pkg_postinst() {
284 + # we always need userspace utils in sync with zfs-kmod
285 + # so force initrd update for userspace as well, to avoid
286 + # situation when zfs-kmod trigger initrd rebuild before
287 + # userspace component is rebuilt
288 + # KV_* variables are provided by linux-info.eclass
289 + if [[ -z ${ROOT} ]] && use dist-kernel; then
290 + dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}"
291 + fi
292 +
293 + if use rootfs; then
294 + if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then
295 + elog "Root on zfs requires an initramfs to boot"
296 + elog "The following packages provide one and are tested on a regular basis:"
297 + elog " sys-kernel/dracut"
298 + elog " sys-kernel/genkernel"
299 + fi
300 + fi
301 +
302 + if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then
303 + einfo "Adding ${P} to the module database to ensure that the"
304 + einfo "kernel modules and userland utilities stay in sync."
305 + update_moduledb
306 + fi
307 +
308 + if systemd_is_booted || has_version sys-apps/systemd; then
309 + einfo "Please refer to ${EROOT}/lib/systemd/system-preset/50-zfs.preset"
310 + einfo "for default zfs systemd service configuration"
311 + else
312 + [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \
313 + einfo "You should add zfs-import to the boot runlevel."
314 + [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \
315 + einfo "You should add zfs-mount to the boot runlevel."
316 + [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \
317 + einfo "You should add zfs-share to the default runlevel."
318 + [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \
319 + einfo "You should add zfs-zed to the default runlevel."
320 + fi
321 +}
322 +
323 +pkg_postrm() {
324 + if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then
325 + remove_moduledb
326 + fi
327 +}