65c8bd3235
- USE_RC_SUBR. Inspired by ports/net/dtcpclient (thanks ume-san). Since now, loading kernel modules and/or start vmware-guestd can be tweaked via following rc.conf variables: * vmware_guestd_enable (default to YES) * vmware_guest_kmod_enable (default to NO) vmware-guest_kmod.sh is removed; both are handled by a single shell script, vmware-guestd.sh. - Bulid kernel module iff kernel source files are available. This check is just a static checking of /usr/src/sys/Makefile. It would be even better that '/usr/src' can be changed to other place, but I believe that most user puts a source code under /usr/src, or other places and set a symlink to there. If it hits you badly, I'm willing to apply your patch to fix(?) it. - If this ports is used by ports/emulators/vmware-tools4, install XFree86 server modules, vmware_drv.o and vmmouse_drv.o. The vmware_drv.o is a (virtual) graphic chip driver. I believe that if you have already installed XFree86 4.3.0, it should be the same one but compiled on XFree86 4.3.99.2. I've confirmed that it should work with XFree86 4.3.0 server. The vmmouse_drv.o is a mouse driver, use it instead of default mouse driver, mouse_drv.o. It works, but if my test is correct, it doesn't support Emulate3Buttons. Use with care. Both drivers are installed to appropriate directory, but renamed (append '_VMware' to the filename) to avoid any conflicts to other ports (especially ports/x11/XFree86*). P.S.: Happy version 4.5.1, ACPI is enabled by default for FreeBSD guest OS.
158 lines
4.4 KiB
Makefile
158 lines
4.4 KiB
Makefile
# New ports collection makefile for: VMware tools for FreeBSD
|
|
# Date created: 10 Aug 2000
|
|
# Whom: matusita@jp.FreeBSD.org
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
PORTNAME= vmware
|
|
PORTVERSION= ${VMWARE_VER}.${BUILD_VER}
|
|
CATEGORIES= emulators
|
|
MASTER_SITES= # bundled with VMware itself
|
|
PKGNAMESUFFIX?= -guestd
|
|
DISTNAME= vmware-freebsd-tools
|
|
|
|
MAINTAINER= matusita@FreeBSD.org
|
|
COMMENT?=VMware time synchronization daemon for FreeBSD guest OS (for VMware 4.x)
|
|
|
|
.if defined(VMWARE_X_PORTS)
|
|
RUN_DEPENDS= ${LOCALBASE}/sbin/vmware-guestd:${PORTSDIR}/emulators/vmware-guestd4
|
|
.endif
|
|
|
|
DISTDIR= ${MOUNT_PT}
|
|
IGNOREFILES= ${DISTFILES}
|
|
WRKSRC= ${WRKDIR}/vmware-tools-distrib
|
|
|
|
ONLY_FOR_ARCHS= i386
|
|
USE_REINPLACE= yes
|
|
USE_RC_SUBR= yes
|
|
RC_SCRIPT= ${PREFIX}/etc/rc.d/vmware-guestd.sh
|
|
RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
|
|
.if !defined(BATCH)
|
|
IS_INTERACTIVE= yes
|
|
.endif
|
|
.if defined(VMWARE_X_PORTS)
|
|
USE_X_PREFIX= yes
|
|
NO_BUILD= yes
|
|
.endif
|
|
|
|
RESTRICTED= "Not sure if we can redistribute this."
|
|
NO_PACKAGE= ${RESTRICTED}
|
|
|
|
VMWARE_VER= 4.5.1
|
|
BUILD_VER= 7568
|
|
|
|
MOUNT_DEV?= /dev/acd0
|
|
MOUNT_PT?= /mnt
|
|
MOUNT= /sbin/mount
|
|
UMOUNT= /sbin/umount
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
.if defined(VMWARE_X_PORTS)
|
|
|
|
.if ${XFREE86_VERSION} == 3
|
|
PLIST_SUB+= INSTALLXSERVER3:=""
|
|
PLIST_SUB+= INSTALLXSERVER4:="@comment "
|
|
.else
|
|
PLIST_SUB+= INSTALLXSERVER3:="@comment "
|
|
PLIST_SUB+= INSTALLXSERVER4:=""
|
|
.endif
|
|
|
|
.else
|
|
|
|
.if !defined(WITHOUT_VMWARE_VMMEMCTL)
|
|
.if exists(/usr/src/sys/Makefile)
|
|
WITH_VMWARE_VMMEMCTL=YES
|
|
.endif
|
|
.endif
|
|
VMWARE_KMODDIR= ${PREFIX}/lib/vmware-tools/modules
|
|
.if defined(WITH_VMWARE_VMMEMCTL)
|
|
PLIST_SUB+= VMWARE_VMMEMCTL:=""
|
|
PLIST_SUB+= VMWARE_KMODDIR:="${VMWARE_KMODDIR}"
|
|
.else
|
|
PLIST_SUB+= VMWARE_VMMEMCTL:="@comment "
|
|
PLIST_SUB+= VMWARE_KMODDIR:="@comment "
|
|
.endif
|
|
|
|
.endif
|
|
|
|
fetch-list:
|
|
@${DO_NADA}
|
|
|
|
do-fetch:
|
|
@${ECHO} ""
|
|
@${ECHO} "========================================================================"
|
|
@${ECHO} "Choose \"VM\" -> \"Install VMware Tools...\" from the Workstation menu"
|
|
@${ECHO} "to connect the VM's CD-ROM drive temporarily to installation CD image."
|
|
@${ECHO} "========================================================================"
|
|
@${ECHO} ""
|
|
.if !defined(BATCH)
|
|
@${ECHO} "This port mounts ${MOUNT_DEV} to ${MOUNT_PT}."
|
|
@${ECHO} ""
|
|
@${ECHO} -n "Are you ready? [Y/n]: "
|
|
@(read line; \
|
|
case "$${line}" in \
|
|
[Nn]*) \
|
|
${FALSE} ;; \
|
|
*) \
|
|
${TRUE} ;; \
|
|
esac)
|
|
.endif
|
|
${MKDIR} ${MOUNT_PT}
|
|
-${UMOUNT} ${MOUNT_PT} 2>&1 >/dev/null
|
|
-${UMOUNT} ${MOUNT_DEV} 2>&1 >/dev/null
|
|
${MOUNT} -t cd9660 ${MOUNT_DEV} ${MOUNT_PT}
|
|
|
|
post-extract:
|
|
${UMOUNT} ${MOUNT_PT}
|
|
.if defined(WITH_VMWARE_VMMEMCTL)
|
|
(cd ${WRKDIR}; ${TAR} xf ${WRKSRC}/lib/modules/source/vmmemctl.tar)
|
|
.endif
|
|
|
|
post-patch:
|
|
.if defined(WITH_VMWARE_VMMEMCTL)
|
|
${REINPLACE_CMD} -e 's|vmmemctl1.o||' ${WRKDIR}/vmmemctl-only/Makefile
|
|
${ECHO_CMD} "OBJS=vmmemctl1.o" >> ${WRKDIR}/vmmemctl-only/Makefile
|
|
.endif
|
|
|
|
.if defined(VMWARE_X_PORTS)
|
|
|
|
do-install:
|
|
${INSTALL_PROGRAM} ${WRKSRC}/bin/vmware-toolbox ${X11BASE}/bin
|
|
.if ${XFREE86_VERSION} == 3
|
|
${INSTALL_PROGRAM} ${WRKSRC}/lib/configurator/XFree86-3/XF86_VMware_4.5 ${X11BASE}/bin/XF86_VMware
|
|
${INSTALL_DATA} ${WRKSRC}/lib/configurator/XFree86-3/XF86Config ${X11BASE}/etc/XF86Config_VMware
|
|
@${ECHO} ""
|
|
@${ECHO} "You have installed XFree86 3.x X Server for VMware."
|
|
@${ECHO} "${X11BASE}/etc/XF86Config_VMware is a sample XF86Config file."
|
|
@${ECHO} "Copy this file to /etc/XF86Config before starting X."
|
|
.else
|
|
${INSTALL_DATA} ${WRKSRC}/lib/configurator/XFree86-4/XF86Config-4 ${X11BASE}/etc/XF86Config-4_VMware
|
|
${INSTALL_DATA} ${WRKSRC}/lib/configurator/XFree86-4/4.3.x/vmware_drv.o ${X11BASE}/lib/modules/drivers/vmware_drv.o_VMware
|
|
${INSTALL_DATA} ${WRKSRC}/lib/configurator/XFree86-4/4.2.x/vmmouse_drv.o ${X11BASE}/lib/modules/input/vmmouse_drv.o_VMware
|
|
.endif
|
|
-${LOCALBASE}/sbin/vmware-guestd --cmd toolinstall.end
|
|
|
|
.else
|
|
|
|
do-build:
|
|
.if defined(WITH_VMWARE_VMMEMCTL)
|
|
(cd ${WRKDIR}/vmmemctl-only; make)
|
|
.endif
|
|
|
|
do-install:
|
|
${INSTALL_PROGRAM} ${WRKSRC}/sbin/vmware-guestd ${PREFIX}/sbin
|
|
${INSTALL_PROGRAM} ${WRKSRC}/sbin/vmware-checkvm ${PREFIX}/sbin
|
|
.if defined(WITH_VMWARE_VMMEMCTL)
|
|
${MKDIR} ${VMWARE_KMODDIR}
|
|
${INSTALL_PROGRAM} ${WRKDIR}/vmmemctl-only/vmmemctl.ko ${VMWARE_KMODDIR}
|
|
.endif
|
|
@${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
|
${FILESDIR}/vmware-guestd.sh > ${WRKDIR}/vmware-guestd.sh
|
|
@${INSTALL_SCRIPT} ${WRKDIR}/vmware-guestd.sh ${RC_SCRIPT}
|
|
-${LOCALBASE}/sbin/vmware-guestd --cmd toolinstall.end
|
|
|
|
.endif
|
|
|
|
.include <bsd.port.post.mk>
|