# -*- 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/Tufin/oasdiff 1.11.10 v
go.offline_build    no
revision            0

homepage            https://www.oasdiff.com/

description         Compare and detect breaking changes in OpenAPI specs.

long_description    {*}${description}

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

checksums           ${distname}${extract.suffix} \
                    rmd160  4e60deb94d6f47dcfbca945918b273662d033439 \
                    sha256  1e18a2f9efc4adcb501205d18095b82ec3fb52042b30f974d2bdacdea898bd17 \
                    size    409844

post-build {
    system -W ${worksrcpath} "./${name} completion bash > ${name}.bash"
    system -W ${worksrcpath} "./${name} completion fish > ${name}.fish"
    system -W ${worksrcpath} "./${name} completion zsh > ${name}.zsh"
}

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

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

    set fish_completions_dir share/fish/vendor_completions.d
    xinstall -d ${destroot}${prefix}/${fish_completions_dir}
    xinstall -m 0644 ${worksrcpath}/${name}.fish \
        ${destroot}${prefix}/${fish_completions_dir}

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