# -*- 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: Portfile 115019 2013-12-22 09:29:46Z ryandesign@macports.org $

PortSystem          1.0

name                rrdtool
version             1.4.7
revision            5
categories          net
license             GPL-2+
maintainers         markd openmaintainer
description         Round Robin Database
long_description    RRDtool is a system to store and display time-series data
homepage            http://oss.oetiker.ch/rrdtool/
platforms           darwin
master_sites        ${homepage}pub/
checksums           rmd160 3a8c1c0f3fe0d76fb7da8b712cdd19d59d5171ba \
                    sha256 956aaf431c955ba88dd7d98920ade3a8c4bad04adb1f9431377950a813a7af11

depends_build       port:pkgconfig
depends_lib         port:expat \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    port:libiconv \
                    port:libffi \
                    port:gettext \
                    path:lib/pkgconfig/pango.pc:pango \
                    path:bin/perl:perl5 \
                    port:tcl \
                    port:zlib \
                    port:libpng \
                    port:libxml2 \
                    port:intltool

patchfiles          patch-bindings_lua_Makefile_in.diff

configure.args      --enable-perl-site-install \
                    --with-perl-options="INSTALLDIRS=vendor" \
                    --with-tcllib=${prefix}/lib \
                    --disable-silent-rules \
                    --disable-lua \
                    --disable-python \
                    --disable-ruby \
                    --disable-tcl

configure.cppflags-append \
                    -I${prefix}/include/freetype2 \
                    -I${prefix}/include/libpng14

post-destroot {
    fs-traverse f ${destroot}${prefix} {
        if {[file isfile ${f}]} {
            switch [file tail ${f}] {
                .packlist -
                perllocal.pod {
                    delete ${f}
                }
            }
        }
    }
}

variant python25 description {Python 2.5 bindings for RRDtool} conflicts python26 python27 {
    depends_lib-append      port:python25
    configure.python        ${prefix}/bin/python2.5
    configure.args-delete   --disable-python
    configure.args-append   --enable-python
}

variant python26 description {Python 2.6 bindings for RRDtool} conflicts python25 python27 {
    depends_lib-append      port:python26
    configure.python        ${prefix}/bin/python2.6
    configure.args-delete   --disable-python
    configure.args-append   --enable-python
}

variant python27 description {Python 2.7 bindings for RRDtool} conflicts python25 python26 {
    depends_lib-append      port:python27
    configure.python        ${prefix}/bin/python2.7
    configure.args-delete   --disable-python
    configure.args-append   --enable-python
}

notes "
See ${prefix}/share/doc/rrdtool-${version} for example code.
"
