# -*- 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/ossf/scorecard 5.5.0 v
go.package          github.com/ossf/scorecard/v5
go.offline_build    no
go.toolchain_min    1.25.6
revision            0

homepage            https://scorecard.dev

description         \
    OpenSSF Scorecard - security health metrics for open source

long_description    \
    Scorecard assesses open source projects for security risks through a \
    series of automated checks. It gives maintainers a way to evaluate \
    whether their dependencies are safe, and awards each check a score that \
    can be used to identify specific areas to improve in order to strengthen \
    the security posture of a project.

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

# Upstream injects version metadata into this package; see
# scripts/version-ldflags
set version_pkg     sigs.k8s.io/release-utils/version

# The package must follow the build flags, so it goes in post_args
build.args-append   -trimpath \
                    -tags netgo \
                    -ldflags \" -X ${version_pkg}.gitVersion=${github.tag_prefix}${version} \
                                -X ${version_pkg}.gitTreeState=clean \"
build.post_args     .

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}
}

checksums           rmd160  9ed209ef935b7d383f932adb119d72574cd288a4 \
                    sha256  5b341000131035ef2aac5b8aa329176f5441beae46369e3d46019633ca736b5e \
                    size    19558320
