# -*- 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.0 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  e2d9557e490e6945c6ee53c502306ab9beda6fe8 \
                    sha256  8d31b23732334efb5c7a6930d73515612b8a46366ab230af4bea4c384a3772ca \
                    size    304505

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

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

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.]+)}
