--- ganglia-3.0.6.ebuild 2008-01-05 12:36:33.000000000 +0100 +++ ganglia-3.0.6.ebuild 2008-03-04 19:56:22.000000000 +0100 @@ -2,18 +2,32 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-cluster/ganglia/ganglia-3.0.6.ebuild,v 1.2 2008/01/05 11:34:10 maekke Exp $ +WEBAPP_OPTIONAL="yes" +inherit webapp depend.php + DESCRIPTION="Ganglia is a scalable distributed monitoring system for high-performance computing systems such as clusters and grids" HOMEPAGE="http://ganglia.sourceforge.net/" SRC_URI="mirror://sourceforge/ganglia/${P}.tar.gz" LICENSE="BSD" +WEBAPP_MANUAL_SLOT="yes" SLOT="0" KEYWORDS="~amd64 ~ppc x86" -IUSE="test minimal" +IUSE="test minimal vhosts" -DEPEND="!minimal? ( net-analyzer/rrdtool ) +RDEPEND="!minimal? ( net-analyzer/rrdtool + ${WEBAPP_DEPEND} + virtual/httpd-cgi + virtual/php-httpd )" +DEPEND="${RDEPEND} test? ( >=dev-libs/check-0.8.2 )" -RDEPEND="!minimal? ( net-analyzer/rrdtool )" + +pkg_setup() { + if ! use minimal ; then + require_gd + webapp_pkg_setup + fi +} src_compile() { econf \ @@ -38,8 +52,13 @@ keepdir /var/lib/ganglia/rrds fowners nobody:nobody /var/lib/ganglia/rrds newinitd "${FILESDIR}"/gmetad.rc gmetad - insinto /usr/share/${PN}/ - doins -r web + + webapp_src_preinst + insinto "${MY_HTDOCSDIR}" + doins -r web/* + + webapp_configfile "${MY_HTDOCSDIR}"/conf.php + webapp_src_install fi } @@ -50,9 +69,9 @@ elog " /usr/sbin/gmond -t > /etc/gmond.conf" elog "and customize it from there or provide your own." - if ! use minimal; then - elog - elog "All the files necessary for the PHP frontend have been installed" - elog "into ${ROOT}usr/share/${PN}/web/." - fi + use minimal || webapp_pkg_postinst +} + +pkg_prerm() { + use minimal || webapp_pkg_prerm }