# -*- 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                mrtg
version             2.17.4
categories          net
platforms           darwin
maintainers         jberry
license             GPL-2+

description         The multi-router traffic grapher

long_description    MRTG is a tool to monitor the traffic load on network \
                    links. It can also be used to gather and display a wide \
                    variety of time-series data.

homepage            http://www.mrtg.org/
master_sites        http://oss.oetiker.ch/mrtg/pub/

checksums           rmd160  cea76ad3685375770520ebbccd0ad4b6adafff1f \
                    sha256  5efa7fae8040159208472e5f889be5b41d8c8a2ea6b31616f0f75cc7f48d2365

depends_build       bin:perl:perl5

depends_lib         port:gd2 \
                    port:libpng \
                    port:zlib

configure.args      --with-gd=${prefix} \
                    --with-z=${prefix} \
                    --with-png=${prefix}

post-destroot {
    destroot.keepdirs \
        ${destroot}${prefix}/var/run \
        ${destroot}${prefix}/var/log \
        ${destroot}${prefix}/var/cache/mrtg

    reinplace s|"/var|"${prefix}/var| ${destroot}${prefix}/bin/mrtg
    reinplace s|"/etc|"${prefix}/etc| ${destroot}${prefix}/bin/mrtg
}