blob: a66f6891c4dd3987209b2a29ceebb66a9d1bbd6e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# Maintainer: Mathias Merscher <archlinux@rheinekopfsache.de>
# Maintainer: Yoan Blanc <yoan@dosimple.ch>
pkgname=tfsec
pkgver=1.15.1
pkgrel=1
pkgdesc="Static analysis powered security scanner for your terraform code"
depends=('glibc')
makedepends=('go')
arch=('aarch64' 'x86_64')
url="https://github.com/aquasecurity/tfsec"
license=('MIT')
source=("v${pkgver}-${pkgrel}.zip::${url}/archive/refs/tags/v${pkgver}.zip")
sha256sums=('fd8d679c1cc0f277fcb5ce5297c5cbb6d4627ebf721fcc4e0032d1d0f3bc49aa')
build() {
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
_flags=(
-X=github.com/aquasecurity/tfsec/version.Version=v${pkgver}
-s -w
-linkmode=external
)
cd "${pkgname}-${pkgver}"
go build \
-buildmode=pie \
-trimpath \
-modcacherw \
-mod=readonly \
-ldflags="${_flags[*]}" \
-o "${pkgname}" \
./cmd/"${pkgname}"
}
check () {
cd "${pkgname}-${pkgver}"
go test -v ./...
}
package() {
install -D -m755 "${srcdir}/${pkgname}-${pkgver}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
install -D -m644 "${srcdir}/${pkgname}-${pkgver}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
|