Merge remote-tracking branch 'github/pr/760'.
[gentoo.git] / app-emulation / phpvirtualbox / phpvirtualbox-4.1.11.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="2"
6
7 inherit versionator eutils webapp
8
9 MY_PV="$(replace_version_separator 2 '-')"
10 MY_P="${PN}-${MY_PV}"
11
12 DESCRIPTION="Web-based administration for VirtualBox in PHP"
13 HOMEPAGE="https://sourceforge.net/projects/phpvirtualbox/"
14 SRC_URI="https://${PN}.googlecode.com/files/${MY_P}.zip"
15
16 LICENSE="GPL-2"
17 KEYWORDS="~amd64 ~x86"
18 IUSE=""
19
20 RDEPEND="
21         dev-lang/php[session,unicode,soap,gd]
22         virtual/httpd-php
23 "
24 DEPEND="app-arch/unzip"
25
26 src_install() {
27         webapp_src_preinst
28
29         cd ${MY_P}
30
31         dodoc CHANGELOG.txt LICENSE.txt README.txt || die
32         rm -f CHANGELOG.txt LICENSE.txt README.txt
33
34         insinto "${MY_HTDOCSDIR}"
35         doins -r .
36
37         webapp_configfile "${MY_HTDOCSDIR}"/config.php-example
38         webapp_serverowned "${MY_HTDOCSDIR}"/config.php-example
39
40         webapp_src_install
41         if has_version app-emulation/virtualbox[vboxwebsrv] || \
42                 has_version app-emulation/virtualbox-bin[vboxwebsrv]
43         then
44                 newinitd "${FILESDIR}"/vboxinit-initd vboxinit
45         fi
46 }
47
48 pkg_postinst() {
49         webapp_pkg_postinst
50         elog "Local or remote virtualbox hosts must be compiled with"
51         elog "'vboxwebsrv' useflag and the respective init script"
52         elog "must be running to use this interface"
53         elog " /etc/init.d/vboxwebsrv start"
54         elog
55         elog "To enable the automatic startup mode feature uncomment the"
56         elog "following line in the config.php file:"
57         elog " var \$startStopConfig = true;"
58         elog
59         elog "You should also add the /etc/init.d/vboxinit script to the"
60         elog "default runlevel on the virtualbox host:"
61         elog "\`rc-update add vboxinit default\`"
62         elog "If the server is on a remote host, than the script must be"
63         elog "copied manually from"
64         elog "${FILESDIR}/vboxinit-initd to /etc/init.d/vboxinit"
65         elog "on the remote host."
66 }