# Maintainer: Hao Long pkgname=gosec pkgver=2.13.1 pkgrel=1 pkgdesc="Inspects source code for security problems by scanning the Go AST" arch=("x86_64" "i686") url="https://github.com/securego/gosec" license=("Apache") depends=("glibc") makedepends=("go") source=("${pkgname}-${pkgver}.tar.gz::https://github.com/securego/gosec/archive/v${pkgver}.tar.gz") b2sums=('f64c5f5947daa49647bc105ca5f33390244f195cc1433fe5a94540ca5a83a1ba2bd3d307e5c73c63a97f4660b495778c43dc5ed99b366d202875ba8a7d36ec5a') build() { cd ${pkgname}-${pkgver}/cmd/gosec export CGO_CPPFLAGS="${CPPFLAGS}" export CGO_CFLAGS="${CFLAGS}" export CGO_CXXFLAGS="${CXXFLAGS}" export CGO_LDFLAGS="${LDFLAGS}" export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" go build . } package() { cd ${pkgname}-${pkgver} install -Dm644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE install -Dm755 cmd/gosec/gosec ${pkgdir}/usr/bin/gosec }