# -*- 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/vmfunc/sif 2026.6.10 v
# This release predates the project's move to github.com/vmfunc, and its go.mod
# still carries the former module path.
go.package          github.com/dropalldatabases/sif
go.offline_build    no
go.toolchain_min    1.25.7
revision            0

description         Blazing-fast modular pentesting and recon suite

long_description    sif runs directory and DNS fuzzing, port scanning, web \
                    crawling, JavaScript secret extraction, CMS and framework \
                    fingerprinting, Nuclei templates and its own YAML-defined \
                    modules against a list of targets, concurrently, from a \
                    single binary.

categories          security net
installs_libs       no
license             BSD
maintainers         {girlboss.ceo:june @x86pup} openmaintainer

checksums           ${distname}${extract.suffix} \
                        rmd160  d83fadf3a52f8ccdec7c175cce2e5f01cce0d57d \
                        sha256  cf663449f560a0bee3ef38fd5436d9a877ca1326d5c13b775ec8a57dfcdedd32 \
                        size    1835335

# The bundled modules are searched for next to the executable and in the
# working directory only, so an installed copy finds none of them. Add the
# directory they are installed to as a last resort.
patchfiles          patch-internal-modules-loader.go.diff

post-patch {
    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/internal/modules/loader.go
}

build.pre_args-append \
    -ldflags \"-X main.version=${version}\"
build.args-append   ./cmd/${name}

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

    xinstall -d ${destroot}${prefix}/share/man/man1
    xinstall -m 0644 ${worksrcpath}/man/${name}.1 \
        ${destroot}${prefix}/share/man/man1/

    xinstall -d ${destroot}${prefix}/share/${name}/modules
    copy {*}[glob ${worksrcpath}/modules/*] \
        ${destroot}${prefix}/share/${name}/modules/
}

notes "
The modules bundled with ${name} are installed to:

    ${prefix}/share/${name}/modules

Modules of your own go in ~/.config/${name}/modules, and override bundled ones
of the same name.
"

github.livecheck.regex  {(\d+(?:\.\d+)+)}
