source: trunk/dports/net/nrg/Portfile @ 125738

Last change on this file since 125738 was 125738, checked in by mf2k@…, 4 years ago

adodb argus-monitor base blt cacti cdpr doclifter eventlog expect gkrellm honeyd iwidgets kchmviewer libdnsres monarch moodss moomps nagios nagios-plugins nedi netmrg network-weathermap nfdump nfsen nrg nrpe nsca ntop p5-archive-zip p5-cgi p5-cgi-speedycgi p5-convert-asn1 p5-libintl-perl p5-mhonarc p5-net p5-perl-ldap rancid rrdtool scotty sendpage smokeping snort sympa syslog-ng tclx tftp-hpa tktable uplog vm-pop3d xserve-raid-tools zabbix: Ports abandoned by markd. (#44782)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.2 KB
Line 
1# $Id: Portfile 125738 2014-09-25 14:43:03Z mf2k@macports.org $
2
3PortSystem      1.0
4
5name                            nrg
6version                         0.99.27
7revision            1
8categories                      net
9maintainers                     nomaintainer
10platforms                       darwin
11
12description                     Network Resource Grapher
13
14long_description                NRG is an RRDtool front-end tool to monitor traffic and load \
15                                on network links or any other resource utilization source.  It \
16                                automatically creates and maintains web pages and RRDtool databases, \
17                                while providing short and long-term graph web pages just like MRTG.
18
19homepage                        http://ginseng.hep.wisc.edu/NRG/
20master_sites                    ftp://noc.hep.wisc.edu/src/nrg/ \
21                                ftp://noc.hep.wisc.edu/pub/src/nrg/
22checksums                       md5 c38e6b27bc99f8f7fd825bc6e1a44f68
23depends_lib                     port:rrdtool port:p5.12-time-hires
24patchfiles                      patch-nrg-discover-tcp.in.diff
25
26configure.pre_args              --prefix=${prefix}/var/${name}
27
28configure.args                  --bindir=${prefix}/bin \
29                                --sysconfdir=${prefix}/etc/${name} \
30                                --datadir=${prefix}/share \
31                                --build=powerpc-unknown-freebsd \
32                                CFLAGS="-D__FreeBSD__"
33
34platform i386 {
35        configure.args-delete   --build=powerpc-unknown-freebsd
36        configure.args-append   --build=i386-unknown-freebsd
37}
38
39variant pingd_server description {pingd daemon to graph network latency with NRG} {
40        startupitem.create      yes
41        startupitem.name        pingd
42        startupitem.executable  "${prefix}/bin/pingd"
43}
44
45build.target                    pingd
46destroot.target                 install.pingd install
47
48# Maintain empty directories
49destroot.keepdirs ${destroot}${prefix}/var/${name}/archive
50
51post-patch {
52
53### Path fixes ###
54        reinplace "s|@prefix@/bin|@bindir@|g" \
55                ${worksrcpath}/examples/NRG.mconf.in \
56                ${worksrcpath}/src/nrg-spiketrimmer.in
57
58        eval reinplace "s|@prefix@/bin|@bindir@|g" \
59                [glob ${worksrcpath}/templates/*.in]
60
61#### Make NRG page title the way I want it ####
62       reinplace "s|Somesite's NRG Home Page|NRG Home Page|g" \
63               "${worksrcpath}/examples/Makefile.ops.in"
64
65
66#### Fix paths for proper destrooting ####
67        reinplace "s|exec_prefix = @prefix@|exec_prefix = ${destroot}@prefix@|g" \
68                ${worksrcpath}/Makefile.in
69        reinplace "s|prefix = @prefix@|prefix = ${destroot}@prefix@|g" \
70                ${worksrcpath}/Makefile.in
71        reinplace "s|BIN_DIR = @bindir@|BIN_DIR = ${destroot}@bindir@|g" \
72                ${worksrcpath}/Makefile.in
73        reinplace "s|ETC_DIR = \${prefix}/etc|ETC_DIR = ${destroot}@sysconfdir@|g" \
74                ${worksrcpath}/Makefile.in
75        reinplace "s|TEMPLATE_DIR = \${prefix}/templates|TEMPLATE_DIR = ${destroot}@prefix@/templates|g" \
76                ${worksrcpath}/Makefile.in
77        reinplace "s|EXAMPLE_DIR = \${prefix}/examples|EXAMPLE_DIR = ${destroot}@datadir@/doc/nrg/examples|g" \
78                ${worksrcpath}/Makefile.in
79        reinplace "s|HTML_DIR = \${prefix}/html|HTML_DIR = ${destroot}@datadir@/doc/nrg/html|g" \
80                ${worksrcpath}/Makefile.in
81        reinplace "s|ARCHIVE_DIR = \${prefix}/archive|ARCHIVE_DIR = ${destroot}@prefix@/archive|g" \
82                ${worksrcpath}/Makefile.in
83        reinplace "s|CONTRIB_DIR = \${prefix}/contrib|CONTRIB_DIR = ${destroot}@datadir@/doc/nrg/contrib|g" \
84                ${worksrcpath}/Makefile.in
85}
86
87post-destroot {
88# Install images to \${prefix}/var/nrg/web/icons
89        xinstall -d -m 755 ${destroot}${prefix}/var/${name}/web/icons
90        eval xinstall -m 755 [glob ${worksrcpath}/images/*.*] ${destroot}${prefix}/var/${name}/web/icons
91
92# Rename Site.mconf so graphed devices won't get rewritten on port upgrades
93        file rename ${destroot}${prefix}/var/${name}/Site.mconf \
94                ${destroot}${prefix}/var/${name}/Site.mconf.sample
95}
96
97notes \
98"#### To complete the NRG installation ####
99
1001) Make an /nrg symlink in your Apache document root pointing to the ../nrg/web NRG data directory:
101
102      sudo ln -s ${prefix}/var/${name}/web /my-Apache-document-root/nrg
103
1042) Modify your httpd.conf file for NRG graph pages:
105
106Uncomment lines:   AddHandler cgi-script .cgi
107                   LoadModule expires_module   libexec/httpd/mod_expires.so
108                   AddModule mod_expires.c
109
110Add directives:    <Directory /my-Apache-document-root/nrg>
111                      Options ExecCGI
112                   </Directory>
113
114                   <Files \"*.gif\">
115                      ExpiresActive On
116                      ExpiresDefault M5
117                   </Files>
118
119Change the Apache user and group to the NRG user and group so Apache will
120have permissions to create graphs when you click an RRD file link.
121
122                   User <nrg-user>
123                   Group <nrg-group>
124
1253) Change the web root variables at the top of files Makefile and Site.mconf
126   in directory ${prefix}/var/${name} to your Apache document root location.
127
1284) Make NRG files and data owned by the user you'll use to run NRG
129
130   su  (must be root for this operation)
131   find ${prefix}/var/nrg -print | xargs chown <nrg-user>:<nrg-group>
132
133
134#### To use NRG ####
135
1361) Set meta-configuration definitions in the Site.mconf file for each
137   resource you want to graph by following the example meta-configuration
138   definitions in ${prefix}/share/doc/nrg/examples.
139
1402) Have NRG generate rrd files and html graph pages (and modify them after
141   Site.mconf changes):
142
143      cd ${prefix}/var/${name}
144      make rediscover
145      make notify
146
1473) Schedule the script ${prefix}/var/${name}/run-nrg to run via cron every five
148   minutes to poll your data sources and update the rrd files.
149
150Be sure to read the documentation in ${prefix}/share/doc/${name}/html for
151creating custom graphs or for more information."
Note: See TracBrowser for help on using the repository browser.