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