| 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/virtualbox-modules/virtualbox-modules-4.1.14.ebuild,v 1.2 2012/06/01 00:05:08 zmedico Exp $ |
| 4 |
|
| 5 |
# XXX: the tarball here is just the kernel modules split out of the binary |
| 6 |
# package that comes from virtualbox-bin |
| 7 |
|
| 8 |
EAPI=4 |
| 9 |
|
| 10 |
inherit eutils linux-mod user |
| 11 |
|
| 12 |
MY_P=vbox-kernel-module-src-${PV} |
| 13 |
DESCRIPTION="Kernel Modules for Virtualbox" |
| 14 |
HOMEPAGE="http://www.virtualbox.org/" |
| 15 |
SRC_URI="http://dev.gentoo.org/~polynomial-c/virtualbox/${MY_P}.tar.xz" |
| 16 |
|
| 17 |
LICENSE="GPL-2" |
| 18 |
SLOT="0" |
| 19 |
KEYWORDS="~amd64 ~x86" |
| 20 |
IUSE="pax_kernel" |
| 21 |
|
| 22 |
RDEPEND="!=app-emulation/virtualbox-9999" |
| 23 |
|
| 24 |
S=${WORKDIR} |
| 25 |
|
| 26 |
BUILD_TARGETS="all" |
| 27 |
BUILD_TARGET_ARCH="${ARCH}" |
| 28 |
MODULE_NAMES="vboxdrv(misc:${S}) vboxnetflt(misc:${S}) vboxnetadp(misc:${S}) vboxpci(misc:${S})" |
| 29 |
|
| 30 |
pkg_setup() { |
| 31 |
linux-mod_pkg_setup |
| 32 |
|
| 33 |
BUILD_PARAMS="KERN_DIR=${KV_DIR} KERNOUT=${KV_OUT_DIR}" |
| 34 |
enewgroup vboxusers |
| 35 |
} |
| 36 |
|
| 37 |
src_prepare() { |
| 38 |
if kernel_is -ge 2 6 33 ; then |
| 39 |
# evil patch for new kernels - header moved |
| 40 |
grep -lR linux/autoconf.h * | xargs sed -i -e 's:<linux/autoconf.h>:<generated/autoconf.h>:' |
| 41 |
fi |
| 42 |
|
| 43 |
if use pax_kernel && kernel_is -ge 3 0 0 ; then |
| 44 |
epatch "${FILESDIR}"/${PN}-4.1.4-pax-const.patch |
| 45 |
fi |
| 46 |
} |
| 47 |
|
| 48 |
src_install() { |
| 49 |
linux-mod_src_install |
| 50 |
} |
| 51 |
|
| 52 |
pkg_postinst() { |
| 53 |
linux-mod_pkg_postinst |
| 54 |
elog "Starting with the 3.x release new kernel modules were added," |
| 55 |
elog "be sure to load all the needed modules." |
| 56 |
elog "" |
| 57 |
elog "Please add \"vboxdrv\", \"vboxnetflt\" and \"vboxnetadp\" to:" |
| 58 |
elog "/etc/conf.d/modules" |
| 59 |
} |