aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/nagios
diff options
context:
space:
mode:
authorYing-Chieh Liao <ijliao@FreeBSD.org>2001-05-17 06:02:17 +0000
committerYing-Chieh Liao <ijliao@FreeBSD.org>2001-05-17 06:02:17 +0000
commitbd994ab71e3cee1d6da4e8d4f823654afa197186 (patch)
treec7cf7e3f3052582af21a3b9c12c26b027cd01ea8 /net-mgmt/nagios
parentff22c102424cfcac2184b8b24bc21e1778eaf318 (diff)
downloadports-bd994ab71e3cee1d6da4e8d4f823654afa197186.tar.gz
ports-bd994ab71e3cee1d6da4e8d4f823654afa197186.zip
Notes
Diffstat (limited to 'net-mgmt/nagios')
-rw-r--r--net-mgmt/nagios/Makefile8
-rw-r--r--net-mgmt/nagios/distinfo2
-rw-r--r--net-mgmt/nagios/files/patch-aa11
-rw-r--r--net-mgmt/nagios/files/patch-ae10
-rw-r--r--net-mgmt/nagios/files/patch-ai8
-rw-r--r--net-mgmt/nagios/pkg-install68
-rw-r--r--net-mgmt/nagios/pkg-plist3
-rw-r--r--net-mgmt/nagios/scripts/createuser49
8 files changed, 92 insertions, 67 deletions
diff --git a/net-mgmt/nagios/Makefile b/net-mgmt/nagios/Makefile
index dc57265d8145..05a8c851d84d 100644
--- a/net-mgmt/nagios/Makefile
+++ b/net-mgmt/nagios/Makefile
@@ -6,11 +6,11 @@
#
PORTNAME= netsaint
-PORTVERSION= 0.0.7b3
+PORTVERSION= 0.0.7b4
CATEGORIES= net
MASTER_SITES= http://netsaint.sourceforge.net/download/
-MAINTAINER= blaz@amis.net
+MAINTAINER= blaz@si.FreeBSD.org
LIB_DEPENDS= gd.2:${PORTSDIR}/graphics/gd \
gnugetopt.1:${PORTSDIR}/devel/libgnugetopt
@@ -20,7 +20,7 @@ GNU_CONFIGURE= yes
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
CFLAGS="${CFLAGS} -I${LOCALBASE}/include" \
LIBS="-L${LOCALBASE}/lib -lgd -lgnugetopt"
-CONFIGURE_ARGS= --with-command-user=nobody \
+CONFIGURE_ARGS= --with-command-user=netsaint \
--with-command-grp=nogroup \
--with-netsaint-user=netsaint \
--with-netsaint-grp=netsaint \
@@ -36,6 +36,6 @@ pre-fetch:
@${SH} ${SCRIPTDIR}/checkps
pre-install:
- ${PERL} ${SCRIPTDIR}/createuser
+ @PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
.include <bsd.port.mk>
diff --git a/net-mgmt/nagios/distinfo b/net-mgmt/nagios/distinfo
index ebfae039965a..0fc5dd9b73d5 100644
--- a/net-mgmt/nagios/distinfo
+++ b/net-mgmt/nagios/distinfo
@@ -1 +1 @@
-MD5 (netsaint-0.0.7b3.tar.gz) = b21ed67a86266b021037f46c78c5900f
+MD5 (netsaint-0.0.7b4.tar.gz) = d718507bb3a9cb24e6754440acc76b24
diff --git a/net-mgmt/nagios/files/patch-aa b/net-mgmt/nagios/files/patch-aa
index e106d0e255b3..52e4d1752784 100644
--- a/net-mgmt/nagios/files/patch-aa
+++ b/net-mgmt/nagios/files/patch-aa
@@ -1,5 +1,5 @@
---- Makefile.in.orig Thu Mar 1 05:49:19 2001
-+++ Makefile.in Tue Apr 3 10:02:31 2001
+--- Makefile.in.orig Mon Apr 30 17:22:35 2001
++++ Makefile.in Tue May 1 19:58:50 2001
@@ -27,7 +27,7 @@
INSTALL_OPTS=@INSTALL_OPTS@
COMMAND_OPTS=@COMMAND_OPTS@
@@ -9,7 +9,7 @@
CGICFGDIR=$(CGIDIR)
PERLDIR=@PERLDIR@
-@@ -99,16 +99,16 @@
+@@ -99,20 +99,20 @@
install-config:
$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR)
@@ -32,3 +32,8 @@
install-commandmode:
$(INSTALL) -m 775 $(COMMAND_OPTS) -d $(DESTDIR)$(LOGDIR)/rw
+- chmod g+s $(DESTDIR)$(LOGDIR)/rw
++# chmod g+s $(DESTDIR)$(LOGDIR)/rw
+
+ fullinstall: install install-init install-commandmode
+
diff --git a/net-mgmt/nagios/files/patch-ae b/net-mgmt/nagios/files/patch-ae
index 6cbf9e27ebbf..37f2c6d96f62 100644
--- a/net-mgmt/nagios/files/patch-ae
+++ b/net-mgmt/nagios/files/patch-ae
@@ -1,11 +1,11 @@
---- configure.in Fri Apr 7 11:11:34 2000
-+++ configure.in.new Mon Jun 5 16:09:21 2000
+--- configure.in.orig Mon Apr 30 17:22:35 2001
++++ configure.in Tue May 1 19:36:54 2001
@@ -1,7 +1,7 @@
- dnl Process this file with autoconf to produce a configure script.
+ dnl Process this -*-m4-*- file with autoconf to produce a configure script.
AC_INIT(base/netsaint.c)
- AC_CONFIG_HEADER(common/config.h base/netsaint.h cgi/cgiutils.h)
+ AC_CONFIG_HEADER(common/config.h common/snprintf.h base/netsaint.h cgi/cgiutils.h)
-AC_PREFIX_DEFAULT(/usr/local/netsaint)
+AC_PREFIX_DEFAULT(/usr/local)
dnl Figure out how to invoke "install" and what install options to use.
-
+ AC_PROG_INSTALL
diff --git a/net-mgmt/nagios/files/patch-ai b/net-mgmt/nagios/files/patch-ai
index ef3b63b31395..1820da920208 100644
--- a/net-mgmt/nagios/files/patch-ai
+++ b/net-mgmt/nagios/files/patch-ai
@@ -1,5 +1,5 @@
---- daemon-init.in.orig Sun Feb 18 23:33:21 2001
-+++ daemon-init.in Tue Apr 3 20:58:18 2001
+--- daemon-init.in.orig Sat Mar 24 19:58:26 2001
++++ daemon-init.in Tue May 1 19:38:52 2001
@@ -68,12 +68,9 @@
@@ -16,12 +16,12 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
-@@ -101,7 +98,7 @@
+@@ -102,7 +99,7 @@
start)
echo "Starting network monitor: netsaint"
- su $Netsaint -c "touch $NetsaintVar/netsaint.log $NetsaintSav"
+ su -m $Netsaint -c "touch $NetsaintVar/netsaint.log $NetsaintSav"
+ rm -f $NetsaintCmd
$NetsaintBin -d $NetsaintCfg
if [ -d $NetsaintLckDir ]; then touch $NetsaintLckDir/$NetsaintLckFile; fi
- sleep 1
diff --git a/net-mgmt/nagios/pkg-install b/net-mgmt/nagios/pkg-install
new file mode 100644
index 000000000000..52af9cc24d68
--- /dev/null
+++ b/net-mgmt/nagios/pkg-install
@@ -0,0 +1,68 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+PKG_PREFIX=${PKG_PREFIX:=/usr/local}
+
+user=netsaint
+group=netsaint
+
+ask() {
+ local question default answer
+
+ question=$1
+ default=$2
+ if [ -z "${PACKAGE_BUILDING}" ]; then
+ read -p "${question} [${default}]? " answer
+ fi
+ if [ x${answer} = x ]; then
+ answer=${default}
+ fi
+ echo ${answer}
+}
+
+yesno() {
+ local dflt question answer
+
+ question=$1
+ dflt=$2
+ while :; do
+ answer=$(ask "${question}" "${dflt}")
+ case "${answer}" in
+ [Yy]*) return 0;;
+ [Nn]*) return 1;;
+ esac
+ echo "Please answer yes or no."
+ done
+}
+
+if [ x"$2" = xPRE-INSTALL ]; then
+ if /usr/sbin/pw groupshow "${group}" 2>/dev/null; then
+ echo "You already have a group \"${group}\", so I will use it."
+ else
+ echo "You need a group \"${group}\"."
+ if yesno "Would you like me to create it" y; then
+ /usr/sbin/pw groupadd ${group} -h - || exit
+ echo "Done."
+ else
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+
+ if /usr/sbin/pw user show "${user}" 2>/dev/null; then
+ echo "You already have a user \"${user}\", so I will use it."
+ else
+ echo "You need a user \"${user}\"."
+ if yesno "Would you like me to create it" y; then
+ /usr/sbin/pw useradd ${user} -g ${group} -h - -d ${PKG_PREFIX}/var/netsaint \
+ -s /nonexistent -c "Netsaint pseudo-user" || exit
+ echo "Done."
+ else
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+
+fi
diff --git a/net-mgmt/nagios/pkg-plist b/net-mgmt/nagios/pkg-plist
index d71e872be420..fd71eef30b88 100644
--- a/net-mgmt/nagios/pkg-plist
+++ b/net-mgmt/nagios/pkg-plist
@@ -2,7 +2,7 @@
@exec mkdir -p %D/var/netsaint/rw
@exec chmod 775 %D/var/netsaint %D/var/netsaint/archives %D/var/netsaint/rw
@exec chown netsaint:netsaint %D/var/netsaint %D/var/netsaint/archives
-@exec chown nobody:nogroup %D/var/netsaint/rw
+@exec chown netsaint:nogroup %D/var/netsaint/rw
bin/netsaint
etc/netsaint/commands.cfg.dist
etc/netsaint/hosts.cfg.dist
@@ -291,3 +291,4 @@ share/netsaint/stylesheets/trends.css
@unexec rmdir %D/var/netsaint/archives 2>/dev/null || true
@unexec rmdir %D/var/netsaint/rw 2>/dev/null || true
@unexec rmdir %D/var/netsaint 2>/dev/null || true
+@unexec rmdir %D/var 2>/dev/null || true
diff --git a/net-mgmt/nagios/scripts/createuser b/net-mgmt/nagios/scripts/createuser
deleted file mode 100644
index 0ebde3c5496d..000000000000
--- a/net-mgmt/nagios/scripts/createuser
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/perl
-#
-
-eval '(exit $?0)' && eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
-& eval 'exec /usr/bin/perl -S $0 $argv:q'
-if 0;
-
-if( $> ) {
- print "\nYou must be root to run this step!\n\n";
- exit 1;
-}
-
-if( getpwnam( "netsaint" ) ) {
- ( $null, $null, $nsUID ) = getpwnam( "netsaint" );
-} else {
- $nsUID = 70;
- while( getpwuid( $nsUID ) ) {
- $nsUID++;
- }
-}
-
-if( getgrnam( "netsaint" ) ) {
- ( $null, $null, $nsGID ) = getgrnam( "netsaint" );
-} else {
- $nsGID = 70;
- while( getgrgid( $nsGID ) ) {
- $nsGID++;
- }
- &append_file( "/etc/group", "netsaint:*:$nsGID:" );
-}
-
-print "netsaint user using uid $nsUID and gid $nsGID\n";
-
-system( "/usr/bin/chpass -a \"netsaint:*:$nsUID:$nsGID\:\:0:0:Netsaint pseudo-user:/var/netsaint:/sbin/nologin\"" );
-
-sub append_file {
- local($file,@list) = @_;
- local($LOCK_EX) = 2;
- local($LOCK_NB) = 4;
- local($LOCK_UN) = 8;
-
- open(F, ">> $file") || die "$file: $!\n";
- while( ! flock( F, $LOCK_EX | $LOCK_NB ) ) {
- exit 1;
- }
- print F join( "\n", @list) . "\n";
- close F;
- flock( F, $LOCK_UN );
-}