summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkos Chandras <hwoarang@gentoo.org>2012-06-17 09:17:36 +0000
committerMarkos Chandras <hwoarang@gentoo.org>2012-06-17 09:17:36 +0000
commit3bce143496bfb52363d959ba6e7a4f173e97efdc (patch)
treeaa3bf0e3aa3c0f6816cffa557abad6eee6440835 /app-emulation/phpvirtualbox
parentAdd backport of AF_LOCAL/AF_UNIX fix from upstream to fix compilation on e.g.... (diff)
downloadhistorical-3bce143496bfb52363d959ba6e7a4f173e97efdc.tar.gz
historical-3bce143496bfb52363d959ba6e7a4f173e97efdc.tar.bz2
historical-3bce143496bfb52363d959ba6e7a4f173e97efdc.zip
Add init script to automatically start/save virtual machines on boot/shutdown. Thanks to Balint SZENTE <balint@szentedwg.ro>. Bug #420991
Package-Manager: portage-2.1.10.65/cvs/Linux x86_64
Diffstat (limited to 'app-emulation/phpvirtualbox')
-rw-r--r--app-emulation/phpvirtualbox/ChangeLog9
-rw-r--r--app-emulation/phpvirtualbox/Manifest22
-rw-r--r--app-emulation/phpvirtualbox/files/vboxinit-initd39
-rw-r--r--app-emulation/phpvirtualbox/phpvirtualbox-4.1.7-r1.ebuild62
4 files changed, 126 insertions, 6 deletions
diff --git a/app-emulation/phpvirtualbox/ChangeLog b/app-emulation/phpvirtualbox/ChangeLog
index a4fcf3a8e860..e7cbc5946271 100644
--- a/app-emulation/phpvirtualbox/ChangeLog
+++ b/app-emulation/phpvirtualbox/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-emulation/phpvirtualbox
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/phpvirtualbox/ChangeLog,v 1.1 2012/03/16 22:44:27 hwoarang Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/phpvirtualbox/ChangeLog,v 1.2 2012/06/17 09:17:36 hwoarang Exp $
+
+*phpvirtualbox-4.1.7-r1 (17 Jun 2012)
+
+ 17 Jun 2012; Markos Chandras <hwoarang@gentoo.org> +files/vboxinit-initd,
+ +phpvirtualbox-4.1.7-r1.ebuild:
+ Add init script to automatically start/save virtual machines on boot/shutdown.
+ Thanks to Balint SZENTE <balint@szentedwg.ro>. Bug #420991
*phpvirtualbox-4.1.7 (16 Mar 2012)
diff --git a/app-emulation/phpvirtualbox/Manifest b/app-emulation/phpvirtualbox/Manifest
index 7d44e2e79dc0..3321cf66b74f 100644
--- a/app-emulation/phpvirtualbox/Manifest
+++ b/app-emulation/phpvirtualbox/Manifest
@@ -1,14 +1,26 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
+AUX vboxinit-initd 1131 RMD160 9c359b186318ebb90f3a7dcc406a029232ad20ae SHA1 20dc98c15575895444d7387f4d588d846b8a1457 SHA256 1199ce69e87e89f3118a10040348f6ce60f5dfc52684b6b609e3b6b1cda2d081
DIST phpvirtualbox-4.1-7.zip 2760199 RMD160 bbc14f536f4b8c060ff70196a060ca45b0d1feca SHA1 7788d4820148840899c61b32dc30f0c9f65c3e0c SHA256 16c27cd1bcc843b464752c3dd7091247b690218bca06fcecbdd130c5daf70b7c
+EBUILD phpvirtualbox-4.1.7-r1.ebuild 1704 RMD160 461036ccd83d62285f8e91bf7b64f1aa64e54c54 SHA1 ab4e4c0bccc8ac280568637b2d8252ae99ffd288 SHA256 1f8ca06363dddd802fb86b08eb058ab9cfa2a40fc0dc31d2fe6c07d366b96068
EBUILD phpvirtualbox-4.1.7.ebuild 1236 RMD160 c01c1aa1fe80200421c311e9df77594e7b423934 SHA1 e88566c6eb6f318f46125ceaaf2b2d0ecd34f049 SHA256 351e542d4410e494d18c1a8707d20e29e72509e0baf9258a5fb6532681a4eeda
-MISC ChangeLog 474 RMD160 96f5356217cf6bb622567dd72086ea89d788e9bc SHA1 2977fa5e7d7d1319d7c85e1e4dceea08cfa1ae80 SHA256 7098c9cbc9472c68a659b18b4106bdd0b48e459415a61ccc3eaaf7acf62dacf6
+MISC ChangeLog 766 RMD160 ba517cad5b8810ecbf49860e9a9e630d5ef93f94 SHA1 d34448559588837a10e9c804cf0e8c155b79894b SHA256 c4f3ef0db62da9fe7c0bdb5e9905bdb6f27e11f6baa6bbf698d1673c6056e564
MISC metadata.xml 368 RMD160 465a259a43e20427be0962b1814cfca7ba11d3c3 SHA1 5d86e01d15fa955d4077e2b4b94d5f387e53093f SHA256 e5a348f86afac6616f4edfe4d33341f57d7117cc3a91afb7779ea0045b49ea96
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.17 (GNU/Linux)
+Version: GnuPG v2.0.19 (GNU/Linux)
-iEYEAREKAAYFAk93PtcACgkQuUQtlDBCeQImiQCfZD8vFuC8jNBuUUydbfi6H//2
-kKoAn3AhlUl5cIhA1ZWebwOFBvTmEVoY
-=mzxz
+iQIcBAEBCgAGBQJP3aC0AAoJEPqDWhW0r/LCzpoP/jaIdbZFIpaOOWcKDvHBy3K3
+rFxJMUEaYiqYuFmm1LVcQ27RAY3JW0sNoLr2DgiRke7ETJ2F+RUzriLjg/40t7TQ
+1ZtldnigXDrD6yQIt8w8jl+vC7RyZuwaVjYQf3X0/CNqf6s+bmXA0awTMbghrt49
+4eliW6CdkgQucQKBIurs9A8y9rtPW88EONuYD5JJac4+GY50+tMssbAYQ8Uihfc7
+J7rKhdDa/jOrN8wwR72t3bHVEqcX3Dw9oG+J2ERcaUp+uyZ+X62Vw4woW7Dw1IVR
+t1wozadxIm/A91jdDJ+3T2RxBe9CP2LV9tEyF/33VVpWt3XafebXQQ6ypbooSRYN
+HD2nmbklShSfWf56ofnhkFN9P85/9bcRyf7oYWsM9+NuITcTVZZKdFvQTPM5t9Ut
+Cb390h0PS3vr5fEIYsErMLHIENs2Oa/bmClvOUdKgdxUD4Yg4T8fNO2n8qHEGrKK
+0WtVOMAQNKcmBDGAP1uvZhyf3/W0HqgU2TcUynAu7aRCm2T/We6wo+O1+P/WnYVm
+H5/yu6Y8zFEnBYkSRWMgJvvhgc9ot5oDtktQOkwdd27DKfrxpfbq18IUuTNcCEQ3
+s4DY35iL0u2JGd5bbqgtH4v0lgEHCt9vZNRLD9jgBpc6AnvcuZxg4CCaPIHc2dm5
+6A7C/o3gGsgZsv74CW+/
+=AGMr
-----END PGP SIGNATURE-----
diff --git a/app-emulation/phpvirtualbox/files/vboxinit-initd b/app-emulation/phpvirtualbox/files/vboxinit-initd
new file mode 100644
index 000000000000..b43528864d00
--- /dev/null
+++ b/app-emulation/phpvirtualbox/files/vboxinit-initd
@@ -0,0 +1,39 @@
+#!/sbin/runscript
+
+description="Controls VirtualBox sessions"
+
+. /etc/conf.d/vboxwebsrv
+
+su_command="su - ${VBOXWEBSRV_USER} -c"
+
+depend() {
+ need localmount
+ after bootmisc
+}
+
+start() {
+ einfo "Starting VirtualBox machines"
+ eindent
+ MACHINES=$($su_command "VBoxManage list vms | awk '{ print \$NF }' | sed -e 's/[{}]//g'")
+ for UUID in $MACHINES; do
+ STARTUP=$($su_command "VBoxManage getextradata $UUID 'pvbx/startupMode'" | awk '{ print $NF }')
+ VMNAME=$($su_command "VBoxManage showvminfo $UUID | sed -n '0,/^Name:/s/^Name:[ \t]*//p'")
+ if [ "${STARTUP}" == "auto" ]; then
+ ebegin "Starting machine ${VMNAME}"
+ $su_command "VBoxHeadless -s $UUID --vrde=config" &>> /var/log/vboxinit.log
+ eend $?
+ fi
+ done
+}
+
+stop() {
+ einfo "Saving VirtualBox machines"
+ eindent
+ MACHINES=$($su_command "VBoxManage list runningvms | awk '{ print \$NF }' | sed -e 's/[{}]//g'")
+ for UUID in $MACHINES; do
+ VMNAME=$($su_command "VBoxManage showvminfo $UUID | sed -n '0,/^Name:/s/^Name:[ \t]*//p'")
+ ebegin "Stopping machine ${VMNAME}"
+ $su_command "VBoxManage controlvm $UUID savestate" &>> /var/log/vboxinit.log
+ eend $?
+ done
+}
diff --git a/app-emulation/phpvirtualbox/phpvirtualbox-4.1.7-r1.ebuild b/app-emulation/phpvirtualbox/phpvirtualbox-4.1.7-r1.ebuild
new file mode 100644
index 000000000000..b6833f272797
--- /dev/null
+++ b/app-emulation/phpvirtualbox/phpvirtualbox-4.1.7-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/phpvirtualbox/phpvirtualbox-4.1.7-r1.ebuild,v 1.1 2012/06/17 09:17:36 hwoarang Exp $
+
+EAPI="2"
+
+inherit versionator eutils webapp depend.php
+
+MY_PV="$(replace_version_separator 2 '-')"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Web-based administration for VirtualBox in PHP"
+HOMEPAGE="http://phpvirtualbox.googlecode.com"
+SRC_URI="http://${PN}.googlecode.com/files/${MY_P}.zip"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-lang/php[session,unicode,soap,gd]
+"
+DEPEND="app-arch/unzip"
+
+need_php_httpd
+
+src_install() {
+ webapp_src_preinst
+
+ cd ${MY_P}
+
+ dodoc CHANGELOG.txt LICENSE.txt README.txt || die
+ rm -f CHANGELOG.txt LICENSE.txt README.txt
+
+ insinto "${MY_HTDOCSDIR}"
+ doins -r .
+
+ webapp_configfile "${MY_HTDOCSDIR}"/config.php-example
+ webapp_serverowned "${MY_HTDOCSDIR}"/config.php-example
+
+ webapp_src_install
+
+ newinitd "${FILESDIR}"/vboxinit-initd vboxinit
+}
+
+pkg_postinst() {
+ webapp_pkg_postinst
+ elog "Local or remote virtualbox hosts must be compiled with"
+ elog "'vboxwebsrv' useflag and the respective init script"
+ elog "must be running to use this interface"
+ elog " /etc/init.d/vboxwebsrv start"
+ elog
+ elog "To enable the automatic startup mode feature uncomment the"
+ elog "following line in the config.php file:"
+ elog " var \$startStopConfig = true;"
+ elog
+ elog "You should also add the /etc/init.d/vboxinit script to the"
+ elog "default runlevel on the virtualbox host:"
+ elog "\`rc-update add vboxinit default\`"
+ elog "If the server is on a remote host, than the script must be"
+ elog "copied manually."
+}