# -*- 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/google/capslock 0.3.2 v
go.offline_build    no
go.toolchain_min    1.25.0
revision            0

description         \
    Capability analysis CLI for Go packages

long_description    \
    {*}${description}, informing users of which privileged operations a \
    given package can access. This works by classifying the capabilities of \
    Go packages by following transitive calls to privileged standard library \
    operations. Capabilities indicate what permissions a package has access \
    to, and can be used in conjunction with other security signals to \
    indicate which code requires additional scrutiny before it can be \
    considered trusted.

categories          security devel
installs_libs       no
license             BSD
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

# The build process requires VCS metadata
fetch.type          git

set binaries        [list ${name} ${name}-git-diff]

build.args-append   -trimpath -o bin/

foreach bin ${binaries} {
    build.post_args-append ./cmd/${bin}
}

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