# Template file for 'anubis'
pkgname=anubis
version=1.25.0
revision=1
build_style=go
go_import_path="github.com/TecharoHQ/anubis"
go_ldflags="-X ${go_import_path}.Version=${version}"
go_package=./cmd/anubis
make_check_args="-skip=TestPlaywrightBrowser"
hostmakedepends="nodejs esbuild zstd"
short_desc="Weighs the soul of requests using proof-of-work to stop crawlers"
maintainer="Luca Matei Pintilie <luca@lucamatei.com>"
license="MIT"
homepage="https://anubis.techaro.lol/"
changelog="https://github.com/TecharoHQ/anubis/releases"
distfiles="https://github.com/TecharoHQ/anubis/archive/refs/tags/v${version}.tar.gz"
checksum=e281562dea0b49d0639c3c5e9b0a2a7fe522b1a359e3cec470db06493835bbe7

system_accounts="_anubis"

pre_build() {
	npm ci --ignore-scripts
	CGO_ENABLED=0 GOARCH= npm run assets
}

do_check() {
	go test -p "$XBPS_MAKEJOBS" ${make_check_args} ./...
}

post_install() {
	vsv anubis
	vlicense LICENSE
}
