source: trunk/dports/net/munin/Portfile

Last change on this file was 151886, checked in by mojca@…, 15 months ago

munin: switch to perl5.24 (#52081)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.4 KB
Line 
1# -*- 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
2# $Id: Portfile 151886 2016-08-23 21:27:38Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           perl5 1.0
6
7name                munin
8version             1.4.7
9revision            5
10license             GPL-2
11categories          net
12maintainers         nomaintainer
13platforms           darwin
14description         Extensible system monitoring tool
15
16long_description    Munin the monitoring tool surveys all your computers \
17                    and remembers what it saw. It presents all the \
18                    information in graphs through a web interface. Its \
19                    emphasis is on plug and play capabilities. Using Munin \
20                    you can easily monitor the performance of your \
21                    computers, networks, SANs, applications, weather \
22                    measurements and whatever comes to mind. \
23                    \
24                    Note: By default only Munin node is installed. To \
25                    install the Munin server that gathers data from \
26                    existing nodes and generates graphs please enable the \
27                    server variant.
28
29homepage            http://munin-monitoring.org/
30master_sites        sourceforge:project/munin/munin%20stable/${version}
31
32checksums           rmd160  b25c0a4d7d7613592757132290b7158228ea2a67 \
33                    sha256  9a87356b1f8662f444a7a2a86ff36809124ffe787c442de0ea35850194d602af
34
35perl5.branches      5.24
36
37depends_lib         port:perl${perl5.major} \
38                    port:p${perl5.major}-module-build \
39                    port:p${perl5.major}-net-server \
40                    port:p${perl5.major}-net-snmp \
41                    port:p${perl5.major}-net-ssleay
42
43# munindoc needs at least groff version 1.20.1 for good Unicode support.
44
45depends_run         port:groff
46
47use_configure       no
48use_parallel_build  no
49patchfiles          patch-Makefile-javaplugin \
50                    patch-Makefile.config \
51                    patch-munin-node.conf.in \
52                    patch-encodings.diff
53
54post-patch {
55    reinplace "s|/usr/bin/perl|${perl5.bin}|" \
56        ${worksrcpath}/master/_bin/munin-update.in \
57        ${worksrcpath}/node/extras/munin-node-sched \
58        ${worksrcpath}/node/extras/munin-node-simple.in \
59        ${worksrcpath}/node/bin/munindoc \
60        ${worksrcpath}/contrib/munin-every-services-all-boxes-build-html.in \
61        ${worksrcpath}/node/sbin/munin-node \
62        ${worksrcpath}/node/sbin/munin-node-configure \
63        ${worksrcpath}/node/sbin/munin-run
64}
65
66# sed fails in Mountain Lion, see #36527
67build.env           LANG=C LC_ALL=C
68
69build.target        build
70build.args          PREFIX=${prefix} \
71                    CONFDIR=${prefix}/etc/munin \
72                    DBDIR=${prefix}/var/munin \
73                    LOGDIR=${prefix}/var/log/munin \
74                    STATEDIR=${prefix}/var/run/munin \
75                    MANDIR=${prefix}/share/man \
76                    DOCDIR=${prefix}/share/doc/munin \
77                    LIBDIR=${prefix}/lib/munin \
78                    HTMLDIR=${prefix}/www/munin \
79                    CGIDIR=${prefix}/www/cgi-bin \
80                    PERL=${perl5.bin}
81destroot.args       PREFIX=${destroot}${prefix} \
82                    CONFDIR=${destroot}${prefix}/etc/munin \
83                    DBDIR=${destroot}${prefix}/var/munin \
84                    LOGDIR=${destroot}${prefix}/var/log/munin \
85                    STATEDIR=${destroot}${prefix}/var/run \
86                    MANDIR=${destroot}${prefix}/share/man \
87                    DOCDIR=${destroot}${prefix}/share/doc/munin \
88                    LIBDIR=${destroot}${prefix}/lib/munin \
89                    HTMLDIR=${destroot}${prefix}/www/munin \
90                    CGIDIR=${destroot}${prefix}/www/cgi-bin \
91                    PERL=${perl5.bin}
92destroot.keepdirs   ${destroot}${prefix}/var/log/munin \
93                    ${destroot}${prefix}/var/run/munin \
94                    ${destroot}${prefix}/etc/munin/plugins \
95                    ${destroot}${prefix}/etc/munin/plugin-conf.d \
96                    ${destroot}${prefix}/var/munin \
97                    ${destroot}${prefix}/www/munin
98destroot.target     install-common-prime \
99                    install-node-prime \
100                    install-plugins-prime \
101                    install-plugins-java \
102                    install-man
103
104startupitem.create  yes
105startupitem.name    munin-node
106startupitem.start   "${prefix}/sbin/munin-node"
107startupitem.stop    "kill `cat ${prefix}/var/run/munin/munin-node.pid`"
108
109variant server description {Install Munin server} {
110    depends_lib-append      port:rrdtool \
111                            port:p${perl5.major}-html-template \
112                            port:p${perl5.major}-time-hires \
113                            port:p${perl5.major}-digest-md5 \
114                            port:p${perl5.major}-text-balanced \
115                            port:p${perl5.major}-log-log4perl
116    destroot.target-append  install-master-prime
117}
118
119pre-destroot {
120    # Create munin user and group
121    addgroup munin
122    adduser munin gid=[existsgroup munin]
123}
124post-destroot {
125    # Rename config files so port upgrades don't overwrite installed versions of these
126    file rename ${destroot}${prefix}/etc/munin/munin-node.conf ${destroot}${prefix}/etc/munin/munin-node.conf.sample
127
128    # State directory should be owned by munin
129    xinstall -d -o munin ${destroot}${prefix}/var/run/munin
130
131    if { [variant_isset server] } {
132        file rename ${destroot}${prefix}/etc/munin/munin.conf ${destroot}${prefix}/etc/munin/munin.conf.sample
133        # Create and symlink launchd item for munin-cron
134        xinstall -d ${destroot}${prefix}/etc/LaunchDaemons/org.macports.munin-cron
135        file copy ${portpath}/files/org.macports.munin-cron.plist.in \
136        ${destroot}${prefix}/etc/LaunchDaemons/org.macports.munin-cron/org.macports.munin-cron.plist
137        reinplace s|@PREFIX@|${prefix}|g ${destroot}${prefix}/etc/LaunchDaemons/org.macports.munin-cron/org.macports.munin-cron.plist
138
139        xinstall -d ${destroot}/Library/LaunchDaemons
140        ln -s ${prefix}/etc/LaunchDaemons/org.macports.munin-cron/org.macports.munin-cron.plist \
141        ${destroot}/Library/LaunchDaemons/org.macports.munin-cron.plist
142
143        ui_msg "###########################################################"
144        ui_msg "# A startup item has been generated that will cause the"
145        ui_msg "# Munin server to fetch data from all nodes every 5 mins."
146        ui_msg "# It is disabled by default, please execute the following"
147        ui_msg "# command to enable:"
148        ui_msg "#"
149        ui_msg "# sudo launchctl load -w /Library/LaunchDaemons/org.macports.munin-cron.plist"
150        ui_msg "###########################################################"
151    }
152}
153
154post-activate {
155    # Copy sample versions of config files into place
156    if {![file exists ${prefix}/etc/munin/munin-node.conf]} {
157        file copy ${prefix}/etc/munin/munin-node.conf.sample ${prefix}/etc/munin/munin-node.conf
158    }
159    if { [variant_isset server] } {
160        if {![file exists ${prefix}/etc/munin/munin.conf]} {
161            file copy ${prefix}/etc/munin/munin.conf.sample ${prefix}/etc/munin/munin.conf
162        }
163    }
164}
165
166notes "
167To detect supported Munin plugins please use the following command:
168
169sudo -u munin munin-node-configure --suggest --shell | sudo sh
170"
171
172livecheck.regex ${name}-(\[0-9\]+\\.\[0-9\]*\[02468\](\\.\[0-9\]+)*)${extract.suffix}
Note: See TracBrowser for help on using the repository browser.