# -*- 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/jaisonerick/macwifi-cli 1.0.0 v
revision            0

categories          net sysutils
maintainers         {amake @amake} openmaintainer
license             MIT
installs_libs       no
platforms           {darwin >= 22}
supported_archs     arm64

go.toolchain_min    1.26

description         Command-line Wi-Fi inspection for macOS
long_description    ${name} scans nearby Wi-Fi networks and reports SSIDs, \
                    BSSIDs, signal strength, channels and security. It also \
                    inspects the current connection and retrieves saved \
                    Wi-Fi passwords on request.

build.args-append   -ldflags \"-X main.version=${version}\"

checksums           ${distname}${extract.suffix} \
                        rmd160  1d604f5ed0a5cbf0f94ebc90c144e2bdd8f878d0 \
                        sha256  9e708aa4bd4f53f418e27e94800365297aa362963324f2048ac0169b59b3f6dd \
                        size    8725

go.vendors          github.com/jaisonerick/macwifi \
                        lock    v1.0.0 \
                        rmd160  f0000e275e6c86cc6c314ed606e190a8fc8323de \
                        sha256  9d5457f2f1b9680a016fdc8ee8d06b31a782a78fb7b6dffb46b172e927d71d1d \
                        size    82189

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

notes "The first scan launches the bundled WifiScanner helper and may request\
    Location Services permission. Allow it to obtain SSIDs and BSSIDs.\
    Run: macwifi-cli scan --json"
