# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8::et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           github          1.0
PortGroup           legacysupport   1.1

name                lnav

homepage            https://lnav.org

description         An advanced log file viewer for the small-scale.

long_description    \
    Many logging tools, like Splunk, provide great features but are optimized \
    for large-scale deployments.  They require installing and configuring \
    servers before they can be effectively used.  There is still a need for a \
    robust log file analyzer for the terminal.

categories          sysutils
installs_libs       no
license             BSD
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

subport ${name}-devel {}

if {${name} eq ${subport}} {
    # Main Port
    github.setup        tstack lnav 0.12.4 v
    github.tarball_from archive
    revision            0

    conflicts           lnav-devel

    checksums           ${distname}${extract.suffix} \
                        rmd160  56cd862cf38839db6af05baa500972d6b589fe17 \
                        sha256  ee6ea75cbfd736f6ad8b32212883e45a1a64e48085a14757d2cfffa90ebb8e75 \
                        size    21550635

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

} else {
    # Devel
    github.setup        tstack lnav 0.13.2 v
    github.tarball_from archive
    revision            0

    conflicts           lnav

    checksums           ${distname}${extract.suffix} \
                        rmd160  a9bf26193c9a77df9d6353328174e53a9603a5c9 \
                        sha256  3501b921c0acb435f85bd2ce589b4d8ba205a87ed855926e65a6ad165431b331 \
                        size    35349126
}

depends_lib-append  path:lib/libssl.dylib:openssl \
                    port:bzip2 \
                    port:curl \
                    port:libarchive \
                    port:ncurses \
                    port:pcre2 \
                    port:readline \
                    port:sqlite3 \
                    port:zlib

compiler.c_standard   2011
compiler.cxx_standard 2014

configure.args-append \
                    --disable-silent-rules \
                    --disable-static \
                    --with-libarchive \
                    --with-libcurl=${prefix} \
                    --with-ncurses \
                    --with-pcre2 \
                    --with-readline \
                    --with-sqlite3

use_autoreconf      yes
