# -*- 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/slimm609/checksec 3.2.0
categories          security
maintainers         {i0ntempest @i0ntempest} openmaintainer
license             BSD

description         security feature auditing for ELF binaries and Linux kernels
long_description    ${name} inspects the security properties of ELF executables, running processes, and the\
                    Linux kernel — RELRO, stack canaries, NX, PIE, control-flow integrity (CFI), FORTIFY_SOURCE,\
                    and more.

homepage            https://slimm609.github.io/checksec

checksums           rmd160  4029a387f58ed2ddd71861145310e9ebee28c979 \
                    sha256  3ea46986821070ed06fef5215b2a83a9076115a865da70874e19f214db2c8d83 \
                    size    3771378

# unsupported dependencies
go.offline_build    no

destroot {
    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/
    xinstall -m 0644 ${worksrcpath}/extras/man/${name}.1 ${destroot}${prefix}/share/man/man1/
    # All supported shells: bash, fish, powershell, zsh
    set comp_path(bash) ${destroot}${prefix}/share/bash-completion/completions/${name}
    set comp_path(zsh)  ${destroot}${prefix}/share/zsh/site-functions/_${name}
    set comp_path(fish) ${destroot}${prefix}/share/fish/vendor_completions.d/${name}.fish
    foreach shell {bash zsh fish} {
        xinstall -d [file dirname $comp_path(${shell})]
        system -W ${worksrcpath} "./${name} completion ${shell} > $comp_path(${shell})"
    }
}
