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