# -*- 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/noborus/trdsql 1.2.3 v
go.offline_build    no
go.toolchain_min    1.25.0
revision            0

description         CLI tool that can execute SQL queries on CSV, LTSV, JSON \
                    and TBLN files. Can output to various formats.

long_description    {*}${description} Can use PostgreSQL or MySQL syntax.

categories          textproc databases
installs_libs       no
license             MIT
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

build.cmd           make
build.target        trdsql

patch {
    reinplace "s|^VERSION=.*|VERSION=v${version}|" ${worksrcpath}/Makefile
}

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

    set zsh_comp_path ${destroot}${prefix}/share/zsh/site-functions
    xinstall -d ${zsh_comp_path}
    xinstall -m 0644 \
        ${worksrcpath}/completion/${name}-completion.zsh \
        ${zsh_comp_path}/_${name}
}

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


checksums           ${distname}${extract.suffix} \
                        rmd160  106919a785950132d9bad1f037a6bedc2dbecd51 \
                        sha256  23a80d1c7cf44f458440ad9b6ffc5dc9305e98f191fbce102f47bf6be2c4fb17 \
                        size    2474314

