[31101] trunk/dports/net/nagios/Portfile
source_changes at macosforge.org
source_changes at macosforge.org
Thu Nov 15 14:34:24 PST 2007
Revision: 31101
http://trac.macosforge.org/projects/macports/changeset/31101
Author: markd at macports.org
Date: 2007-11-15 14:34:23 -0800 (Thu, 15 Nov 2007)
Log Message:
-----------
Closes #13068. Update to 2.10.
Modified Paths:
--------------
trunk/dports/net/nagios/Portfile
Modified: trunk/dports/net/nagios/Portfile
===================================================================
--- trunk/dports/net/nagios/Portfile 2007-11-15 21:34:23 UTC (rev 31100)
+++ trunk/dports/net/nagios/Portfile 2007-11-15 22:34:23 UTC (rev 31101)
@@ -3,7 +3,7 @@
PortSystem 1.0
name nagios
-version 2.9
+version 2.10
categories net
maintainers markd
@@ -20,12 +20,13 @@
homepage http://nagios.org
master_sites sourceforge
-checksums md5 b6e3a21c91edb063c00712c6001e15ec
+checksums md5 8c3a29e138f2ff8c8abbd3dd8a40c4b6
depends_build port:gd2
depends_lib port:openssl \
port:nagios-plugins
+set sysconfdir ${prefix}/etc/${name}
destroot.destdir prefix=${prefix} DESTDIR=${destroot}
destroot.target install install-config install-commandmode install-init
@@ -42,7 +43,7 @@
--datadir=${prefix}/share/nagios \
--with-lockfile=${prefix}/var/nagios/nagios.lock \
--with-init-dir=${prefix}/var/nagios \
- --sysconfdir=${prefix}/etc/nagios \
+ --sysconfdir=${sysconfdir} \
--localstatedir=${prefix}/var/nagios
variant monarch {
@@ -54,7 +55,7 @@
startupitem.start "${prefix}/var/nagios/nagios.init start"
startupitem.stop "${prefix}/var/nagios/nagios.init stop"
-pre-configure {
+post-patch {
reinplace "s|INIT_OPTS=-o root -g root|INIT_OPTS=-o nagios -g nagios|g" \
"${worksrcpath}/Makefile.in"
@@ -64,6 +65,9 @@
reinplace "s|check_external_commands=0|check_external_commands=1|g" \
"${worksrcpath}/sample-config/nagios.cfg.in"
+ reinplace "s|/bin/mail|/usr/bin/mail|g" \
+ "${worksrcpath}/sample-config/template-object/commands.cfg.in"
+
reinplace "s|NagiosLockDir=/var/lock/subsys|NagiosLockDir=${prefix}/var/nagios|g" \
${worksrcpath}/daemon-init.in
reinplace "s|su -|su -m|g" \
@@ -71,13 +75,18 @@
}
pre-build {
+ addgroup nagios
adduser nagios
- addgroup nagios
}
post-destroot {
# Keep the empty command file directory created by 'make install-commandmode'
destroot.keepdirs ${destroot}${prefix}/var/nagios/rw
+
+# Nagios sample files no longer install with -sample suffixes, so do this manually for safety
+ foreach cfgfile [glob ${destroot}${sysconfdir}/*.cfg] {
+ file rename ${cfgfile} ${cfgfile}-sample
+ }
}
post-activate {
@@ -139,7 +148,9 @@
b) Then rename the sample files for use.
- sudo for i in *cfg-sample; do mv \$i `echo \$i | sed -e s/cfg-sample/cfg/`; done;
+ sudo -s
+ for i in *cfg-sample; do mv \$i `echo \$i | sed -e s/cfg-sample/cfg/`; done;
+ exit
c) Configure the default commands.cfg file to your requirements. Then test
the Nagios configuration with this command until you get no errors:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071115/049e7cf6/attachment.html
More information about the macports-changes
mailing list