aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net-mgmt/nsca/Makefile31
-rw-r--r--net-mgmt/nsca/distinfo6
-rw-r--r--net-mgmt/nsca/files/nsca.sh.in29
-rw-r--r--net-mgmt/nsca/pkg-descr2
-rw-r--r--net-mgmt/nsca/pkg-plist10
5 files changed, 60 insertions, 18 deletions
diff --git a/net-mgmt/nsca/Makefile b/net-mgmt/nsca/Makefile
index 54cd3d15ae64..e4a59e02873a 100644
--- a/net-mgmt/nsca/Makefile
+++ b/net-mgmt/nsca/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= nsca
-PORTVERSION= 2.4
+PORTVERSION= 2.6
CATEGORIES= net-mgmt
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= nagios
@@ -14,24 +14,39 @@ MASTER_SITE_SUBDIR= nagios
MAINTAINER= ports@FreeBSD.org
COMMENT= Nagios Service Check Acceptor
+.if !defined(WITHOUT_SERVER)
RUN_DEPENDS= nagios:${PORTSDIR}/net-mgmt/nagios
+.endif
LIB_DEPENDS= mcrypt.8:${PORTSDIR}/security/libmcrypt
GNU_CONFIGURE= yes
USE_PERL5= yes
CONFIGURE_ARGS= --prefix=${PREFIX} --localstatedir=/var/spool/nagios
-NAGIOS_DIR= ${LOCALBASE}/libexec/nagios
-CONF_DIR= ${LOCALBASE}/etc/nagios
+.if !defined(WITHOUT_SERVER)
+USE_RC_SUBR= nsca.sh
+PLIST_SUB+= SERVER=""
+.else
+PLIST_SUB+= SERVER="@comment "
+.endif
+
+.if !defined(WITHOUT_CLIENT)
+PLIST_SUB+= CLIENT=""
+.else
+PLIST_SUB+= CLIENT="@comment "
+.endif
DOCS= Changelog LEGAL README SECURITY
-# NOTE: this port installs into ${LOCALBASE} instead of ${PREFIX}
do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/src/nsca ${NAGIOS_DIR}
- ${INSTALL_PROGRAM} ${WRKSRC}/src/send_nsca ${NAGIOS_DIR}
- ${INSTALL_DATA} ${WRKSRC}/nsca.cfg ${CONF_DIR}/nsca.cfg.sample
- ${INSTALL_DATA} ${WRKSRC}/send_nsca.cfg ${CONF_DIR}/send_nsca.cfg.sample
+.if !defined(WITHOUT_CLIENT)
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/send_nsca ${PREFIX}/sbin/send_nsca
+ ${INSTALL_DATA} ${WRKSRC}/sample-config/send_nsca.cfg ${PREFIX}/etc/send_nsca.cfg-sample
+.endif
+.if !defined(WITHOUT_SERVER)
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/nsca ${PREFIX}/sbin/nsca
+ ${INSTALL_DATA} ${WRKSRC}/sample-config/nsca.cfg ${PREFIX}/etc/nsca.cfg-sample
+.endif
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
diff --git a/net-mgmt/nsca/distinfo b/net-mgmt/nsca/distinfo
index 147964806524..1b614059eec0 100644
--- a/net-mgmt/nsca/distinfo
+++ b/net-mgmt/nsca/distinfo
@@ -1,3 +1,3 @@
-MD5 (nsca-2.4.tar.gz) = ab58553a87940f574ec54189a43a70bc
-SHA256 (nsca-2.4.tar.gz) = bba0d2c3582086c8d77ef2c7921b571d1a657eedee3bed8af4f59b3fdb3f8866
-SIZE (nsca-2.4.tar.gz) = 54788
+MD5 (nsca-2.6.tar.gz) = d526a3ac3c29648c729c5fb4fb332488
+SHA256 (nsca-2.6.tar.gz) = 6b12781537e5301bf2c902e9fa9961cb95f624856f3d89d72416d3cca734e05a
+SIZE (nsca-2.6.tar.gz) = 101341
diff --git a/net-mgmt/nsca/files/nsca.sh.in b/net-mgmt/nsca/files/nsca.sh.in
new file mode 100644
index 000000000000..ed2776560832
--- /dev/null
+++ b/net-mgmt/nsca/files/nsca.sh.in
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# Add the following lines to /etc/rc.conf to enable nsca:
+# nsca_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable nsca.
+# nsca_flags (str): Set to "--single" by default.
+# nsca_configfile (str): Set to "%%PREFIX%%/etc/nagios/nsca.cfg" by default.
+#
+
+. %%RC_SUBR%%
+
+name="nsca"
+rcvar=`set_rcvar`
+
+command="%%PREFIX%%/libexec/nagios/nsca"
+pidfile="/var/spool/nagios/nsca.lock"
+nsca_user="nagios"
+extra_commands="restart"
+
+nsca_enable=${nsca_enable:-"NO"}
+nsca_flags=${nsca_flags:-"--single"}
+nsca_configfile=${nsca_configfile:-"%%PREFIX%%/etc/nagios/nsca.cfg"}
+
+load_rc_config "${name}"
+
+required_files="${nsca_configfile}"
+command_args="-c ${nsca_configfile} ${nsca_flags}"
+
+run_rc_command "$1"
diff --git a/net-mgmt/nsca/pkg-descr b/net-mgmt/nsca/pkg-descr
index bb5b01afa3a4..998e2b444eb5 100644
--- a/net-mgmt/nsca/pkg-descr
+++ b/net-mgmt/nsca/pkg-descr
@@ -1,7 +1,7 @@
The Nagios Service Check Acceptor (NSCA) is used to send service check
results to a central Nagios server. This consists of the "nsca" daemon
which runs on the main Nagios server and accepts results and the
-"check_nsca" plugin which is used to send results to the server.
+"send_nsca" client which is used to send results to the server.
Author: Ethan Galstad
WWW: http://www.nagios.org/
diff --git a/net-mgmt/nsca/pkg-plist b/net-mgmt/nsca/pkg-plist
index a74df080477d..223502ee3e07 100644
--- a/net-mgmt/nsca/pkg-plist
+++ b/net-mgmt/nsca/pkg-plist
@@ -4,9 +4,7 @@
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%DOCSDIR%%/SECURITY
%%PORTDOCS%%@dirrm %%DOCSDIR%%
-@comment This port installs into LOCALBASE as opposed to PREFIX
-@cwd %%LOCALBASE%%
-etc/nagios/nsca.cfg.sample
-etc/nagios/send_nsca.cfg.sample
-libexec/nagios/nsca
-libexec/nagios/send_nsca
+%%SERVER%%etc/nsca.cfg-sample
+%%SERVER%%sbin/nsca
+%%CLIENT%%etc/send_nsca.cfg-sample
+%%CLIENT%%sbin/send_nsca