1 |
# Copyright 1999-2012 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/app-emulation/kvm-kmod/kvm-kmod-2.6.38.6.ebuild,v 1.1 2011/05/25 14:56:34 cardoe Exp $ |
4 |
|
5 |
EAPI="2" |
6 |
|
7 |
inherit eutils linux-mod |
8 |
|
9 |
SRC_URI="mirror://sourceforge/kvm/${P}.tar.bz2" |
10 |
|
11 |
DESCRIPTION="Kernel-based Virtual Machine kernel modules" |
12 |
HOMEPAGE="http://www.linux-kvm.org" |
13 |
|
14 |
LICENSE="GPL-2" |
15 |
SLOT="0" |
16 |
KEYWORDS="-* ~amd64 ~x86" |
17 |
IUSE="" |
18 |
RESTRICT="test" |
19 |
|
20 |
RDEPEND="" |
21 |
DEPEND="${RDEPEND}" |
22 |
|
23 |
pkg_setup() { |
24 |
linux-mod_pkg_setup |
25 |
|
26 |
linux_config_exists || die "Your kernel sources are unconfigured" |
27 |
|
28 |
if ! linux_chkconfig_present KVM; then |
29 |
eerror "KVM now needs CONFIG_KVM built into your kernel, even" |
30 |
eerror "if you're using the external modules from this package." |
31 |
eerror "Please enable KVM support in your kernel, found at:" |
32 |
eerror |
33 |
eerror " Virtualization" |
34 |
eerror " Kernel-based Virtual Machine (KVM) support" |
35 |
eerror |
36 |
die "KVM support not detected!" |
37 |
fi |
38 |
BUILD_TARGETS="all" |
39 |
MODULE_NAMES="kvm(kernel/arch/x86/kvm/:${S}:${S}/x86)" |
40 |
MODULE_NAMES="${MODULE_NAMES} kvm-intel(kernel/arch/x86/kvm/:${S}:${S}/x86)" |
41 |
MODULE_NAMES="${MODULE_NAMES} kvm-amd(kernel/arch/x86/kvm/:${S}:${S}/x86)" |
42 |
} |
43 |
|
44 |
src_configure() { |
45 |
local conf_opts |
46 |
|
47 |
conf_opts="--kerneldir=$KV_DIR" |
48 |
|
49 |
if has_multilib_profile && [[ "${DEFAULT_ABI}" == "x86" ]] ; then |
50 |
conf_opts="$conf_opts --arch=x86" |
51 |
fi |
52 |
|
53 |
./configure ${conf_opts} || die "configure failed" |
54 |
} |
55 |
|
56 |
src_compile() { |
57 |
linux-mod_src_compile |
58 |
} |
59 |
|
60 |
src_install() { |
61 |
linux-mod_src_install |
62 |
} |
63 |
|
64 |
pkg_preinst() { |
65 |
find /lib/modules/${KV_FULL} -name 'kvm*.ko' -type f -delete |
66 |
|
67 |
linux-mod_pkg_preinst |
68 |
} |