aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/nrpe
diff options
context:
space:
mode:
authoredwin <edwin@FreeBSD.org>2005-05-21 19:50:44 +0800
committeredwin <edwin@FreeBSD.org>2005-05-21 19:50:44 +0800
commit028b4a2de2d2f498f60a23d1b281f68bac11a662 (patch)
tree4cd56d4b87e3a90a9c5b2764a9ad92b8d88dbe32 /net-mgmt/nrpe
parent1144336c8ca57f6aa2b98e0b0c21d5b78a16a197 (diff)
downloadfreebsd-ports-gnome-028b4a2de2d2f498f60a23d1b281f68bac11a662.tar.gz
freebsd-ports-gnome-028b4a2de2d2f498f60a23d1b281f68bac11a662.tar.zst
freebsd-ports-gnome-028b4a2de2d2f498f60a23d1b281f68bac11a662.zip
[patch] support of rc_subr for net-mgmt/nrpe
This patch will add rc_subr support for net-mgmt/nrpe PR: based on: ports/73632 Submitted by: Edwin Groothuis <edwin@mavetju.org>
Diffstat (limited to 'net-mgmt/nrpe')
-rw-r--r--net-mgmt/nrpe/Makefile19
-rw-r--r--net-mgmt/nrpe/files/nrpe.sh.in27
-rw-r--r--net-mgmt/nrpe/files/pkg-message.in5
-rw-r--r--net-mgmt/nrpe/pkg-plist2
4 files changed, 47 insertions, 6 deletions
diff --git a/net-mgmt/nrpe/Makefile b/net-mgmt/nrpe/Makefile
index 8538df43176a..b11759f05c52 100644
--- a/net-mgmt/nrpe/Makefile
+++ b/net-mgmt/nrpe/Makefile
@@ -7,7 +7,7 @@
PORTNAME= nrpe
PORTVERSION= 1.9
-PORTREVISION= 0
+PORTREVISION= 1
CATEGORIES= net-mgmt
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= nagios
@@ -19,14 +19,23 @@ RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:${PORTSDIR}/net-mgmt/nagio
GNU_CONFIGURE= yes
USE_PERL5= yes
+USE_REINPLACE= yes
+USE_RC_SUBR= yes
+SUB_FILES= nrpe.sh pkg-message
+PKGMESSAGE= ${WRKDIR}/pkg-message
-CONFIGURE_ARGS= --libexecdir=${PREFIX}/libexec/nagios --sysconfdir=${PREFIX}/etc \
- --sbindir=${PREFIX}/sbin --bindir=${PREFIX}/sbin
+CONFIGURE_ARGS= \
+ --libexecdir=${PREFIX}/libexec/nagios --sysconfdir=${PREFIX}/etc \
+ --sbindir=${PREFIX}/sbin --bindir=${PREFIX}/sbin
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/src/nrpe ${PREFIX}/sbin/nrpe
- ${INSTALL_PROGRAM} ${WRKSRC}/src/check_nrpe ${PREFIX}/libexec/nagios/check_nrpe
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/check_nrpe \
+ ${PREFIX}/libexec/nagios/check_nrpe
${INSTALL_DATA} ${WRKSRC}/nrpe.cfg ${PREFIX}/etc/nrpe.cfg-sample
- ${INSTALL_SCRIPT} ${WRKSRC}/init-script.freebsd ${PREFIX}/etc/rc.d/nrpe.sh
+ ${INSTALL_SCRIPT} ${WRKDIR}/nrpe.sh ${PREFIX}/etc/rc.d
+
+post-install:
+ ${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>
diff --git a/net-mgmt/nrpe/files/nrpe.sh.in b/net-mgmt/nrpe/files/nrpe.sh.in
new file mode 100644
index 000000000000..4cf845b560fc
--- /dev/null
+++ b/net-mgmt/nrpe/files/nrpe.sh.in
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+#
+# Add the following lines to /etc/rc.conf to enable apache2:
+# nrpe_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable nrpe
+# nrpe_config (string): Set to "/usr/local/etc/nrpe.cfg" by default.
+#
+
+. %%RC_SUBR%%
+
+name="nrpe"
+rcvar=`set_rcvar`
+
+command="%%PREFIX%%/bin/nrpe"
+
+[ -z "$nrpe_enable" ] && nrpe_enable="NO"
+[ -z "$nrpe_config" ] && nrpe_config="%%PREFIX%%/etc/nrpe.cfg"
+
+nrpe_flags="-d ${nrpe_config}"
+
+load_rc_config $name
+
+run_rc_command "$1"
diff --git a/net-mgmt/nrpe/files/pkg-message.in b/net-mgmt/nrpe/files/pkg-message.in
new file mode 100644
index 000000000000..b9fec1fc5d5b
--- /dev/null
+++ b/net-mgmt/nrpe/files/pkg-message.in
@@ -0,0 +1,5 @@
+*************************************************************************
+Available variables you add/set to /etc/rc.conf:
+- nrpe_enable (bool): Set to "NO" by default
+- nrpe_config (string): Set to %%PREFIX%%/etc/nrpe.cfg by default
+*************************************************************************
diff --git a/net-mgmt/nrpe/pkg-plist b/net-mgmt/nrpe/pkg-plist
index fb4d15e163fc..5dedbaed2f4c 100644
--- a/net-mgmt/nrpe/pkg-plist
+++ b/net-mgmt/nrpe/pkg-plist
@@ -1,4 +1,4 @@
sbin/nrpe
etc/nrpe.cfg-sample
-etc/rc.d/nrpe.sh
libexec/nagios/check_nrpe
+etc/rc.d/nrpe.sh