1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 AUTOTOOLS_AUTORECONF="1"
8 inherit flag-o-matic linux-info linux-mod autotools-utils
10 if [[ ${PV} == "9999" ]] ; then
12 EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
14 inherit eutils versionator
15 MY_PV=$(replace_version_separator 3 '-')
16 SRC_URI="https://github.com/zfsonlinux/${PN}/archive/${PN}-${MY_PV}.tar.gz
17 https://dev.gentoo.org/~ryao/dist/${PN}-${MY_PV}-p4.tar.xz"
18 S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
19 KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
22 DESCRIPTION="The Solaris Porting Layer is a Linux kernel module which provides many of the Solaris kernel APIs"
23 HOMEPAGE="http://zfsonlinux.org/"
27 IUSE="custom-cflags debug debug-log"
30 COMMON_DEPEND="dev-lang/perl
33 DEPEND="${COMMON_DEPEND}"
35 RDEPEND="${COMMON_DEPEND}
39 AUTOTOOLS_IN_SOURCE_BUILD="1"
48 !PAX_KERNEXEC_PLUGIN_METHOD_OR
53 kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
55 [ ${PV} != "9999" ] && \
56 { kernel_is le 3 14 || die "Linux 3.14 is the latest supported version."; }
62 # Workaround for hard coded path
63 sed -i "s|/sbin/lsmod|/bin/lsmod|" scripts/check.sh || die
65 if [ ${PV} != "9999" ]
68 EPATCH_SUFFIX="patch" \
70 epatch "${WORKDIR}/${PN}-${MY_PV}-patches"
73 # splat is unnecessary unless we are debugging
74 use debug || sed -e 's/^subdir-m += splat$//' -i "${S}/module/Makefile.in"
76 autotools-utils_src_prepare
80 use custom-cflags || strip-flags
85 --bindir="${EPREFIX}/bin"
86 --sbindir="${EPREFIX}/sbin"
88 --with-linux="${KV_DIR}"
89 --with-linux-obj="${KV_OUT_DIR}"
91 $(use_enable debug-log)
93 autotools-utils_src_configure
97 autotools-utils_src_install
98 dodoc AUTHORS DISCLAIMER README.markdown
102 linux-mod_pkg_postinst
105 if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/spl" ]
107 ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/spl"
108 ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/spl"
109 ewarn "Automatically removing old modules to avoid problems."
110 rm -r "${EROOT}lib/modules/${KV_FULL}/addon/spl" || die "Cannot remove modules"
111 rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"