# -*- 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           github 1.0
PortGroup           perl5 1.0

github.setup        oetiker rrdtool-1.x 1.9.0 v
name                rrdtool
revision            0

checksums           rmd160  5b560dcaaa3e396b1e8a447457f7b47422a38cff \
                    sha256  5e65385e51f4a7c4b42aa09566396c20e7e1a0a30c272d569ed029a81656e56b \
                    size    2972593

categories          net
license             GPL-2+
maintainers         nomaintainer

description         Round Robin Database
long_description    RRDtool is a system to store and display time-series data

homepage            http://oss.oetiker.ch/rrdtool/
github.tarball_from releases
distname            ${name}-${version}

perl5.branches      5.34

depends_build-append \
                    port:gettext \
                    port:pkgconfig

if {${os.platform} eq "darwin" && ${os.major} >= 22} {
    depends_build-append \
                    port:groff
}

depends_lib-append \
                    path:lib/pkgconfig/cairo.pc:cairo \
                    port:gettext-runtime \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    port:fribidi \
                    port:libpng \
                    port:libxml2 \
                    path:lib/pkgconfig/pango.pc:pango \
                    port:tcp_wrappers

depends_run-append \
                    port:dejavu-fonts \
                    port:perl${perl5.major}

patchfiles-append   configure-remove-cute-output.patch \
                    implicit.patch \
                    patch-doc-Makefile.in.diff

# See https://github.com/oetiker/rrdtool-1.x/issues/1261
patchfiles-append   patch-1262.diff

configure.perl      ${perl5.bin}
configure.args      --disable-libdbi \
                    --disable-librados \
                    --enable-perl-site-install \
                    --with-perl-options="INSTALLDIRS=vendor" \
                    --disable-silent-rules \
                    --disable-lua \
                    --disable-python \
                    --disable-ruby \
                    --disable-tcl \
                    --without-systemdsystemunitdir

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