diff options
author | decke <decke@FreeBSD.org> | 2011-05-22 17:15:09 +0800 |
---|---|---|
committer | decke <decke@FreeBSD.org> | 2011-05-22 17:15:09 +0800 |
commit | 956d690c08cd579b2719e9c5c47502de0e44b7a6 (patch) | |
tree | 0259aac1b2959e0ee7c6ebd3bb2760794622eda1 /emulators | |
parent | 4109706064921a2d2dc15bf4d8aea1216f8b0e29 (diff) | |
download | freebsd-ports-gnome-956d690c08cd579b2719e9c5c47502de0e44b7a6.tar.gz freebsd-ports-gnome-956d690c08cd579b2719e9c5c47502de0e44b7a6.tar.zst freebsd-ports-gnome-956d690c08cd579b2719e9c5c47502de0e44b7a6.zip |
- Introduce -legacy ports
- Add vboxheadless startscript [1]
- Add vboxwebsrv startscript [2]
- Change CONFLICTS to CONFLICTS_INSTALL [3]
- Remove stale mirror
- Bump PORTREVISION
PR: ports/156699 (based on) [3]
Submitted by: Stefan Tollkuehn <stefan.tollkuehn@editura.de>, [1][2]
Raul Gigea <raul.gigea@editura.de>, [1]
Tobias Oberstein <tobias.oberstein@tavendo.de>, [1]
Emil <the_mix_room@hotmail.com> [3]
Thanks to: dougb@, [1][2]
Cr4zi3/EFNet, [2]
crsd [2]
Diffstat (limited to 'emulators')
-rw-r--r-- | emulators/virtualbox-ose-kmod-legacy/Makefile | 10 | ||||
-rw-r--r-- | emulators/virtualbox-ose-legacy/Makefile | 19 | ||||
-rw-r--r-- | emulators/virtualbox-ose-legacy/files/vboxheadless.in | 125 | ||||
-rw-r--r-- | emulators/virtualbox-ose-legacy/files/vboxwebsrv.in | 49 |
4 files changed, 193 insertions, 10 deletions
diff --git a/emulators/virtualbox-ose-kmod-legacy/Makefile b/emulators/virtualbox-ose-kmod-legacy/Makefile index ce68f65d0f59..3297d0cfe35c 100644 --- a/emulators/virtualbox-ose-kmod-legacy/Makefile +++ b/emulators/virtualbox-ose-kmod-legacy/Makefile @@ -1,4 +1,4 @@ -# New ports collection makefile for: virtualbox-ose-kmod +# New ports collection makefile for: virtualbox-ose-kmod-legacy # Date created: 2009-09-21 # Whom: Bernhard Froehlich <decke@bluelife.at> # @@ -11,9 +11,8 @@ PORTREVISION= 1 CATEGORIES= emulators kld MASTER_SITES= http://tmp.chruetertee.ch/ \ http://freebsd.unixfreunde.de/sources/ \ - http://disasterarea.chruetertee.ch/ \ - http://mirror.4bit.ws/ -PKGNAMESUFFIX= -kmod + http://disasterarea.chruetertee.ch/ +PKGNAMESUFFIX= -kmod-legacy DISTNAME= VirtualBox-${DISTVERSION}-OSE MAINTAINER= vbox@FreeBSD.org @@ -38,7 +37,8 @@ CONFIGURE_ARGS+=--with-gcc="${CC}" --with-g++="${CXX}" --nofatal \ --disable-alsa --disable-dbus --disable-python \ --build-headless -CONFLICTS= bcc-[0-9]* virtualbox-ose-kmod-devel-3* +CONFLICTS= bcc-[0-9]* +CONFLICTS_INSTALL= virtualbox-ose-kmod-[3,4]* virtualbox-ose-kmod-devel-[3,4]* OPTIONS= DEBUG "Build with debugging symbols" off diff --git a/emulators/virtualbox-ose-legacy/Makefile b/emulators/virtualbox-ose-legacy/Makefile index d0cb42456601..ff85060cb4d5 100644 --- a/emulators/virtualbox-ose-legacy/Makefile +++ b/emulators/virtualbox-ose-legacy/Makefile @@ -1,4 +1,4 @@ -# New ports collection makefile for: virtualbox-ose +# New ports collection makefile for: virtualbox-ose-legacy # Date created: 2009-05-02 # Whom: Bernhard Froehlich <decke@bluelife.at> # @@ -7,13 +7,13 @@ PORTNAME= virtualbox-ose DISTVERSION= 3.2.12 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= emulators MASTER_SITES= http://tmp.chruetertee.ch/ \ http://freebsd.unixfreunde.de/sources/ \ http://disasterarea.chruetertee.ch/ \ - http://mirror.4bit.ws/ \ http://dlc.sun.com/virtualbox/${VBOX_GUEST_VER}/:guestadditions +PKGNAMESUFFIX= -legacy DISTFILES= VirtualBox-${DISTVERSION}-OSE${EXTRACT_SUFX} ${GADISTFILES} EXTRACT_ONLY= VirtualBox-${DISTVERSION}-OSE${EXTRACT_SUFX} @@ -28,7 +28,7 @@ BUILD_DEPENDS= yasm:${PORTSDIR}/devel/yasm \ LIB_DEPENDS= png.6:${PORTSDIR}/graphics/png \ xslt.2:${PORTSDIR}/textproc/libxslt \ curl.6:${PORTSDIR}/ftp/curl -RUN_DEPENDS= /boot/modules/vboxdrv.ko:${PORTSDIR}/emulators/virtualbox-ose-kmod +RUN_DEPENDS= /boot/modules/vboxdrv.ko:${PORTSDIR}/emulators/virtualbox-ose-kmod-legacy LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING @@ -47,9 +47,13 @@ HAS_CONFIGURE= yes CONFIGURE_ARGS+=--with-gcc="${CC}" --with-g++="${CXX}" --passive-mesa USE_LDCONFIG= ${PREFIX}/lib/virtualbox -CONFLICTS= bcc-[0-9]* virtualbox-ose-devel-3* virtualbox-ose-additions-3* virtualbox-ose-additions-devel-3* +CONFLICTS= bcc-[0-9]* +CONFLICTS_INSTALL= virtualbox-ose-[3,4]* virtualbox-ose-devel-[3,4]* virtualbox-ose-additions-[3,4]* virtualbox-ose-additions-devel-[3,4]* +VBOXUSER?= vboxusers +VBOXWSUSER?= vboxusers VBOXGROUP?= vboxusers +USERS= ${VBOXUSER} GROUPS= ${VBOXGROUP} VBOX_FRONTENDS= VBoxHeadless VBOX_GUEST_VER= ${PORTVERSION} @@ -71,6 +75,9 @@ PLIST_SUB+= PYTHON_VER=${PYTHON_VER} \ PYTHON_VERU=${PYTHON_VER:S/./_/} \ GUEST_VER=${VBOX_GUEST_VER} +SUB_LIST+= VBOXUSER=${VBOXUSER} +USE_RC_SUBR+= vboxheadless + KMK_BUILDTYPE= release KMK_CONFIG= VBOX_LIBPATH_X11=${LOCALBASE} VBOX_FREEBSD_SRC=${SRC_BASE}/sys KMK_FLAGS= @@ -151,6 +158,8 @@ CONFIGURE_ARGS+=--enable-vde .if defined(WITH_WEBSERVICE) BUILD_DEPENDS+= soapcpp2:${PORTSDIR}/devel/gsoap VBOX_WEB= vboxwebsrv webtest +USE_RC_SUBR+= vboxwebsrv +SUB_LIST+= VBOXWSUSER=${VBOXWSUSER} PLIST_SUB+= WEB="" .else PLIST_SUB+= WEB="@comment " diff --git a/emulators/virtualbox-ose-legacy/files/vboxheadless.in b/emulators/virtualbox-ose-legacy/files/vboxheadless.in new file mode 100644 index 000000000000..f0a04a6b1aa1 --- /dev/null +++ b/emulators/virtualbox-ose-legacy/files/vboxheadless.in @@ -0,0 +1,125 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: vboxheadless +# REQUIRE: LOGIN vboxnet +# KEYWORD: shutdown +# +# Add the following line to /etc/rc.conf[.local] to enable vboxheadless +# +# vboxheadless_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable vboxheadless. +# vboxheadless_machines (str): Space separated list of machines +# vboxheadless_user (str): Default user account to run with. +# (default: %%VBOXUSER%%) +# vboxheadless_<machine>_name (str): Virtualbox machine name or UUID. +# vboxheadless_<machine>_user (str): User account to run with. +# vboxheadless_<machine>_flags (str): Additional flags for VBoxHeadless. + +. /etc/rc.subr + +name="vboxheadless" +rcvar=`set_rcvar` + +command="%%PREFIX%%/bin/VBoxHeadless" +pidbase="/var/run/${name}" + +start_cmd="${name}_start" +stop_cmd="${name}_stop" +status_cmd="${name}_status" + +vboxheadless_start() +{ + local machine mpidfile pid vmname vmuser vmflags + + echo "Starting Virtual Machines:" + for machine in ${vboxheadless_machines}; do + mpidfile="${pidbase}_${machine}.pid" + pid=$(check_pidfile $mpidfile $command) + eval vmname="\${vboxheadless_${machine}_name:-${machine}}" + eval vmuser="\${vboxheadless_${machine}_user:-${vboxheadless_user}}" + eval vmflags="\${vboxheadless_${machine}_flags:-}" + + HOME=$(/usr/sbin/pw usershow -7 -n "${vmuser}" | /usr/bin/cut -d: -f6) + + /usr/bin/printf "%25s " "${vmname}" + + /usr/bin/su ${vmuser} -c "%%PREFIX%%/bin/VBoxManage showvminfo '${vmname}' >/dev/null" 2>/dev/null + + if [ $? != 0 ]; then + echo "Unknown machine" + continue + fi + + if [ -n "${pid}" ]; then + echo "Already running? (pid=${pid})" + continue + fi + + /usr/bin/install -o ${vmuser} -g wheel -m 644 /dev/null ${mpidfile} + /usr/sbin/daemon -f -p ${mpidfile} -u ${vmuser} ${command} --startvm "${vmname}" ${vmflags} + echo "Started" + done +} + +vboxheadless_stop() +{ + local machine mpidfile pid vmname vmuser + + echo "Saving states for Virtual Machines:" + for machine in ${vboxheadless_machines}; do + mpidfile="${pidbase}_${machine}.pid" + pid=$(check_pidfile $mpidfile $command) + eval vmname="\${vboxheadless_${machine}_name:-${machine}}" + eval vmuser="\${vboxheadless_${machine}_user:-${vboxheadless_user}}" + + /usr/bin/printf "%25s " "${vmname}" + + if [ -n "${pid}" ]; then + /usr/bin/su ${vmuser} -c "%%PREFIX%%/bin/VBoxManage controlvm '${vmname}' savestate >/dev/null" 2>/dev/null + wait_for_pids $pid >/dev/null + echo "Stopped" + else + echo "Not running?" + fi + done +} + +vboxheadless_status() +{ + local machine mpidfile pid vmname vmuser + + /usr/bin/printf "%25s %s\n" "Machine" "Status" + /usr/bin/printf "%25s %s\n" "-------------------------" "------------" + + for machine in ${vboxheadless_machines}; do + mpidfile="${pidbase}_${machine}.pid" + pid=$(check_pidfile $mpidfile $command) + eval vmname="\${vboxheadless_${machine}_name:-${machine}}" + eval vmuser="\${vboxheadless_${machine}_user:-${vboxheadless_user}}" + + /usr/bin/su ${vmuser} -c "/usr/local/bin/VBoxManage showvminfo '${vmname}' >/dev/null" 2>/dev/null + + if [ $? != 0 ]; then + /usr/bin/printf "%20s %s\n" "${vmname}" "Unknown Machine" + elif [ -n "${pid}" ]; then + /usr/bin/printf "%25s %s\n" "${vmname}" "Running" + else + /usr/bin/printf "%25s %s\n" "${vmname}" "Powered Off" + fi + done +} + +load_rc_config $name + +: ${vboxheadless_enable="NO"} +: ${vboxheadless_user="%%VBOXUSER%%"} + +cmd_arg="$1" ; shift + +if [ -n "$*" ]; then + vboxheadless_machines="$*" +fi + +run_rc_command "${cmd_arg}" diff --git a/emulators/virtualbox-ose-legacy/files/vboxwebsrv.in b/emulators/virtualbox-ose-legacy/files/vboxwebsrv.in new file mode 100644 index 000000000000..2905effbb3a8 --- /dev/null +++ b/emulators/virtualbox-ose-legacy/files/vboxwebsrv.in @@ -0,0 +1,49 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: vboxwebsrv +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following line to /etc/rc.conf[.local] to enable vboxwebsrv +# +# vboxwebsrv_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable vboxwebsrv. +# vboxwebsrv_user (str): User account to run with. +# vboxwebsrv_flags (str): Custom flags for vboxwebsrv. + +. /etc/rc.subr + +name=vboxwebsrv +rcvar=`set_rcvar` + +command="%%PREFIX%%/bin/vboxwebsrv" +pidfile="/var/run/${name}.pid" + +start_cmd="${name}_start" + +vboxwebsrv_start() +{ + local pid + + HOME=$(/usr/sbin/pw usershow -7 -n "${vboxwebsrv_user}" | /usr/bin/cut -d: -f6) + pid=$(check_pidfile $pidfile $command) + + if [ -n "${pid}" ]; then + echo "${name} already running? (pid=${pid})." + return 1 + fi + + echo -n "Starting ${name}" + /usr/bin/install -o ${vboxwebsrv_user} -g wheel -m 644 /dev/null ${pidfile} + /usr/sbin/daemon -f -p ${pidfile} -u ${vboxwebsrv_user} ${command} ${vboxwebsrv_flags} + echo '.' +} + +load_rc_config $name + +: ${vboxwebsrv_enable="NO"} +: ${vboxwebsrv_user="%%VBOXWSUSER%%"} + +run_rc_command "$1" |