# -*- 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/fortio/fortio 1.75.2 v
go.package          fortio.org/fortio
revision            0

homepage            https://fortio.org

description         \
    Fortio is a load testing library, command line tool, advanced echo server \
    and web UI in go (golang).

long_description    \
    {*}${description} Allows to specify a set query-per-second load and \
    record latency histograms and other useful stats. Fortio runs at a \
    specified query per second (qps) and records an histogram of execution \
    time and calculates percentiles (e.g. p99 ie the response time such as \
    99% of the requests take less than that number (in seconds, SI unit)). It \
    can run for a set duration, for a fixed number of calls, or until \
    interrupted (at a constant target QPS, or max speed/load per \
    connection/thread).

categories          net www
installs_libs       no
license             Apache-2
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

checksums           rmd160  c63d07ee7a86c24aa1dde7e82354ec7502aea356 \
                    sha256  b57e4df1fe2fc94c5e074bab0c9350076f7e15c8068d6f82a36e5cb9115cc97b \
                    size    304496

set _ft_share_dir   ${prefix}/share/${name}

# Allow Go to fetch deps at runtime
go.offline_build no
go.toolchain_min    1.25.0

build.cmd           make
build.pre_args      BUILD_DIR=${gopath} \
                    GIT_TAG=v${version} \
                    LIB_DIR=${_ft_share_dir}/ui \
                    OFFICIAL_TARGET=${go.package} \
                    DIST_VERSION=${version} \
                    MODE="install"
build.args          official-build

destroot {
    xinstall -m 0755 ${gopath}/result/fortio ${destroot}${prefix}/bin/${name}

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

    file mkdir ${destroot}${_ft_share_dir}
    copy ${worksrcpath}/ui/ ${destroot}${_ft_share_dir}/
}

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