# $NetBSD: Makefile,v 1.2 2015/04/03 17:39:25 outpaddling Exp $

###########################################################
#               Generated by fbsd2pkg                     #
###########################################################

###########################################################
# Unconverted and partially converted FreeBSD port syntax:

## Note: /var/lib/ganglia-web must be owned by www.  Add the following to
## the top of pkg-plist:
##
## @owner %%WWWOWN%%
## @group %%WWWGRP%%
#USE_PHP=	gd pcre xml ctype session filter
#WANT_PHP_MOD=	yes
#PLIST_SUB+=	WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}

DISTNAME=	ganglia-web-${PORTVERSION}
CATEGORIES=	sysutils
MASTER_SITES=	http://downloads.sourceforge.net/project/ganglia/ganglia-web/${PORTVERSION}/

MAINTAINER=	bacon4000@gmail.com

COMMENT=	Ganglia network monitor web interface
#LICENSE=	BSD3CLAUSE

# Pessimistic assumption.  Test and change if possible.
MAKE_JOBS_SAFE=	no

# Are pcre, xml, etc. included with the base php5?
DEPENDS+=	${APACHE_PKG_PREFIX}-${PHP_PKG_PREFIX}>=4.1:../../www/ap-php
DEPENDS+=	ganglia-monitor-core>=3.1.2:../../parallel/ganglia-monitor-core
DEPENDS+=	${PHP_PKG_PREFIX}-gd>=5.4.0:../../graphics/php-gd

# Just assuming C and C++: Adjust this!
USE_LANGUAGES=	c c++

# Adapt REINPLACE commands to SUBST:
SUBST_CLASSES+=		makefile
SUBST_STAGE.makefile=	post-patch
SUBST_FILES.makefile=	${WRKSRC}/Makefile
SUBST_SED.makefile= \
		-e 's|/usr/share/ganglia-webfrontend|${PREFIX}/${WEBDIR}|g' \
		-e 's|/etc|${PREFIX}/etc|g' \
		-e 's|www-data|${APACHE_USER}|g' \
		-e 's|/var/lib/ganglia|${PREFIX}/var/lib/ganglia|g'

SUBST_CLASSES+=		conf_php
SUBST_STAGE.conf_php=	post-patch
SUBST_FILES.conf_php=	${WRKSRC}/conf_default.php
SUBST_SED.conf_php= \
		-e 's|/usr/bin/rrdtool|${PREFIX}/bin/rrdtool|g'

#		-e 's|/var/lib/ganglia|/var/db/ganglia|g'

WEBDIR=		share/httpd/htdocs/ganglia
PORTVERSION=	3.6.2
DATADIR=	${PREFIX}/share/ganglia-web
DOCSDIR=	${PREFIX}/share/doc/ganglia-web

# Make sure files are owned by ${WWW_USER}:${WWW_GROUP}

# Sets OPSYS, OS_VERSION, MACHINE_ARCH, etc..
.include "../../mk/bsd.prefs.mk"

# Keep this if there are user-selectable options.
#.include "options.mk"

# You may need this, especially if using do-install.
#AUTO_MKDIRS=	yes

# Add any _DEPENDS that have a buildlink3.mk
#.include "../..///buildlink3.mk"

# Linux and Mac users will probably want to use apache from the native
# package managers.
.include "../../mk/apache.mk"
.include "../../lang/php/phpversion.mk"
.include "../../mk/bsd.pkg.mk"
