# -*- 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/caarlos0/timer 1.4.6 v
go.offline_build    no
go.toolchain_min    1.21
revision            0

description         A \`sleep\` with progress
long_description    {*}${description}

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

checksums           rmd160  dfd36a3b572ee9c1bcf1e34b359a9890206d04b0 \
                    sha256  b8286a449fb2fcaa685f2c4bd0300494414ce168e0123ba33ef6e15de9bb3a3a \
                    size    8672

build.cmd           \
    "go build && ./scripts/completions.sh && ./scripts/manpages.sh"

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

    # Install man page
    copy ${worksrcpath}/manpages/${name}.1.gz \
        ${destroot}${prefix}/share/man/man1/

    # Install bash completion
    xinstall -d  ${destroot}${prefix}/share/bash-completion/completions
    xinstall -m 0644 ${worksrcpath}/completions/${name}.bash \
        ${destroot}${prefix}/share/bash-completion/completions/${name}

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

    # Install fish completion
    xinstall -d ${destroot}${prefix}/share/fish/vendor_completions.d
    xinstall -m 0644 ${worksrcpath}/completions/${name}.fish \
        ${destroot}${prefix}/share/fish/vendor_completions.d/${name}.fish
}
