# -*- 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.14.0 v
    github.tarball_from archive
    revision            0

    conflicts           lnav

    checksums           ${distname}${extract.suffix} \
                        rmd160  db05d648fbde65bc1077f3104be3b648055ff7f7 \
                        sha256  bf142441fc85e99c256ebe661e4199768acbd340da1344554da49a9e867a49ea \
                        size    36107638
}

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
