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

github.setup            adsr flow-tools 0.68.5.1 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from     tarball
revision                1
categories              net
maintainers             nomaintainer
license                 BSD

description             Suite of tools and library to work with netflow data
long_description        {*}${description}

checksums               rmd160  e0b72c2c35911c40db6abacd317590ac74a17d68 \
                        sha256  03eac277958d401a9319ae1ed0dee9c0ed7a70f446b0f0f95d2df40fb6792deb \
                        size    1083011

# skip building of outdated docbook 3.0 sgml docs
# macports no longer provides the required DTD
patchfiles              patch-disable-broken-docs.diff \
                        implicit.patch

depends_lib             port:zlib

# requires old openssl 1.0 to build
openssl.branch          1.0
openssl.configure       build_flags

use_autoreconf          yes
autoreconf.args         -fvi

# http://trac.macports.org/ticket/34358
configure.cflags-append -std=gnu89
configure.args          --with-openssl \
                        --without-postgresql \
                        --disable-silent-rules

post-destroot {
        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
        xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING INSTALL README NEWS SECURITY TODO \
                ${destroot}${prefix}/share/doc/${name}
}

# TODO: add additional versioned mysql and postgresql variants as needed

variant mysql57 description {Build with mysql57 support} {
        depends_lib-append      port:mysql57
        configure.cflags-append -I${prefix}/include/mysql57/mysql
        configure.ldflags-append -L${prefix}/lib/mysql57/mysql
        configure.args-append   --with-mysql=yes
}

# skip release candidates in livecheck
github.livecheck.regex  {(\d+(?:\.\d+)*)}
