From 86a6a64828ebcf2e0d89a38fae48dcf4256f70e8 Mon Sep 17 00:00:00 2001 From: Marcus Alves Grando Date: Sat, 29 Apr 2006 18:28:31 +0000 Subject: - Update to 2.5.1 - Fix using USE_OPENSSH after bsd.port.pre.mk - portlint(1) PR: 95811 Submitted by: Martin Matuska Approved by: maintainer timeout (14 days) --- net-mgmt/nrpe2/Makefile | 43 +++++++++++---------- net-mgmt/nrpe2/distinfo | 6 +-- net-mgmt/nrpe2/files/patch-pid-file | 76 ------------------------------------- 3 files changed, 27 insertions(+), 98 deletions(-) delete mode 100644 net-mgmt/nrpe2/files/patch-pid-file (limited to 'net-mgmt/nrpe2') diff --git a/net-mgmt/nrpe2/Makefile b/net-mgmt/nrpe2/Makefile index 974ec25cb83c..88b270d3fd1b 100644 --- a/net-mgmt/nrpe2/Makefile +++ b/net-mgmt/nrpe2/Makefile @@ -5,36 +5,35 @@ # $FreeBSD$ # -PORTNAME= nrpe2 -PORTVERSION= 2.0 -PORTREVISION= 1 -CATEGORIES= net-mgmt -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +PORTNAME= nrpe2 +PORTVERSION= 2.5.1 +CATEGORIES= net-mgmt +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= nagios -DISTNAME= nrpe-${PORTVERSION} +DISTNAME= nrpe-${PORTVERSION} -MAINTAINER= paul@nerdlabs.com -COMMENT= Nagios Remote Plugin Executor +MAINTAINER= paul@nerdlabs.com +COMMENT= Nagios Remote Plugin Executor -RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:${PORTSDIR}/net-mgmt/nagios-plugins +RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:${PORTSDIR}/net-mgmt/nagios-plugins -GNU_CONFIGURE= yes +GNU_CONFIGURE= yes USE_PERL5_BUILD= yes -USE_REINPLACE= yes -USE_RC_SUBR= nrpe2.sh +USE_RC_SUBR= nrpe2.sh -PLIST_FILES= sbin/nrpe2 etc/nrpe.cfg-sample libexec/nagios/check_nrpe2 +PLIST_FILES= sbin/nrpe2 etc/nrpe.cfg-sample libexec/nagios/check_nrpe2 -CONFIGURE_ARGS+= --libexecdir=${PREFIX}/libexec/nagios --bindir=${PREFIX}/sbin --sysconfdir=${PREFIX}/etc +CONFIGURE_ARGS= --libexecdir=${PREFIX}/libexec/nagios \ + --bindir=${PREFIX}/sbin --sysconfdir=${PREFIX}/etc -OPTIONS= SSL "SSL support" off \ - ARGS "Enable command arguments *POTENTIAL SECURITY RISK*" off +OPTIONS= SSL "SSL support" off \ + ARGS "Enable command arguments *POTENTIAL SECURITY RISK*" off .include .if defined(WITH_SSL) -USE_OPENSSL= yes +.include "${PORTSDIR}/Mk/bsd.openssl.mk" CONFIGURE_ARGS+= --enable-ssl .else CONFIGURE_ARGS+= --disable-ssl @@ -44,9 +43,15 @@ CONFIGURE_ARGS+= --disable-ssl CONFIGURE_ARGS+= --enable-command-args .endif +post-build: + @${REINPLACE_CMD} -e 's|nrpe.pid|nrpe2.pid|g' \ + ${WRKSRC}/sample-config/nrpe.cfg + do-install: ${INSTALL_PROGRAM} ${WRKSRC}/src/nrpe ${PREFIX}/sbin/nrpe2 - ${INSTALL_PROGRAM} ${WRKSRC}/src/check_nrpe ${PREFIX}/libexec/nagios/check_nrpe2 - ${INSTALL_DATA} ${WRKSRC}/nrpe.cfg ${PREFIX}/etc/nrpe.cfg-sample + ${INSTALL_PROGRAM} ${WRKSRC}/src/check_nrpe \ + ${PREFIX}/libexec/nagios/check_nrpe2 + ${INSTALL_DATA} ${WRKSRC}/sample-config/nrpe.cfg \ + ${PREFIX}/etc/nrpe.cfg-sample .include diff --git a/net-mgmt/nrpe2/distinfo b/net-mgmt/nrpe2/distinfo index 40d71997f398..b0d154023cb4 100644 --- a/net-mgmt/nrpe2/distinfo +++ b/net-mgmt/nrpe2/distinfo @@ -1,3 +1,3 @@ -MD5 (nrpe-2.0.tar.gz) = 70ef9502a3b7e49fa520dbceabfa04d0 -SHA256 (nrpe-2.0.tar.gz) = 37402fc845c3bba69720cb3fd1598b4589e24600dced1bfaeceeb51ab801f2de -SIZE (nrpe-2.0.tar.gz) = 52157 +MD5 (nrpe-2.5.1.tar.gz) = e083553deaf47a79fd23906d823afc59 +SHA256 (nrpe-2.5.1.tar.gz) = a23a0a37d81900d03884898bd0ae9b9da95348cc4a08695a4c229337c83fbe5e +SIZE (nrpe-2.5.1.tar.gz) = 100382 diff --git a/net-mgmt/nrpe2/files/patch-pid-file b/net-mgmt/nrpe2/files/patch-pid-file deleted file mode 100644 index 07173a557376..000000000000 --- a/net-mgmt/nrpe2/files/patch-pid-file +++ /dev/null @@ -1,76 +0,0 @@ ---- orig/nrpe-2.0/src/Makefile.in Tue Aug 5 07:01:53 2003 -+++ src/Makefile.in Tue May 17 00:25:33 2005 -@@ -9,7 +9,7 @@ - SRC_COMMON=../common - - CC=@CC@ --CFLAGS=@CFLAGS@ @DEFS@ -+CFLAGS=@CFLAGS@ @DEFS@ -DPID_DIR=\"/var/run/\" - LDFLAGS=@LDFLAGS@ @LIBS@ - SOCKETLIBS=@SOCKETLIBS@ - ---- orig/nrpe-2.0/src/nrpe.c Tue Sep 9 04:52:37 2003 -+++ src/nrpe.c Tue May 17 00:24:29 2005 -@@ -23,6 +23,7 @@ - #include "nrpe.h" - #include "utils.h" - -+ - #ifdef HAVE_SSL - #include "dh.h" - #endif -@@ -83,7 +84,6 @@ - #endif - - -- - int main(int argc, char **argv){ - int result=OK; - int x; -@@ -219,7 +219,45 @@ - - /* else daemonize and start listening for requests... */ - else if(fork()==0){ -- -+#ifdef PID_DIR -+ int fd; -+ int pid_written = 0; -+ char *pid_fname; -+ char pbuf[16]; -+ char *bname = strrchr(argv[0], '/'); /* basename from XPG4.2 would be nice */ -+ -+ bname = !bname ? argv[0] : ++bname; -+ pid_fname = malloc(strlen(PID_DIR) + strlen(bname) + sizeof(".pid")); -+ strcpy(pid_fname, PID_DIR); -+ strcat(pid_fname, bname); strcat(pid_fname, ".pid"); -+ if ((fd = open (pid_fname, O_RDONLY)) >= 0) { -+ int status = read (fd, pbuf, (sizeof pbuf) - 1); -+ close (fd); -+ if (status > 0) { -+ int pid; -+ pbuf [status] = 0; -+ pid = atoi (pbuf); -+ /* If the previous server process is not still running, -+ write a new pid file immediately. */ -+ if (pid && (pid == getpid() || kill (pid, 0) < 0)) { -+ unlink (pid_fname); -+ } else { -+ syslog(LOG_ERR,"There's already a nrpe server running."); -+ free(pid_fname); -+ return STATE_CRITICAL; -+ } -+ } -+ } -+ if ((fd = open (pid_fname, O_WRONLY | O_CREAT, 0644)) >= 0) { -+ sprintf (pbuf, "%d\n", (int)getpid ()); -+ write (fd, pbuf, strlen (pbuf)); -+ close (fd); -+ } else { -+ syslog(LOG_ERR,"Can not write the pidfile(%s).", pid_fname); -+ } -+ free(pid_fname); -+#endif -+ - /* we're a daemon - set up a new process group */ - setsid(); - -- cgit v1.2.3