# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit linux-mod eutils DESCRIPTION="Kernel modules for VMWare Workstation" HOMEPAGE="http://www.vmware.com/products/desktop/ws_features.html" SRC_URI="http://gentoo.mercymachines.net/distfiles/${P}.tar.gz" RESTRICT="fetch" LICENSE="vmware" SLOT="0" KEYWORDS="~x86" DEPEND="=app-emulation/vmware-workstation-${PV} virtual/linux-sources" MODULE_NAMES="vmmon vmnet" pkg_nofetch() { ewarn "These modules aren't redestributable" ewarn "Create the archive like so:" ewarn ewarn "mkdir /tmp/${P}" ewarn "cp -v /opt/vmware/workstation/lib/modules/source/{${MODULE_NAMES/ /,}}.tar \ " ewarn " /tmp/${P}/" ewarn "tar cvzf ${DISTDIR}/${P}.tar.gz \ " ewarn " -C /tmp ${P}/" ewarn "rm -rf /tmp/${P}" } src_unpack() { unpack ${A} for each in ${MODULE_NAMES} do cd ${S} tar xf "${each}.tar" convert_to_m ${each}-only/Makefile cd ${S}/${each}-only einfo "Fixing ${each} Makefile" sed "s/VM_UNAME = .*$/VM_UNAME = ${KV}/" -i Makefile || die done } src_compile() { for each in ${MODULE_NAMES} do cd ${S}/${each}-only ARCH=i386 emake || die done } src_install() { dodir /lib/modules/${KV}/misc/ insinto /lib/modules/${KV}/misc/ for each in ${MODULE_NAMES} do doins ${each}.o || die dosym /lib/modules/${KV}/misc/${each}.o \ /lib/modules/${KV}/misc/${each}.ko || die done } pkg_postinst() { einfo "Updating kernel modules" update-modules }