aboutsummaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authorMakoto Matsushita <matusita@FreeBSD.org>2004-03-16 15:37:28 +0000
committerMakoto Matsushita <matusita@FreeBSD.org>2004-03-16 15:37:28 +0000
commit65c8bd3235c541d4d3e68068c88755548bc19203 (patch)
tree38a119c7779971705746cfe0f9602d45d39dde93 /emulators
parent2b4d11170e661a527af71036673c83abe47b3bf7 (diff)
downloadports-65c8bd3235c541d4d3e68068c88755548bc19203.tar.gz
ports-65c8bd3235c541d4d3e68068c88755548bc19203.zip
Notes
Diffstat (limited to 'emulators')
-rw-r--r--emulators/vmware-guestd4/Makefile31
-rw-r--r--emulators/vmware-guestd4/files/vmware-guest_kmod.sh29
-rw-r--r--emulators/vmware-guestd4/files/vmware-guestd.sh74
-rw-r--r--emulators/vmware-guestd4/files/vmware-guestd.sh.in74
-rw-r--r--emulators/vmware-guestd4/pkg-plist3
-rw-r--r--emulators/vmware-guestd4/pkg-plist.tools2
-rw-r--r--emulators/vmware-guestd5/Makefile31
-rw-r--r--emulators/vmware-guestd5/files/vmware-guest_kmod.sh29
-rw-r--r--emulators/vmware-guestd5/files/vmware-guestd.sh74
-rw-r--r--emulators/vmware-guestd5/files/vmware-guestd.sh.in74
-rw-r--r--emulators/vmware-guestd5/pkg-plist3
-rw-r--r--emulators/vmware-guestd5/pkg-plist.tools2
-rw-r--r--emulators/vmware-guestd6/Makefile31
-rw-r--r--emulators/vmware-guestd6/files/vmware-guest_kmod.sh29
-rw-r--r--emulators/vmware-guestd6/files/vmware-guestd.sh74
-rw-r--r--emulators/vmware-guestd6/files/vmware-guestd.sh.in74
-rw-r--r--emulators/vmware-guestd6/pkg-plist3
-rw-r--r--emulators/vmware-guestd6/pkg-plist.tools2
18 files changed, 357 insertions, 282 deletions
diff --git a/emulators/vmware-guestd4/Makefile b/emulators/vmware-guestd4/Makefile
index 9d129b2379be..96f7b840b772 100644
--- a/emulators/vmware-guestd4/Makefile
+++ b/emulators/vmware-guestd4/Makefile
@@ -24,6 +24,10 @@ 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
@@ -35,8 +39,8 @@ NO_BUILD= yes
RESTRICTED= "Not sure if we can redistribute this."
NO_PACKAGE= ${RESTRICTED}
-VMWARE_VER= 4.0.5
-BUILD_VER= 6030
+VMWARE_VER= 4.5.1
+BUILD_VER= 7568
MOUNT_DEV?= /dev/acd0
MOUNT_PT?= /mnt
@@ -58,8 +62,10 @@ PLIST_SUB+= INSTALLXSERVER4:=""
.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:=""
@@ -77,7 +83,7 @@ fetch-list:
do-fetch:
@${ECHO} ""
@${ECHO} "========================================================================"
- @${ECHO} "Choose \"File\" -> \"Install VMware Tools...\" from the Workstation menu"
+ @${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} ""
@@ -100,16 +106,22 @@ do-fetch:
post-extract:
${UMOUNT} ${MOUNT_PT}
-.if !defined(VMWARE_X_PORTS)
+.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 ${X11BASE}/bin
+ ${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."
@@ -117,6 +129,8 @@ do-install:
@${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
@@ -130,14 +144,13 @@ do-build:
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/sbin/vmware-guestd ${PREFIX}/sbin
${INSTALL_PROGRAM} ${WRKSRC}/sbin/vmware-checkvm ${PREFIX}/sbin
- ${INSTALL_SCRIPT} -m 755 ${FILESDIR}/vmware-guestd.sh \
- ${PREFIX}/etc/rc.d/vmware-guestd.sh.sample
.if defined(WITH_VMWARE_VMMEMCTL)
${MKDIR} ${VMWARE_KMODDIR}
${INSTALL_PROGRAM} ${WRKDIR}/vmmemctl-only/vmmemctl.ko ${VMWARE_KMODDIR}
- ${INSTALL_SCRIPT} -m 755 ${FILESDIR}/vmware-guest_kmod.sh \
- ${PREFIX}/etc/rc.d/vmware-guest_kmod.sh.sample
.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
diff --git a/emulators/vmware-guestd4/files/vmware-guest_kmod.sh b/emulators/vmware-guestd4/files/vmware-guest_kmod.sh
deleted file mode 100644
index 63470a3d07ac..000000000000
--- a/emulators/vmware-guestd4/files/vmware-guest_kmod.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- kldstat -v | grep vmmemctl >/dev/null || kldload ${PREFIX}/lib/vmware-tools/modules/vmmemctl.ko
- echo -n ' vmware-guestkmod'
- fi
- ;;
-stop)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- kldstat -v | grep vmmemctl >/dev/null && kldunload vmmemctl && echo -n ' vmware-guestkmod'
- fi
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0
diff --git a/emulators/vmware-guestd4/files/vmware-guestd.sh b/emulators/vmware-guestd4/files/vmware-guestd.sh
index 569be8a4121e..3fda127b1fee 100644
--- a/emulators/vmware-guestd4/files/vmware-guestd.sh
+++ b/emulators/vmware-guestd4/files/vmware-guestd.sh
@@ -1,29 +1,49 @@
#!/bin/sh
+#
+# $FreeBSD$
+#
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- ${PREFIX}/sbin/vmware-guestd &
- echo -n ' vmware-guestd'
- fi
- ;;
-stop)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- killall vmware-guestd && echo -n ' vmware-guestd'
- fi
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0
+# PROVIDE: vmware-guestd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: FreeBSD
+
+PREFIX=%%PREFIX%%
+. %%RC_SUBR%%
+
+# Global
+checkvm_cmd="${PREFIX}/sbin/vmware-checkvm > /dev/null"
+
+# Functions
+vmware_guest_kmod_start()
+{
+ echo 'Loading vmmemctl kernel module.'
+ kldload ${PREFIX}/lib/vmware-tools/modules/vmmemctl.ko >/dev/null 2>&1
+}
+
+# VMware kernel modules
+name="vmware_guest_kmod"
+rcvar=`set_rcvar`
+start_precmd="${checkvm_cmd}"
+start_cmd="vmware_guest_kmod_start"
+stop_precmd="${checkvm_cmd}"
+stop_cmd=":"
+
+load_rc_config $name
+[ -z "$vmware_guest_kmod_enable" ] && vmware_guest_kmod_enable="NO"
+run_rc_command "$1"
+
+# VMware guest daemon
+name="vmware_guestd"
+rcvar=`set_rcvar`
+start_precmd="${checkvm_cmd}"
+unset start_cmd
+stop_precmd="${checkvm_cmd}"
+unset stop_cmd
+command="${PREFIX}/sbin/vmware-guestd"
+pidfile="/var/run/${name}.pid"
+
+load_rc_config $name
+[ -z "$vmware_guestd_enable" ] && vmware_guestd_enable="YES"
+[ -z "$vmware_guestd_flags" ] && vmware_guestd_flags="--background ${pidfile}"
+run_rc_command "$1"
diff --git a/emulators/vmware-guestd4/files/vmware-guestd.sh.in b/emulators/vmware-guestd4/files/vmware-guestd.sh.in
index 569be8a4121e..3fda127b1fee 100644
--- a/emulators/vmware-guestd4/files/vmware-guestd.sh.in
+++ b/emulators/vmware-guestd4/files/vmware-guestd.sh.in
@@ -1,29 +1,49 @@
#!/bin/sh
+#
+# $FreeBSD$
+#
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- ${PREFIX}/sbin/vmware-guestd &
- echo -n ' vmware-guestd'
- fi
- ;;
-stop)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- killall vmware-guestd && echo -n ' vmware-guestd'
- fi
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0
+# PROVIDE: vmware-guestd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: FreeBSD
+
+PREFIX=%%PREFIX%%
+. %%RC_SUBR%%
+
+# Global
+checkvm_cmd="${PREFIX}/sbin/vmware-checkvm > /dev/null"
+
+# Functions
+vmware_guest_kmod_start()
+{
+ echo 'Loading vmmemctl kernel module.'
+ kldload ${PREFIX}/lib/vmware-tools/modules/vmmemctl.ko >/dev/null 2>&1
+}
+
+# VMware kernel modules
+name="vmware_guest_kmod"
+rcvar=`set_rcvar`
+start_precmd="${checkvm_cmd}"
+start_cmd="vmware_guest_kmod_start"
+stop_precmd="${checkvm_cmd}"
+stop_cmd=":"
+
+load_rc_config $name
+[ -z "$vmware_guest_kmod_enable" ] && vmware_guest_kmod_enable="NO"
+run_rc_command "$1"
+
+# VMware guest daemon
+name="vmware_guestd"
+rcvar=`set_rcvar`
+start_precmd="${checkvm_cmd}"
+unset start_cmd
+stop_precmd="${checkvm_cmd}"
+unset stop_cmd
+command="${PREFIX}/sbin/vmware-guestd"
+pidfile="/var/run/${name}.pid"
+
+load_rc_config $name
+[ -z "$vmware_guestd_enable" ] && vmware_guestd_enable="YES"
+[ -z "$vmware_guestd_flags" ] && vmware_guestd_flags="--background ${pidfile}"
+run_rc_command "$1"
diff --git a/emulators/vmware-guestd4/pkg-plist b/emulators/vmware-guestd4/pkg-plist
index 858c18bd9250..c27ee799e7d5 100644
--- a/emulators/vmware-guestd4/pkg-plist
+++ b/emulators/vmware-guestd4/pkg-plist
@@ -1,7 +1,6 @@
sbin/vmware-checkvm
sbin/vmware-guestd
-etc/rc.d/vmware-guestd.sh.sample
-%%VMWARE_VMMEMCTL:%%etc/rc.d/vmware-guest_kmod.sh.sample
+etc/rc.d/vmware-guestd.sh
%%VMWARE_VMMEMCTL:%%lib/vmware-tools/modules/vmmemctl.ko
%%VMWARE_VMMEMCTL:%%@unexec rmdir %D/lib/vmware-tools/modules 2>/dev/null || true
%%VMWARE_VMMEMCTL:%%@unexec rmdir %D/lib/vmware-tools 2>/dev/null || true
diff --git a/emulators/vmware-guestd4/pkg-plist.tools b/emulators/vmware-guestd4/pkg-plist.tools
index 4d614c4466f6..acc0046b6340 100644
--- a/emulators/vmware-guestd4/pkg-plist.tools
+++ b/emulators/vmware-guestd4/pkg-plist.tools
@@ -2,3 +2,5 @@ bin/vmware-toolbox
%%INSTALLXSERVER3:%%bin/XF86_VMware
%%INSTALLXSERVER3:%%etc/XF86Config_VMware
%%INSTALLXSERVER4:%%etc/XF86Config-4_VMware
+%%INSTALLXSERVER4:%%lib/modules/drivers/vmware_drv.o_VMware
+%%INSTALLXSERVER4:%%lib/modules/input/vmmouse_drv.o_VMware
diff --git a/emulators/vmware-guestd5/Makefile b/emulators/vmware-guestd5/Makefile
index 9d129b2379be..96f7b840b772 100644
--- a/emulators/vmware-guestd5/Makefile
+++ b/emulators/vmware-guestd5/Makefile
@@ -24,6 +24,10 @@ 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
@@ -35,8 +39,8 @@ NO_BUILD= yes
RESTRICTED= "Not sure if we can redistribute this."
NO_PACKAGE= ${RESTRICTED}
-VMWARE_VER= 4.0.5
-BUILD_VER= 6030
+VMWARE_VER= 4.5.1
+BUILD_VER= 7568
MOUNT_DEV?= /dev/acd0
MOUNT_PT?= /mnt
@@ -58,8 +62,10 @@ PLIST_SUB+= INSTALLXSERVER4:=""
.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:=""
@@ -77,7 +83,7 @@ fetch-list:
do-fetch:
@${ECHO} ""
@${ECHO} "========================================================================"
- @${ECHO} "Choose \"File\" -> \"Install VMware Tools...\" from the Workstation menu"
+ @${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} ""
@@ -100,16 +106,22 @@ do-fetch:
post-extract:
${UMOUNT} ${MOUNT_PT}
-.if !defined(VMWARE_X_PORTS)
+.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 ${X11BASE}/bin
+ ${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."
@@ -117,6 +129,8 @@ do-install:
@${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
@@ -130,14 +144,13 @@ do-build:
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/sbin/vmware-guestd ${PREFIX}/sbin
${INSTALL_PROGRAM} ${WRKSRC}/sbin/vmware-checkvm ${PREFIX}/sbin
- ${INSTALL_SCRIPT} -m 755 ${FILESDIR}/vmware-guestd.sh \
- ${PREFIX}/etc/rc.d/vmware-guestd.sh.sample
.if defined(WITH_VMWARE_VMMEMCTL)
${MKDIR} ${VMWARE_KMODDIR}
${INSTALL_PROGRAM} ${WRKDIR}/vmmemctl-only/vmmemctl.ko ${VMWARE_KMODDIR}
- ${INSTALL_SCRIPT} -m 755 ${FILESDIR}/vmware-guest_kmod.sh \
- ${PREFIX}/etc/rc.d/vmware-guest_kmod.sh.sample
.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
diff --git a/emulators/vmware-guestd5/files/vmware-guest_kmod.sh b/emulators/vmware-guestd5/files/vmware-guest_kmod.sh
deleted file mode 100644
index 63470a3d07ac..000000000000
--- a/emulators/vmware-guestd5/files/vmware-guest_kmod.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- kldstat -v | grep vmmemctl >/dev/null || kldload ${PREFIX}/lib/vmware-tools/modules/vmmemctl.ko
- echo -n ' vmware-guestkmod'
- fi
- ;;
-stop)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- kldstat -v | grep vmmemctl >/dev/null && kldunload vmmemctl && echo -n ' vmware-guestkmod'
- fi
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0
diff --git a/emulators/vmware-guestd5/files/vmware-guestd.sh b/emulators/vmware-guestd5/files/vmware-guestd.sh
index 569be8a4121e..3fda127b1fee 100644
--- a/emulators/vmware-guestd5/files/vmware-guestd.sh
+++ b/emulators/vmware-guestd5/files/vmware-guestd.sh
@@ -1,29 +1,49 @@
#!/bin/sh
+#
+# $FreeBSD$
+#
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- ${PREFIX}/sbin/vmware-guestd &
- echo -n ' vmware-guestd'
- fi
- ;;
-stop)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- killall vmware-guestd && echo -n ' vmware-guestd'
- fi
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0
+# PROVIDE: vmware-guestd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: FreeBSD
+
+PREFIX=%%PREFIX%%
+. %%RC_SUBR%%
+
+# Global
+checkvm_cmd="${PREFIX}/sbin/vmware-checkvm > /dev/null"
+
+# Functions
+vmware_guest_kmod_start()
+{
+ echo 'Loading vmmemctl kernel module.'
+ kldload ${PREFIX}/lib/vmware-tools/modules/vmmemctl.ko >/dev/null 2>&1
+}
+
+# VMware kernel modules
+name="vmware_guest_kmod"
+rcvar=`set_rcvar`
+start_precmd="${checkvm_cmd}"
+start_cmd="vmware_guest_kmod_start"
+stop_precmd="${checkvm_cmd}"
+stop_cmd=":"
+
+load_rc_config $name
+[ -z "$vmware_guest_kmod_enable" ] && vmware_guest_kmod_enable="NO"
+run_rc_command "$1"
+
+# VMware guest daemon
+name="vmware_guestd"
+rcvar=`set_rcvar`
+start_precmd="${checkvm_cmd}"
+unset start_cmd
+stop_precmd="${checkvm_cmd}"
+unset stop_cmd
+command="${PREFIX}/sbin/vmware-guestd"
+pidfile="/var/run/${name}.pid"
+
+load_rc_config $name
+[ -z "$vmware_guestd_enable" ] && vmware_guestd_enable="YES"
+[ -z "$vmware_guestd_flags" ] && vmware_guestd_flags="--background ${pidfile}"
+run_rc_command "$1"
diff --git a/emulators/vmware-guestd5/files/vmware-guestd.sh.in b/emulators/vmware-guestd5/files/vmware-guestd.sh.in
index 569be8a4121e..3fda127b1fee 100644
--- a/emulators/vmware-guestd5/files/vmware-guestd.sh.in
+++ b/emulators/vmware-guestd5/files/vmware-guestd.sh.in
@@ -1,29 +1,49 @@
#!/bin/sh
+#
+# $FreeBSD$
+#
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- ${PREFIX}/sbin/vmware-guestd &
- echo -n ' vmware-guestd'
- fi
- ;;
-stop)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- killall vmware-guestd && echo -n ' vmware-guestd'
- fi
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0
+# PROVIDE: vmware-guestd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: FreeBSD
+
+PREFIX=%%PREFIX%%
+. %%RC_SUBR%%
+
+# Global
+checkvm_cmd="${PREFIX}/sbin/vmware-checkvm > /dev/null"
+
+# Functions
+vmware_guest_kmod_start()
+{
+ echo 'Loading vmmemctl kernel module.'
+ kldload ${PREFIX}/lib/vmware-tools/modules/vmmemctl.ko >/dev/null 2>&1
+}
+
+# VMware kernel modules
+name="vmware_guest_kmod"
+rcvar=`set_rcvar`
+start_precmd="${checkvm_cmd}"
+start_cmd="vmware_guest_kmod_start"
+stop_precmd="${checkvm_cmd}"
+stop_cmd=":"
+
+load_rc_config $name
+[ -z "$vmware_guest_kmod_enable" ] && vmware_guest_kmod_enable="NO"
+run_rc_command "$1"
+
+# VMware guest daemon
+name="vmware_guestd"
+rcvar=`set_rcvar`
+start_precmd="${checkvm_cmd}"
+unset start_cmd
+stop_precmd="${checkvm_cmd}"
+unset stop_cmd
+command="${PREFIX}/sbin/vmware-guestd"
+pidfile="/var/run/${name}.pid"
+
+load_rc_config $name
+[ -z "$vmware_guestd_enable" ] && vmware_guestd_enable="YES"
+[ -z "$vmware_guestd_flags" ] && vmware_guestd_flags="--background ${pidfile}"
+run_rc_command "$1"
diff --git a/emulators/vmware-guestd5/pkg-plist b/emulators/vmware-guestd5/pkg-plist
index 858c18bd9250..c27ee799e7d5 100644
--- a/emulators/vmware-guestd5/pkg-plist
+++ b/emulators/vmware-guestd5/pkg-plist
@@ -1,7 +1,6 @@
sbin/vmware-checkvm
sbin/vmware-guestd
-etc/rc.d/vmware-guestd.sh.sample
-%%VMWARE_VMMEMCTL:%%etc/rc.d/vmware-guest_kmod.sh.sample
+etc/rc.d/vmware-guestd.sh
%%VMWARE_VMMEMCTL:%%lib/vmware-tools/modules/vmmemctl.ko
%%VMWARE_VMMEMCTL:%%@unexec rmdir %D/lib/vmware-tools/modules 2>/dev/null || true
%%VMWARE_VMMEMCTL:%%@unexec rmdir %D/lib/vmware-tools 2>/dev/null || true
diff --git a/emulators/vmware-guestd5/pkg-plist.tools b/emulators/vmware-guestd5/pkg-plist.tools
index 4d614c4466f6..acc0046b6340 100644
--- a/emulators/vmware-guestd5/pkg-plist.tools
+++ b/emulators/vmware-guestd5/pkg-plist.tools
@@ -2,3 +2,5 @@ bin/vmware-toolbox
%%INSTALLXSERVER3:%%bin/XF86_VMware
%%INSTALLXSERVER3:%%etc/XF86Config_VMware
%%INSTALLXSERVER4:%%etc/XF86Config-4_VMware
+%%INSTALLXSERVER4:%%lib/modules/drivers/vmware_drv.o_VMware
+%%INSTALLXSERVER4:%%lib/modules/input/vmmouse_drv.o_VMware
diff --git a/emulators/vmware-guestd6/Makefile b/emulators/vmware-guestd6/Makefile
index 9d129b2379be..96f7b840b772 100644
--- a/emulators/vmware-guestd6/Makefile
+++ b/emulators/vmware-guestd6/Makefile
@@ -24,6 +24,10 @@ 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
@@ -35,8 +39,8 @@ NO_BUILD= yes
RESTRICTED= "Not sure if we can redistribute this."
NO_PACKAGE= ${RESTRICTED}
-VMWARE_VER= 4.0.5
-BUILD_VER= 6030
+VMWARE_VER= 4.5.1
+BUILD_VER= 7568
MOUNT_DEV?= /dev/acd0
MOUNT_PT?= /mnt
@@ -58,8 +62,10 @@ PLIST_SUB+= INSTALLXSERVER4:=""
.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:=""
@@ -77,7 +83,7 @@ fetch-list:
do-fetch:
@${ECHO} ""
@${ECHO} "========================================================================"
- @${ECHO} "Choose \"File\" -> \"Install VMware Tools...\" from the Workstation menu"
+ @${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} ""
@@ -100,16 +106,22 @@ do-fetch:
post-extract:
${UMOUNT} ${MOUNT_PT}
-.if !defined(VMWARE_X_PORTS)
+.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 ${X11BASE}/bin
+ ${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."
@@ -117,6 +129,8 @@ do-install:
@${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
@@ -130,14 +144,13 @@ do-build:
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/sbin/vmware-guestd ${PREFIX}/sbin
${INSTALL_PROGRAM} ${WRKSRC}/sbin/vmware-checkvm ${PREFIX}/sbin
- ${INSTALL_SCRIPT} -m 755 ${FILESDIR}/vmware-guestd.sh \
- ${PREFIX}/etc/rc.d/vmware-guestd.sh.sample
.if defined(WITH_VMWARE_VMMEMCTL)
${MKDIR} ${VMWARE_KMODDIR}
${INSTALL_PROGRAM} ${WRKDIR}/vmmemctl-only/vmmemctl.ko ${VMWARE_KMODDIR}
- ${INSTALL_SCRIPT} -m 755 ${FILESDIR}/vmware-guest_kmod.sh \
- ${PREFIX}/etc/rc.d/vmware-guest_kmod.sh.sample
.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
diff --git a/emulators/vmware-guestd6/files/vmware-guest_kmod.sh b/emulators/vmware-guestd6/files/vmware-guest_kmod.sh
deleted file mode 100644
index 63470a3d07ac..000000000000
--- a/emulators/vmware-guestd6/files/vmware-guest_kmod.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- kldstat -v | grep vmmemctl >/dev/null || kldload ${PREFIX}/lib/vmware-tools/modules/vmmemctl.ko
- echo -n ' vmware-guestkmod'
- fi
- ;;
-stop)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- kldstat -v | grep vmmemctl >/dev/null && kldunload vmmemctl && echo -n ' vmware-guestkmod'
- fi
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0
diff --git a/emulators/vmware-guestd6/files/vmware-guestd.sh b/emulators/vmware-guestd6/files/vmware-guestd.sh
index 569be8a4121e..3fda127b1fee 100644
--- a/emulators/vmware-guestd6/files/vmware-guestd.sh
+++ b/emulators/vmware-guestd6/files/vmware-guestd.sh
@@ -1,29 +1,49 @@
#!/bin/sh
+#
+# $FreeBSD$
+#
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- ${PREFIX}/sbin/vmware-guestd &
- echo -n ' vmware-guestd'
- fi
- ;;
-stop)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- killall vmware-guestd && echo -n ' vmware-guestd'
- fi
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0
+# PROVIDE: vmware-guestd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: FreeBSD
+
+PREFIX=%%PREFIX%%
+. %%RC_SUBR%%
+
+# Global
+checkvm_cmd="${PREFIX}/sbin/vmware-checkvm > /dev/null"
+
+# Functions
+vmware_guest_kmod_start()
+{
+ echo 'Loading vmmemctl kernel module.'
+ kldload ${PREFIX}/lib/vmware-tools/modules/vmmemctl.ko >/dev/null 2>&1
+}
+
+# VMware kernel modules
+name="vmware_guest_kmod"
+rcvar=`set_rcvar`
+start_precmd="${checkvm_cmd}"
+start_cmd="vmware_guest_kmod_start"
+stop_precmd="${checkvm_cmd}"
+stop_cmd=":"
+
+load_rc_config $name
+[ -z "$vmware_guest_kmod_enable" ] && vmware_guest_kmod_enable="NO"
+run_rc_command "$1"
+
+# VMware guest daemon
+name="vmware_guestd"
+rcvar=`set_rcvar`
+start_precmd="${checkvm_cmd}"
+unset start_cmd
+stop_precmd="${checkvm_cmd}"
+unset stop_cmd
+command="${PREFIX}/sbin/vmware-guestd"
+pidfile="/var/run/${name}.pid"
+
+load_rc_config $name
+[ -z "$vmware_guestd_enable" ] && vmware_guestd_enable="YES"
+[ -z "$vmware_guestd_flags" ] && vmware_guestd_flags="--background ${pidfile}"
+run_rc_command "$1"
diff --git a/emulators/vmware-guestd6/files/vmware-guestd.sh.in b/emulators/vmware-guestd6/files/vmware-guestd.sh.in
index 569be8a4121e..3fda127b1fee 100644
--- a/emulators/vmware-guestd6/files/vmware-guestd.sh.in
+++ b/emulators/vmware-guestd6/files/vmware-guestd.sh.in
@@ -1,29 +1,49 @@
#!/bin/sh
+#
+# $FreeBSD$
+#
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- ${PREFIX}/sbin/vmware-guestd &
- echo -n ' vmware-guestd'
- fi
- ;;
-stop)
- exec 2>/dev/null
- ulimit -c 0
- if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then
- killall vmware-guestd && echo -n ' vmware-guestd'
- fi
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0
+# PROVIDE: vmware-guestd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: FreeBSD
+
+PREFIX=%%PREFIX%%
+. %%RC_SUBR%%
+
+# Global
+checkvm_cmd="${PREFIX}/sbin/vmware-checkvm > /dev/null"
+
+# Functions
+vmware_guest_kmod_start()
+{
+ echo 'Loading vmmemctl kernel module.'
+ kldload ${PREFIX}/lib/vmware-tools/modules/vmmemctl.ko >/dev/null 2>&1
+}
+
+# VMware kernel modules
+name="vmware_guest_kmod"
+rcvar=`set_rcvar`
+start_precmd="${checkvm_cmd}"
+start_cmd="vmware_guest_kmod_start"
+stop_precmd="${checkvm_cmd}"
+stop_cmd=":"
+
+load_rc_config $name
+[ -z "$vmware_guest_kmod_enable" ] && vmware_guest_kmod_enable="NO"
+run_rc_command "$1"
+
+# VMware guest daemon
+name="vmware_guestd"
+rcvar=`set_rcvar`
+start_precmd="${checkvm_cmd}"
+unset start_cmd
+stop_precmd="${checkvm_cmd}"
+unset stop_cmd
+command="${PREFIX}/sbin/vmware-guestd"
+pidfile="/var/run/${name}.pid"
+
+load_rc_config $name
+[ -z "$vmware_guestd_enable" ] && vmware_guestd_enable="YES"
+[ -z "$vmware_guestd_flags" ] && vmware_guestd_flags="--background ${pidfile}"
+run_rc_command "$1"
diff --git a/emulators/vmware-guestd6/pkg-plist b/emulators/vmware-guestd6/pkg-plist
index 858c18bd9250..c27ee799e7d5 100644
--- a/emulators/vmware-guestd6/pkg-plist
+++ b/emulators/vmware-guestd6/pkg-plist
@@ -1,7 +1,6 @@
sbin/vmware-checkvm
sbin/vmware-guestd
-etc/rc.d/vmware-guestd.sh.sample
-%%VMWARE_VMMEMCTL:%%etc/rc.d/vmware-guest_kmod.sh.sample
+etc/rc.d/vmware-guestd.sh
%%VMWARE_VMMEMCTL:%%lib/vmware-tools/modules/vmmemctl.ko
%%VMWARE_VMMEMCTL:%%@unexec rmdir %D/lib/vmware-tools/modules 2>/dev/null || true
%%VMWARE_VMMEMCTL:%%@unexec rmdir %D/lib/vmware-tools 2>/dev/null || true
diff --git a/emulators/vmware-guestd6/pkg-plist.tools b/emulators/vmware-guestd6/pkg-plist.tools
index 4d614c4466f6..acc0046b6340 100644
--- a/emulators/vmware-guestd6/pkg-plist.tools
+++ b/emulators/vmware-guestd6/pkg-plist.tools
@@ -2,3 +2,5 @@ bin/vmware-toolbox
%%INSTALLXSERVER3:%%bin/XF86_VMware
%%INSTALLXSERVER3:%%etc/XF86Config_VMware
%%INSTALLXSERVER4:%%etc/XF86Config-4_VMware
+%%INSTALLXSERVER4:%%lib/modules/drivers/vmware_drv.o_VMware
+%%INSTALLXSERVER4:%%lib/modules/input/vmmouse_drv.o_VMware