# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=gosec
pkgver=2.21.4
pkgrel=5
pkgdesc="Go source code static analyzer, focusing on security"
url="https://github.com/securego/gosec"
arch="all"
license="Apache-2.0"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/securego/gosec/archive/refs/tags/v$pkgver.tar.gz"
# downloads go deps into GOBIN and runs them
options="!check"

export GOBIN=/tmp
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	make PREFIX="/usr" VERSION="$pkgver"
}

check() {
	make test
}

package() {
	install -Dm755 gosec -t "$pkgdir"/usr/bin
}

sha512sums="
6e8010a776e1dab37fa69b9131a7f5eaaa4a8607d08dda5874067b64aec3b15de7a2272349be30ead8f2452067c730f27022c46ed08a987a20eaa6946d6d8b4e  gosec-2.21.4.tar.gz
"
