From 028b4a2de2d2f498f60a23d1b281f68bac11a662 Mon Sep 17 00:00:00 2001 From: edwin Date: Sat, 21 May 2005 11:50:44 +0000 Subject: [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 --- net-mgmt/nrpe/Makefile | 19 ++++++++++++++----- net-mgmt/nrpe/files/nrpe.sh.in | 27 +++++++++++++++++++++++++++ net-mgmt/nrpe/files/pkg-message.in | 5 +++++ net-mgmt/nrpe/pkg-plist | 2 +- 4 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 net-mgmt/nrpe/files/nrpe.sh.in create mode 100644 net-mgmt/nrpe/files/pkg-message.in (limited to 'net-mgmt/nrpe') diff --git a/net-mgmt/nrpe/Makefile b/net-mgmt/nrpe/Makefile index 8538df4..b11759f 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 diff --git a/net-mgmt/nrpe/files/nrpe.sh.in b/net-mgmt/nrpe/files/nrpe.sh.in new file mode 100644 index 0000000..4cf845b --- /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 0000000..b9fec1f --- /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 fb4d15e..5dedbae 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 -- cgit v1.1