2013-05-10 11:28:32 +00:00
|
|
|
# Created by: rea-fbsd@codelabs.ru
|
2008-08-17 06:49:35 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PORTNAME= pnp
|
2012-08-13 19:56:30 +00:00
|
|
|
PORTVERSION= 0.6.18
|
2008-08-17 06:49:35 +00:00
|
|
|
CATEGORIES= net-mgmt
|
2010-11-23 22:10:20 +00:00
|
|
|
MASTER_SITES= SF
|
|
|
|
MASTER_SITE_SUBDIR=pnp4nagios/PNP-0.6
|
|
|
|
DISTNAME= pnp4nagios-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX}
|
2008-08-17 06:49:35 +00:00
|
|
|
|
2013-09-29 09:00:04 +00:00
|
|
|
MAINTAINER?= rea@FreeBSD.org
|
|
|
|
COMMENT?= Nagios performance data collector and grapher
|
2008-08-17 06:49:35 +00:00
|
|
|
|
2012-08-13 19:56:30 +00:00
|
|
|
LICENSE= GPLv2
|
|
|
|
|
2008-08-18 00:10:38 +00:00
|
|
|
BUILD_DEPENDS= ${LOCALBASE}/bin/rrdtool:${PORTSDIR}/databases/rrdtool
|
2013-09-29 09:00:04 +00:00
|
|
|
RUN_DEPENDS?= ${LOCALBASE}/bin/rrdtool:${PORTSDIR}/databases/rrdtool \
|
2008-08-17 06:49:35 +00:00
|
|
|
nagios:${PORTSDIR}/net-mgmt/nagios
|
|
|
|
|
2010-12-10 19:21:01 +00:00
|
|
|
MAKE_JOBS_UNSAFE= yes
|
2013-09-14 16:38:28 +00:00
|
|
|
USES= perl5
|
2010-12-10 19:21:01 +00:00
|
|
|
|
2013-05-10 11:28:32 +00:00
|
|
|
OPTIONS_DEFINE= PDF
|
|
|
|
OPTIONS_DEFAULT= PDF
|
|
|
|
PDF_DESC= Use built-in fpdf library to produce PDF views
|
2008-08-17 06:49:35 +00:00
|
|
|
|
2013-09-20 22:24:43 +00:00
|
|
|
NO_STAGE= yes
|
2010-07-23 20:59:08 +00:00
|
|
|
.include <bsd.port.options.mk>
|
|
|
|
|
2010-12-30 17:25:47 +00:00
|
|
|
USE_PHP= gd iconv json pcre simplexml sockets xml zlib
|
2010-12-28 19:01:10 +00:00
|
|
|
|
2008-08-17 06:49:35 +00:00
|
|
|
WANT_PHP_WEB= yes
|
2012-08-05 23:19:36 +00:00
|
|
|
USE_RC_SUBR= npcd
|
2010-11-23 22:10:20 +00:00
|
|
|
MAN8= npcd.8
|
|
|
|
USE_DOS2UNIX= yes
|
|
|
|
DOS2UNIX_REGEX= '.*\.\(php\|js\|txt\)$$'
|
2008-08-17 06:49:35 +00:00
|
|
|
|
|
|
|
NAGIOSDIR?= /var/spool/nagios
|
|
|
|
NAGIOSHTMURL?= /nagios
|
|
|
|
NAGIOSUSER?= nagios
|
|
|
|
NAGIOSGROUP?= nagios
|
|
|
|
PNP_STATE= ${NAGIOSDIR}/pnp
|
|
|
|
PNP_RRDS= ${PNP_STATE}/rrd
|
|
|
|
PNP_SPOOL= ${PNP_STATE}/perfspool
|
2010-12-28 19:01:10 +00:00
|
|
|
PNP_URL?= ${NAGIOSHTMURL}/pnp
|
2008-08-17 06:49:35 +00:00
|
|
|
FPDF_DIR?= share/fpdf
|
2010-11-23 22:10:20 +00:00
|
|
|
SPOOL_DIRS= ${PNP_STATE}:${NAGIOSUSER}:${NAGIOSGROUP}:0750%${PNP_RRDS}:${NAGIOSUSER}:${NAGIOSGROUP}:0750%${PNP_SPOOL}:${NAGIOSUSER}:${NAGIOSGROUP}:0750
|
2008-08-17 06:49:35 +00:00
|
|
|
|
2013-05-10 11:28:32 +00:00
|
|
|
.if ! ${PORT_OPTIONS:MPDF}
|
2010-11-23 22:10:20 +00:00
|
|
|
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-disable-pdf
|
2008-08-17 06:49:35 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
GNU_CONFIGURE= yes
|
|
|
|
CONFIGURE_ARGS+= \
|
2010-12-28 19:01:10 +00:00
|
|
|
--sysconfdir=${ETCDIR} \
|
2008-12-25 00:32:12 +00:00
|
|
|
--datarootdir=${WWWDIR} \
|
2008-08-17 06:49:35 +00:00
|
|
|
--datadir=${WWWDIR} \
|
|
|
|
--localstatedir=/var/log \
|
|
|
|
--with-rrdtool=${LOCALBASE}/bin/rrdtool \
|
|
|
|
--with-perfdata-dir=${PNP_RRDS} \
|
|
|
|
--with-perfdata-spool-dir=${PNP_SPOOL} \
|
|
|
|
--with-nagios-user=${NAGIOSUSER} \
|
|
|
|
--with-nagios-group=${NAGIOSGROUP}
|
|
|
|
# Get rid of INSTALL_OPTS that are set by configure --
|
|
|
|
# we want the things to be installed with root:wheel and
|
|
|
|
# NAGIOSUSER:NAGIOSGROUP are going to the configuration files.
|
|
|
|
MAKE_ARGS= INSTALL_OPTS=
|
|
|
|
INSTALL_TARGET= install install-config
|
|
|
|
|
|
|
|
SUB_FILES= pkg-install \
|
|
|
|
pkg-deinstall \
|
|
|
|
pkg-message
|
2010-11-23 22:10:20 +00:00
|
|
|
SUB_LIST= SPOOL_DIRS=${SPOOL_DIRS} \
|
2008-08-17 06:49:35 +00:00
|
|
|
PNP_RRDS=${PNP_RRDS} \
|
2010-12-28 19:01:10 +00:00
|
|
|
PNP_URL=${PNP_URL} \
|
2008-08-17 06:49:35 +00:00
|
|
|
NAGIOSUSER=${NAGIOSUSER} \
|
|
|
|
NAGIOSGROUP=${NAGIOSGROUP}
|
|
|
|
|
2013-05-10 11:28:32 +00:00
|
|
|
.if ${PORT_OPTIONS:MPDF}
|
2008-08-17 06:49:35 +00:00
|
|
|
PNP_USE_FPDF= 1
|
|
|
|
.else
|
|
|
|
PNP_USE_FPDF= 0
|
|
|
|
.endif
|
|
|
|
post-patch:
|
|
|
|
@${REINPLACE_CMD} \
|
|
|
|
-e's|^\$$conf\['\''use_fpdf'\''\] = [[:digit:]];|$$conf['\''use_fpdf'\''] = ${PNP_USE_FPDF};|' \
|
|
|
|
-e's|^\$$conf\['\''nagios_base'\''\] = "/nagios/cgi-bin";|$$conf\['\''nagios_base'\''\] = "${NAGIOSHTMURL}/cgi-bin";|' \
|
2010-12-28 19:01:10 +00:00
|
|
|
-e's|/usr/local/check_mk/|/usr/local/share/check_mk/|g' \
|
|
|
|
-e's|/usr/local/nagios/var/rw/live|/${NAGIOSDIR}/rw/live|' \
|
2008-08-17 06:49:35 +00:00
|
|
|
"${WRKSRC}/sample-config/pnp/config.php.in"
|
2010-11-23 22:10:20 +00:00
|
|
|
|
|
|
|
pre-install:
|
|
|
|
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
|
2008-08-17 06:49:35 +00:00
|
|
|
|
|
|
|
post-install:
|
2010-11-23 22:10:20 +00:00
|
|
|
.for m in ${MAN8}
|
2010-12-28 19:01:10 +00:00
|
|
|
${INSTALL_MAN} ${WRKSRC}/man/${m} ${MAN8PREFIX}/man/man8/${m}
|
2008-08-18 15:42:50 +00:00
|
|
|
.endfor
|
2008-08-17 06:49:35 +00:00
|
|
|
@${CAT} ${PKGMESSAGE}
|
|
|
|
|
|
|
|
.include <bsd.port.mk>
|