[47876] trunk/dports/net

raimue at macports.org raimue at macports.org
Mon Mar 9 01:59:27 PDT 2009


Revision: 47876
          http://trac.macports.org/changeset/47876
Author:   raimue at macports.org
Date:     2009-03-09 01:59:26 -0700 (Mon, 09 Mar 2009)
Log Message:
-----------
net/munin:
New port, closes #18771

Added Paths:
-----------
    trunk/dports/net/munin/
    trunk/dports/net/munin/Portfile
    trunk/dports/net/munin/files/
    trunk/dports/net/munin/files/org.macports.munin-cron.plist.in
    trunk/dports/net/munin/files/patch-Makefile.config
    trunk/dports/net/munin/files/patch-munin-node.conf.in

Added: trunk/dports/net/munin/Portfile
===================================================================
--- trunk/dports/net/munin/Portfile	                        (rev 0)
+++ trunk/dports/net/munin/Portfile	2009-03-09 08:59:26 UTC (rev 47876)
@@ -0,0 +1,110 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem          1.0
+
+name                munin
+version             1.2.6
+categories          net
+maintainers         gmail.com:adambyrtek
+platforms           darwin
+description         Extensible system monitoring tool
+
+long_description    Munin the monitoring tool surveys all your computers \
+                    and remembers what it saw. It presents all the \
+                    information in graphs through a web interface. Its \
+                    emphasis is on plug and play capabilities. Using Munin \
+                    you can easily monitor the performance of your \
+                    computers, networks, SANs, applications, weather \
+                    measurements and whatever comes to mind. \
+                    \
+                    Note: By default only Munin node is installed. To \
+                    install the Munin server that gathers data from \
+                    existing nodes and generates graphs please enable the \
+                    server variant.
+
+homepage            http://munin.projects.linpro.no/
+master_sites        sourceforge
+distname            ${name}_${version}
+worksrcdir          ${name}-${version}
+checksums           md5     45f84d58f80642ce914f147232f0d396 \
+                    sha1    bdc6d1767df1ea618071d76f0c4525dda2ea33d9 \
+                    rmd160  1fe38f8da3b2c88b38d56eb86f7b584c7fded962
+depends_lib         port:perl5 port:p5-net-server
+
+use_configure       no
+patchfiles          patch-Makefile.config patch-munin-node.conf.in
+build.target        build
+build.args          PREFIX=${prefix} \
+                    CONFDIR=${prefix}/etc/munin \
+                    DBDIR=${prefix}/var/munin \
+                    LOGDIR=${prefix}/var/log/munin \
+                    STATEDIR=${prefix}/var/run/munin \
+                    MANDIR=${prefix}/share/man \
+                    DOCDIR=${prefix}/share/doc/munin \
+                    LIBDIR=${prefix}/lib/munin \
+                    HTMLDIR=${prefix}/www/munin \
+                    CGIDIR=${prefix}/www/cgi-bin \
+                    PERL=${prefix}/bin/perl
+destroot.args       PREFIX=${destroot}${prefix} \
+                    CONFDIR=${destroot}${prefix}/etc/munin \
+                    DBDIR=${destroot}${prefix}/var/munin \
+                    LOGDIR=${destroot}${prefix}/var/log/munin \
+                    STATEDIR=${destroot}${prefix}/var/run \
+                    MANDIR=${destroot}${prefix}/share/man \
+                    DOCDIR=${destroot}${prefix}/share/doc/munin \
+                    LIBDIR=${destroot}${prefix}/lib/munin \
+                    HTMLDIR=${destroot}${prefix}/www/munin \
+                    CGIDIR=${destroot}${prefix}/www/cgi-bin \
+                    PERL=${prefix}/bin/perl
+destroot.keepdirs   ${destroot}${prefix}/var/log/munin \
+                    ${destroot}${prefix}/var/run/munin \
+                    ${destroot}${prefix}/etc/munin/plugins \
+                    ${destroot}${prefix}/var/munin \
+                    ${destroot}${prefix}/www/munin
+destroot.target     install-node install-node-plugins install-doc install-man
+
+startupitem.create  yes
+startupitem.name    munin-node
+startupitem.start   "${prefix}/sbin/munin-node"
+startupitem.stop    "kill `cat ${prefix}/var/run/munin/munin-node.pid`"
+
+variant server description {Install Munin server} {
+    depends_lib-append port:rrdtool port:p5-html-template
+    destroot.target-append install-main
+}
+
+pre-destroot {
+    # Create munin user and group
+    addgroup munin
+    adduser munin gid=[existsgroup munin]
+}
+post-destroot {
+    # State directory should be owned by munin
+    xinstall -d -o munin ${destroot}${prefix}/var/run/munin
+
+    if { [variant_isset server] } {
+        # Create and symlink launchd item for munin-cron
+        xinstall -d ${destroot}${prefix}/etc/LaunchDaemons/org.macports.munin-cron
+        file copy ${portpath}/files/org.macports.munin-cron.plist.in \
+        ${destroot}${prefix}/etc/LaunchDaemons/org.macports.munin-cron/org.macports.munin-cron.plist
+        reinplace s|@PREFIX@|${prefix}|g ${destroot}${prefix}/etc/LaunchDaemons/org.macports.munin-cron/org.macports.munin-cron.plist
+
+        xinstall -d ${destroot}/Library/LaunchDaemons
+        ln -s ${prefix}/etc/LaunchDaemons/org.macports.munin-cron/org.macports.munin-cron.plist \
+        ${destroot}/Library/LaunchDaemons/org.macports.munin-cron.plist
+
+        ui_msg "###########################################################"
+        ui_msg "# A startup item has been generated that will cause the"
+        ui_msg "# Munin server to fetch data from all nodes every 5 mins."
+        ui_msg "# It is disabled by default, please execute the following"
+        ui_msg "# command to enable:"
+        ui_msg "#"
+        ui_msg "# sudo launchctl load -w /Library/LaunchDaemons/org.macports.munin-cron.plist"
+        ui_msg "###########################################################"
+    }
+}
+post-install {
+    ui_msg "To detect supported Munin plugins please use the following command"
+    ui_msg "$ sudo munin-node-configure --suggest --shell | sh"
+}


