Use https by default
[gentoo.git] / sys-fs / zfs-kmod / zfs-kmod-0.6.2-r4.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="4"
6
7 AT_M4DIR="config"
8 AUTOTOOLS_AUTORECONF="1"
9 AUTOTOOLS_IN_SOURCE_BUILD="1"
10
11 inherit bash-completion-r1 flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
12
13 if [ ${PV} == "9999" ] ; then
14         inherit git-2
15         MY_PV=9999
16         EGIT_REPO_URI="git://github.com/zfsonlinux/zfs.git"
17 else
18         inherit eutils versionator
19         MY_PV=$(replace_version_separator 3 '-')
20         SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz
21                 https://dev.gentoo.org/~ryao/dist/${PN}-${MY_PV}-p3.tar.xz"
22         S="${WORKDIR}/zfs-zfs-${MY_PV}"
23         KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
24 fi
25
26 DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
27 HOMEPAGE="http://zfsonlinux.org/"
28
29 LICENSE="CDDL debug? ( GPL-2+ )"
30 SLOT="0"
31 IUSE="custom-cflags debug +rootfs"
32 RESTRICT="test"
33
34 DEPEND="
35         =sys-kernel/spl-${PV}*
36         dev-lang/perl
37         virtual/awk
38 "
39
40 RDEPEND="${DEPEND}
41         !sys-fs/zfs-fuse
42 "
43
44 pkg_setup() {
45         linux-info_pkg_setup
46         CONFIG_CHECK="!DEBUG_LOCK_ALLOC
47                 BLK_DEV_LOOP
48                 EFI_PARTITION
49                 IOSCHED_NOOP
50                 MODULES
51                 !PAX_KERNEXEC_PLUGIN_METHOD_OR
52                 ZLIB_DEFLATE
53                 ZLIB_INFLATE
54         "
55
56         use rootfs && \
57                 CONFIG_CHECK="${CONFIG_CHECK} BLK_DEV_INITRD
58                         DEVTMPFS"
59
60         kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
61
62         [ ${PV} != "9999" ] && \
63                 { kernel_is le 3 14 || die "Linux 3.14 is the latest supported version."; }
64
65         check_extra_config
66 }
67
68 src_prepare() {
69         # Remove GPLv2-licensed ZPIOS unless we are debugging
70         use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
71
72         if [ ${PV} != "9999" ]
73         then
74                 # Apply patch set
75                 EPATCH_SUFFIX="patch" \
76                 EPATCH_FORCE="yes" \
77                 epatch "${WORKDIR}/${PN}-${MY_PV}-patches"
78         fi
79
80         autotools-utils_src_prepare
81 }
82
83 src_configure() {
84         use custom-cflags || strip-flags
85         filter-ldflags -Wl,*
86
87         set_arch_to_kernel
88         local myeconfargs=(
89                 --bindir="${EPREFIX}/bin"
90                 --sbindir="${EPREFIX}/sbin"
91                 --with-config=kernel
92                 --with-linux="${KV_DIR}"
93                 --with-linux-obj="${KV_OUT_DIR}"
94                 $(use_enable debug)
95         )
96         autotools-utils_src_configure
97 }
98
99 src_install() {
100         autotools-utils_src_install
101         dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
102 }
103
104 pkg_postinst() {
105         linux-mod_pkg_postinst
106
107         # Remove old modules
108         if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
109         then
110                 ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
111                 ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
112                 ewarn "Automatically removing old modules to avoid problems."
113                 rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
114                 rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
115         fi
116
117         if use x86 || use arm
118         then
119                 ewarn "32-bit kernels will likely require increasing vmalloc to"
120                 ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
121         fi
122
123         ewarn "This version of ZFSOnLinux includes support for features flags."
124         ewarn "If you upgrade your pools to make use of feature flags, you will lose"
125         ewarn "the ability to import them using older versions of ZFSOnLinux."
126         ewarn "Any new pools will be created with feature flag support and will"
127         ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
128         ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
129 }