1 |
commit: 8539c8b819ff52fad94b71f9bd640e3604128e08 |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 8 19:53:27 2019 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 9 06:27:53 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8539c8b8 |
7 |
|
8 |
sys-kernel/spl: 0.7.12 linux-4.20 compatible |
9 |
|
10 |
Package-Manager: Portage-2.3.54, Repoman-2.3.12 |
11 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
12 |
|
13 |
sys-kernel/spl/spl-0.7.12-r1.ebuild | 112 ++++++++++++++++++++++++++++++++++++ |
14 |
1 file changed, 112 insertions(+) |
15 |
|
16 |
diff --git a/sys-kernel/spl/spl-0.7.12-r1.ebuild b/sys-kernel/spl/spl-0.7.12-r1.ebuild |
17 |
new file mode 100644 |
18 |
index 00000000000..3fc2610b1ca |
19 |
--- /dev/null |
20 |
+++ b/sys-kernel/spl/spl-0.7.12-r1.ebuild |
21 |
@@ -0,0 +1,112 @@ |
22 |
+# Copyright 1999-2019 Gentoo Authors |
23 |
+# Distributed under the terms of the GNU General Public License v2 |
24 |
+ |
25 |
+EAPI="5" |
26 |
+ |
27 |
+if [[ ${PV} == "9999" ]] ; then |
28 |
+ AUTOTOOLS_AUTORECONF="1" |
29 |
+ EGIT_REPO_URI="https://github.com/zfsonlinux/${PN}.git" |
30 |
+ inherit git-r3 |
31 |
+else |
32 |
+ SRC_URI="https://github.com/zfsonlinux/zfs/releases/download/zfs-${PV}/${P}.tar.gz" |
33 |
+ KEYWORDS="~amd64" |
34 |
+fi |
35 |
+ |
36 |
+inherit flag-o-matic linux-info linux-mod autotools-utils |
37 |
+ |
38 |
+DESCRIPTION="The Solaris Porting Layer provides many of the Solaris kernel APIs" |
39 |
+HOMEPAGE="https://zfsonlinux.org/" |
40 |
+ |
41 |
+LICENSE="GPL-2" |
42 |
+SLOT="0" |
43 |
+IUSE="custom-cflags debug" |
44 |
+RESTRICT="debug? ( strip ) test" |
45 |
+ |
46 |
+COMMON_DEPEND=" |
47 |
+ dev-lang/perl |
48 |
+ virtual/awk" |
49 |
+ |
50 |
+DEPEND="${COMMON_DEPEND}" |
51 |
+ |
52 |
+RDEPEND="${COMMON_DEPEND} |
53 |
+ !sys-devel/spl" |
54 |
+ |
55 |
+AT_M4DIR="config" |
56 |
+AUTOTOOLS_IN_SOURCE_BUILD="1" |
57 |
+DOCS=( AUTHORS DISCLAIMER ) |
58 |
+ |
59 |
+pkg_setup() { |
60 |
+ linux-info_pkg_setup |
61 |
+ CONFIG_CHECK=" |
62 |
+ !DEBUG_LOCK_ALLOC |
63 |
+ MODULES |
64 |
+ KALLSYMS |
65 |
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR |
66 |
+ !PAX_SIZE_OVERFLOW |
67 |
+ !TRIM_UNUSED_KSYMS |
68 |
+ ZLIB_DEFLATE |
69 |
+ ZLIB_INFLATE |
70 |
+ " |
71 |
+ |
72 |
+ use debug && CONFIG_CHECK="${CONFIG_CHECK} |
73 |
+ FRAME_POINTER |
74 |
+ DEBUG_INFO |
75 |
+ !DEBUG_INFO_REDUCED |
76 |
+ " |
77 |
+ |
78 |
+ kernel_is ge 2 6 32 || die "Linux 2.6.32 or newer required" |
79 |
+ |
80 |
+ [ ${PV} != "9999" ] && \ |
81 |
+ { kernel_is le 4 20 || die "Linux 4.20 is the latest supported version."; } |
82 |
+ |
83 |
+ check_extra_config |
84 |
+} |
85 |
+ |
86 |
+src_prepare() { |
87 |
+ # Workaround for hard coded path |
88 |
+ sed -i "s|/sbin/lsmod|/bin/lsmod|" "${S}/scripts/check.sh" || \ |
89 |
+ die "Cannot patch check.sh" |
90 |
+ |
91 |
+ # splat is unnecessary unless we are debugging |
92 |
+ use debug || { sed -e 's/^subdir-m += splat$//' -i "${S}/module/Makefile.in" || die ; } |
93 |
+ |
94 |
+ # Set module revision number |
95 |
+ [ ${PV} != "9999" ] && \ |
96 |
+ { sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; } |
97 |
+ |
98 |
+ autotools-utils_src_prepare |
99 |
+} |
100 |
+ |
101 |
+src_configure() { |
102 |
+ use custom-cflags || strip-flags |
103 |
+ filter-ldflags -Wl,* |
104 |
+ |
105 |
+ set_arch_to_kernel |
106 |
+ local myeconfargs=( |
107 |
+ --bindir="${EPREFIX}/bin" |
108 |
+ --sbindir="${EPREFIX}/sbin" |
109 |
+ --with-config=all |
110 |
+ --with-linux="${KV_DIR}" |
111 |
+ --with-linux-obj="${KV_OUT_DIR}" |
112 |
+ $(use_enable debug) |
113 |
+ ) |
114 |
+ autotools-utils_src_configure |
115 |
+} |
116 |
+ |
117 |
+src_install() { |
118 |
+ autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}" |
119 |
+} |
120 |
+ |
121 |
+pkg_postinst() { |
122 |
+ linux-mod_pkg_postinst |
123 |
+ |
124 |
+ # Remove old modules |
125 |
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/spl" ] |
126 |
+ then |
127 |
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/spl" |
128 |
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/spl" |
129 |
+ ewarn "Automatically removing old modules to avoid problems." |
130 |
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/spl" || die "Cannot remove modules" |
131 |
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon" |
132 |
+ fi |
133 |
+} |