Gentoo Archives: gentoo-commits

From: Matt Thode <prometheanfire@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/
Date: Wed, 14 Feb 2018 21:01:31
Message-Id: 1518642078.c3ea7d4efa01399135c6af317bdefa53417c1839.prometheanfire@gentoo
1 commit: c3ea7d4efa01399135c6af317bdefa53417c1839
2 Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 14 21:01:02 2018 +0000
4 Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 14 21:01:18 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3ea7d4e
7
8 sys-fs/zfs: 0.7 branch ebuild
9
10 Package-Manager: Portage-2.3.19, Repoman-2.3.6
11
12 sys-fs/zfs/zfs-0.7.9999.ebuild | 198 +++++++++++++++++++++++++++++++++++++++++
13 1 file changed, 198 insertions(+)
14
15 diff --git a/sys-fs/zfs/zfs-0.7.9999.ebuild b/sys-fs/zfs/zfs-0.7.9999.ebuild
16 new file mode 100644
17 index 00000000000..da5f1597be5
18 --- /dev/null
19 +++ b/sys-fs/zfs/zfs-0.7.9999.ebuild
20 @@ -0,0 +1,198 @@
21 +# Copyright 1999-2018 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI="5"
25 +PYTHON_COMPAT=( python{2_7,3_4,3_5} )
26 +
27 +if [[ ${PV} == *"9999" ]] ; then
28 + AUTOTOOLS_AUTORECONF="1"
29 + EGIT_REPO_URI="https://github.com/zfsonlinux/${PN}.git"
30 + EGIT_BRANCH="zfs-0.7-release"
31 + inherit git-r3 linux-mod
32 +else
33 + SRC_URI="https://github.com/zfsonlinux/${PN}/releases/download/${P}/${P}.tar.gz"
34 + KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
35 +fi
36 +
37 +inherit autotools-utils bash-completion-r1 flag-o-matic linux-info python-r1 systemd toolchain-funcs udev
38 +
39 +DESCRIPTION="Userland utilities for ZFS Linux kernel module"
40 +HOMEPAGE="http://zfsonlinux.org/"
41 +
42 +LICENSE="BSD-2 CDDL MIT"
43 +SLOT="0"
44 +IUSE="custom-cflags debug kernel-builtin +rootfs test-suite static-libs"
45 +RESTRICT="test"
46 +
47 +COMMON_DEPEND="
48 + net-libs/libtirpc
49 + sys-apps/util-linux[static-libs?]
50 + sys-libs/zlib[static-libs(+)?]
51 + virtual/awk
52 +"
53 +DEPEND="${COMMON_DEPEND}
54 + virtual/pkgconfig
55 +"
56 +
57 +RDEPEND="${COMMON_DEPEND}
58 + !=sys-apps/grep-2.13*
59 + !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
60 + !sys-fs/zfs-fuse
61 + !prefix? ( virtual/udev )
62 + test-suite? (
63 + sys-apps/util-linux
64 + sys-devel/bc
65 + sys-block/parted
66 + sys-fs/lsscsi
67 + sys-fs/mdadm
68 + sys-process/procps
69 + virtual/modutils
70 + )
71 + rootfs? (
72 + app-arch/cpio
73 + app-misc/pax-utils
74 + !<sys-boot/grub-2.00-r2:2
75 + )
76 +"
77 +
78 +AT_M4DIR="config"
79 +AUTOTOOLS_IN_SOURCE_BUILD="1"
80 +
81 +pkg_setup() {
82 + if use kernel_linux && use test-suite; then
83 + linux-info_pkg_setup
84 + if ! linux_config_exists; then
85 + ewarn "Cannot check the linux kernel configuration."
86 + else
87 + # recheck that we don't have usblp to collide with libusb
88 + if use test-suite; then
89 + if linux_chkconfig_present BLK_DEV_LOOP; then
90 + eerror "The ZFS test suite requires loop device support enabled."
91 + eerror "Please enable it:"
92 + eerror " CONFIG_BLK_DEV_LOOP=y"
93 + eerror "in /usr/src/linux/.config or"
94 + eerror " Device Drivers --->"
95 + eerror " Block devices --->"
96 + eerror " [ ] Loopback device support"
97 + fi
98 + fi
99 + fi
100 + fi
101 +
102 +}
103 +
104 +src_prepare() {
105 + # Update paths
106 + sed -e "s|/sbin/lsmod|/bin/lsmod|" \
107 + -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \
108 + -e "s|/sbin/parted|/usr/sbin/parted|" \
109 + -i scripts/common.sh.in
110 +
111 + autotools-utils_src_prepare
112 +}
113 +
114 +src_configure() {
115 + use custom-cflags || strip-flags
116 + local myeconfargs=(
117 + --bindir="${EPREFIX}/bin"
118 + --sbindir="${EPREFIX}/sbin"
119 + --with-config=user
120 + --with-dracutdir="/usr/$(get_libdir)/dracut"
121 + --with-linux="${KV_DIR}"
122 + --with-linux-obj="${KV_OUT_DIR}"
123 + --with-udevdir="$(get_udevdir)"
124 + --with-blkid
125 + $(use_enable debug)
126 + )
127 + autotools-utils_src_configure
128 +
129 + # prepare systemd unit and helper script
130 + cat "${FILESDIR}/zfs.service.in" | \
131 + sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
132 + -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
133 + > "${T}/zfs.service" || die
134 + cat "${FILESDIR}/zfs-init.sh.in" | \
135 + sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
136 + -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
137 + > "${T}/zfs-init.sh" || die
138 +}
139 +
140 +src_install() {
141 + autotools-utils_src_install
142 + gen_usr_ldscript -a uutil nvpair zpool zfs zfs_core
143 + use test-suite || rm -rf "${ED}usr/share/zfs"
144 +
145 + newbashcomp "${FILESDIR}/bash-completion-r1" zfs
146 + bashcomp_alias zfs zpool
147 +
148 + exeinto /usr/libexec
149 + doexe "${T}/zfs-init.sh"
150 + systemd_dounit "${T}/zfs.service"
151 +}
152 +
153 +pkg_postinst() {
154 + if ! use kernel-builtin && [[ ${PV} = *"9999" ]]
155 + then
156 + einfo "Adding ${P} to the module database to ensure that the"
157 + einfo "kernel modules and userland utilities stay in sync."
158 + update_moduledb
159 + fi
160 +
161 + if [ -e "${EROOT}etc/runlevels/boot/zfs" ]
162 + then
163 + einfo 'The zfs boot script has been split into the zfs-import,'
164 + einfo 'zfs-mount and zfs-share scripts.'
165 + einfo
166 + einfo 'You had the zfs script in your boot runlevel. For your'
167 + einfo 'convenience, it has been automatically removed and the three'
168 + einfo 'scripts that replace it have been configured to start.'
169 + einfo 'The zfs-import and zfs-mount scripts have been added to the boot'
170 + einfo 'runlevel while the zfs-share script is in the default runlevel.'
171 +
172 + rm "${EROOT}etc/runlevels/boot/zfs"
173 + ln -snf "${EROOT}etc/init.d/zfs-import" \
174 + "${EROOT}etc/runlevels/boot/zfs-import"
175 + ln -snf "${EROOT}etc/init.d/zfs-mount" \
176 + "${EROOT}etc/runlevels/boot/zfs-mount"
177 + ln -snf "${EROOT}etc/init.d/zfs-share" \
178 + "${EROOT}etc/runlevels/default/zfs-share"
179 + else
180 + [ -e "${EROOT}etc/runlevels/boot/zfs-import" ] || \
181 + einfo "You should add zfs-import to the boot runlevel."
182 + [ -e "${EROOT}etc/runlevels/boot/zfs-mount" ] || \
183 + einfo "You should add zfs-mount to the boot runlevel."
184 + [ -e "${EROOT}etc/runlevels/default/zfs-share" ] || \
185 + einfo "You should add zfs-share to the default runlevel."
186 + fi
187 +
188 + if [ -e "${EROOT}etc/runlevels/default/zed" ]
189 + then
190 + einfo 'The downstream OpenRC zed script has replaced by the upstream'
191 + einfo 'OpenRC zfs-zed script.'
192 + einfo
193 + einfo 'You had the zed script in your default runlevel. For your'
194 + einfo 'convenience, it has been automatically removed and the zfs-zed'
195 + einfo 'script that replaced it has been configured to start.'
196 +
197 + rm "${EROOT}etc/runlevels/boot/zed"
198 + ln -snf "${EROOT}etc/init.d/zfs-sed" \
199 + "${EROOT}etc/runlevels/default/zfs-zed"
200 + else
201 + [ -e "${EROOT}etc/runlevels/default/zfs-zed" ] || \
202 + einfo "You should add zfs-zed to the default runlevel."
203 + fi
204 +
205 + if [ -e "${EROOT}etc/runlevels/shutdown/zfs-shutdown" ]
206 + then
207 + einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
208 + rm "${EROOT}etc/runlevels/shutdown/zfs-shutdown"
209 + fi
210 +
211 +}
212 +
213 +pkg_postrm() {
214 + if ! use kernel-builtin && [[ ${PV} = *"9999" ]]
215 + then
216 + remove_moduledb
217 + fi
218 +}