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