Merge remote-tracking branch 'github/pr/634'.
[gentoo.git] / app-emulation / phpvirtualbox / phpvirtualbox-5.0.3.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6
7 inherit versionator eutils webapp readme.gentoo
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="mirror://sourceforge/${PN}/${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 S="${WORKDIR}/${MY_P}"
27
28 DISABLE_AUTOFORMATTING="yes"
29 DOC_CONTENTS="
30 Local or remote virtualbox hosts must be compiled with
31 'vboxwebsrv' useflag and the respective init script
32 must be running to use this interface:
33 /etc/init.d/vboxwebsrv start
34
35 To enable the automatic startup mode feature uncomment the
36 following line in the config.php file:
37 var \$startStopConfig = true;
38
39 You should also add the /etc/init.d/vboxinit script to the
40 default runlevel on the virtualbox host:
41 \`rc-update add vboxinit default\`
42 If the server is on a remote host, than the script must be
43 copied manually from
44 '${FILESDIR}'/vboxinit-initd to
45 /etc/init.d/vboxinit on the remote host."
46
47 src_install() {
48         webapp_src_preinst
49
50         dodoc CHANGELOG.txt LICENSE.txt README.txt
51         rm -f CHANGELOG.txt LICENSE.txt README.txt
52
53         insinto "${MY_HTDOCSDIR}"
54         doins -r .
55
56         webapp_configfile "${MY_HTDOCSDIR}"/config.php-example
57         webapp_serverowned "${MY_HTDOCSDIR}"/config.php-example
58
59         webapp_src_install
60         if has_version app-emulation/virtualbox[vboxwebsrv] || \
61                 has_version app-emulation/virtualbox-bin[vboxwebsrv]
62         then
63                 newinitd "${FILESDIR}"/vboxinit-initd vboxinit
64         fi
65
66         readme.gentoo_create_doc
67 }
68
69 pkg_postinst() {
70         webapp_pkg_postinst
71         readme.gentoo_print_elog
72 }