# -*- 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

name                flowd
version             0.9.1
revision            0
categories          net
license             Permissive BSD
maintainers         nomaintainer

description         flowd is a small, fast and secure NetFlow collector.

long_description    ${description}

homepage            https://code.google.com/p/flowd/
master_sites        googlecode

checksums           sha1    3e9a19ea9203c875cedb23c8205a23f7b493a5eb \
                    rmd160  fb6f9042ff4018e758191b5649577393c0af77e4

depends_build       port:byacc

patchfiles          patch-flowd.conf.diff \
                    implicit.patch

post-patch {
    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/flowd.conf
}

post-destroot {
    move ${destroot}${prefix}/etc/flowd.conf ${destroot}${prefix}/etc/flowd.conf.default
}

platform darwin arm {
    depends_build-append    port:automake

    post-patch {
        # Use newer config.guess and config.sub to support Apple Silicon.
        set automake_dirs [glob -directory ${prefix}/share automake-*]
        set automake_dir [lindex [lsort -command vercmp $automake_dirs] end]
        copy -force ${automake_dir}/config.guess ${automake_dir}/config.sub \
            ${worksrcpath}
    }
}
