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

go.setup            github.com/zix99/rare 0.4.4
go.package          rare
go.offline_build    no
revision            0

homepage            https://rare.zdyn.net

description         Realtime regex-extraction and aggregation into common \
                    formats such as histograms, bar graphs, numerical \
                    summaries, tables, and more!

long_description    {*}${description}

categories          textproc
installs_libs       no
license             GPL-3
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

checksums           rmd160  395755c3b1dccf849950a413c815031f4a124c10 \
                    sha256  1cdc3b1700862b4edf4123262bc6669e734c602bb10448d2770b638d5fb8309f \
                    size    2609812

build.pre_args-append \
    -ldflags    \" -X main.version=${version} \" \
    -tags       urfave_cli_no_docs,rare_no_pprof

post-build {
    # Generate man page
    system -W ${worksrcpath} "${go.bin} run . _gendoc --man > ${name}.1"
}

destroot {
    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/${name}

    xinstall -d ${destroot}${prefix}/share/man/man1
    xinstall -m 0644 \
        ${worksrcpath}/${name}.1 ${destroot}${prefix}/share/man/man1/
}

github.livecheck.regex \
                    {([0-9.-]+)}