Property changes on: trunk/dports/net/munin/Portfile
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: trunk/dports/net/munin/files/org.macports.munin-cron.plist.in
===================================================================
--- trunk/dports/net/munin/files/org.macports.munin-cron.plist.in	                        (rev 0)
+++ trunk/dports/net/munin/files/org.macports.munin-cron.plist.in	2009-03-09 08:59:26 UTC (rev 47876)
@@ -0,0 +1,21 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
+"http://www.apple.com/DTDs/PropertyList-1.0.dtd" >
+<plist version='1.0'>
+    <dict>
+        <key>Label</key>
+        <string>org.macports.munin-cron</string>
+        <key>UserName</key>
+        <string>munin</string>
+        <key>ProgramArguments</key>
+        <array>
+            <string>@PREFIX@/bin/munin-cron</string>
+        </array>
+        <key>LowPriorityIO</key>
+        <true/>
+        <key>Nice</key>
+        <integer>1</integer>
+        <key>StartInterval</key>
+        <integer>300</integer>
+    </dict>
+</plist>

Added: trunk/dports/net/munin/files/patch-Makefile.config
===================================================================
--- trunk/dports/net/munin/files/patch-Makefile.config	                        (rev 0)
+++ trunk/dports/net/munin/files/patch-Makefile.config	2009-03-09 08:59:26 UTC (rev 47876)
@@ -0,0 +1,26 @@
+diff -r 0e0f9e28d8e6 Makefile.config
+--- Makefile.config	Sat Mar 07 22:18:01 2009 +0100
++++ Makefile.config	Mon Mar 09 09:41:58 2009 +0100
+@@ -87,16 +87,17 @@
+ GROUP      = munin
+ 
+ # Default user to run the plugins as
+-PLUGINUSER = nobody
++#PLUGINUSER = nobody
++PLUGINUSER = munin
+ 
+ # Which command to use to check if the USER and GROUP to run Munin as, exists.
+ GETENT = $(shell which getent || which true 2>/dev/null)
+-CHECKUSER  = $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
+-CHECKGROUP = $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
++#CHECKUSER  = $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
++#CHECKGROUP = $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
+ 
+ # For OSX, comment out the previous two lines and comment in these 
+-#CHECKUSER  = $(shell nicl . -read /users/$(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2")) 
+-#CHECKGROUP = $(shell nicl . -read /groups/$(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2")) 
++CHECKUSER  = $(shell dscl . -read /users/$(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2")) 
++CHECKGROUP = $(shell dscl . -read /groups/$(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2")) 
+ 
+ CHOWN      = chown
+ CHMOD      = chmod

Added: trunk/dports/net/munin/files/patch-munin-node.conf.in
===================================================================
--- trunk/dports/net/munin/files/patch-munin-node.conf.in	                        (rev 0)
+++ trunk/dports/net/munin/files/patch-munin-node.conf.in	2009-03-09 08:59:26 UTC (rev 47876)
@@ -0,0 +1,12 @@
+diff -r 0e0f9e28d8e6 node/munin-node.conf.in
+--- node/munin-node.conf.in	Sat Mar 07 22:18:01 2009 +0100
++++ node/munin-node.conf.in	Sun Mar 08 00:20:57 2009 +0100
+@@ -10,7 +10,7 @@
+ setseid 1
+ 
+ user root
+-group root
++group wheel
+ setsid yes
+ 
+ # Regexps for files to ignore
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090309/fd6cf1a3/attachment-0001.html>


More information about the macports-changes mailing list