# -*- 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           github 1.0
PortGroup           golang 1.0

name                anubis-web
go.setup            github.com/TecharoHQ/anubis 1.28.2 v
github.tarball_from releases
revision            0

categories          security www
license             MIT
maintainers         @wu21-web openmaintainer
description         Web AI Firewall Utility
long_description    Anubis weighs the souls of incoming HTTP requests and uses \
                    a SHA-256 proof-of-work challenge to protect upstream \
                    resources from scraper bots.
homepage            https://anubis.techaro.lol/

conflicts           anubis

distname            anubis-src-vendor-npm-${version}
checksums           rmd160  ebe5014872052ceca6899074758f57231b3f0a53 \
                    sha256  524faa5da63fe45ccc8f070cd8bb12c2ac98599ed4832a17b42c2d09c19c66c2 \
                    size    26498890

build.env-delete    GO111MODULE=off
build.env-append    GO111MODULE=on \
                    GOTOOLCHAIN=local
build.args          -mod=vendor \
                    -trimpath \
                    -ldflags="-X ${go.package}.Version=${version}" \
                    -o anubis \
                    ./cmd/anubis

destroot {
    xinstall -m 0755 ${worksrcpath}/anubis ${destroot}${prefix}/bin/
    xinstall -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 0644 ${worksrcpath}/LICENSE \
        ${destroot}${prefix}/share/doc/${name}/
}
