Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
166 lines (121 sloc) 5.9 KB
# -*- 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
PortSystem 1.0
PortGroup perl5 1.0
name nrg
version 0.99.27
revision 6
categories net
maintainers nomaintainer
platforms darwin
description Network Resource Grapher
long_description NRG is an RRDtool front-end tool to monitor traffic and load \
on network links or any other resource utilization source. It \
automatically creates and maintains web pages and RRDtool databases, \
while providing short and long-term graph web pages just like MRTG.
# website no longer exists
master_sites macports_distfiles:${name}
checksums rmd160 1192ce02d14447abdcff994671693eeb4ca67e28 \
sha256 ef851705f9ebd2bf55892823f258c7cffc079ae0276df4f40860c520262971c2
perl5.branches 5.28
depends_lib port:perl${perl5.major} \
port:p${perl5.major}-time-hires \
patchfiles \
configure.perl ${perl5.bin}
configure.pre_args --prefix=${prefix}/var/${name}
configure.args --bindir=${prefix}/bin \
--sysconfdir=${prefix}/etc/${name} \
--datadir=${prefix}/share \
--build=powerpc-unknown-freebsd \
platform i386 {
configure.args-delete --build=powerpc-unknown-freebsd
configure.args-append --build=i386-unknown-freebsd
variant pingd_server description {pingd daemon to graph network latency with NRG} {
startupitem.create yes pingd
startupitem.executable "${prefix}/bin/pingd"
} pingd install.pingd install
# Maintain empty directories
destroot.keepdirs ${destroot}${prefix}/var/${name}/archive
post-patch {
### Path fixes ###
reinplace "s|@prefix@/bin|@bindir@|g" \
${worksrcpath}/examples/ \
reinplace "s|@prefix@/bin|@bindir@|g" \
{*}[glob ${worksrcpath}/templates/*.in]
#### Make NRG page title the way I want it ####
reinplace "s|Somesite's NRG Home Page|NRG Home Page|g" \
#### Fix paths for proper destrooting ####
reinplace "s|exec_prefix = @prefix@|exec_prefix = ${destroot}@prefix@|g" \
reinplace "s|prefix = @prefix@|prefix = ${destroot}@prefix@|g" \
reinplace "s|BIN_DIR = @bindir@|BIN_DIR = ${destroot}@bindir@|g" \
reinplace "s|ETC_DIR = @sysconfdir@|ETC_DIR = ${destroot}@sysconfdir@|g" \
reinplace "s|TEMPLATE_DIR = \${prefix}/templates|TEMPLATE_DIR = ${destroot}@prefix@/templates|g" \
reinplace "s|EXAMPLE_DIR = \${prefix}/examples|EXAMPLE_DIR = ${destroot}@datadir@/doc/nrg/examples|g" \
reinplace "s|HTML_DIR = \${prefix}/html|HTML_DIR = ${destroot}@datadir@/doc/nrg/html|g" \
reinplace "s|ARCHIVE_DIR = \${prefix}/archive|ARCHIVE_DIR = ${destroot}@prefix@/archive|g" \
reinplace "s|CONTRIB_DIR = \${prefix}/contrib|CONTRIB_DIR = ${destroot}@datadir@/doc/nrg/contrib|g" \
post-destroot {
# Install images to \${prefix}/var/nrg/web/icons
xinstall -d -m 755 ${destroot}${prefix}/var/${name}/web/icons
xinstall -m 755 {*}[glob ${worksrcpath}/images/*.*] ${destroot}${prefix}/var/${name}/web/icons
# Rename Site.mconf so graphed devices won't get rewritten on port upgrades
move ${destroot}${prefix}/var/${name}/Site.mconf \
livecheck.type none
notes \
"#### To complete the NRG installation ####
1) Make an /nrg symlink in your Apache document root pointing to the ../nrg/web NRG data directory:
sudo ln -s ${prefix}/var/${name}/web /my-Apache-document-root/nrg
2) Modify your httpd.conf file for NRG graph pages:
Uncomment lines: AddHandler cgi-script .cgi
LoadModule expires_module libexec/httpd/
AddModule mod_expires.c
Add directives: <Directory /my-Apache-document-root/nrg>
Options ExecCGI
<Files \"*.gif\">
ExpiresActive On
ExpiresDefault M5
Change the Apache user and group to the NRG user and group so Apache will
have permissions to create graphs when you click an RRD file link.
User <nrg-user>
Group <nrg-group>
3) Change the web root variables at the top of files Makefile and Site.mconf
in directory ${prefix}/var/${name} to your Apache document root location.
4) Make NRG files and data owned by the user you'll use to run NRG
su (must be root for this operation)
find ${prefix}/var/nrg -print | xargs chown <nrg-user>:<nrg-group>
#### To use NRG ####
1) Set meta-configuration definitions in the Site.mconf file for each
resource you want to graph by following the example meta-configuration
definitions in ${prefix}/share/doc/nrg/examples.
2) Have NRG generate rrd files and html graph pages (and modify them after
Site.mconf changes):
cd ${prefix}/var/${name}
make rediscover
make notify
3) Schedule the script ${prefix}/var/${name}/run-nrg to run via cron every five
minutes to poll your data sources and update the rrd files.
Be sure to read the documentation in ${prefix}/share/doc/${name}/html for
creating custom graphs or for more information."
You can’t perform that action at this time.