blob: 282846abeb05bd4397da772f53416a20a4b6a376 (
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.0.2
pkgrel=1
pkgdesc="Static analysis powered security scanner for your terraform code"
depends=('glibc')
makedepends=('go')
arch=(x86_64)
url="https://github.com/aquasecurity/tfsec"
license=('MIT')
source=("v${pkgver}-${pkgrel}.zip::${url}/archive/refs/tags/v${pkgver}.zip")
sha256sums=('347f96ff1bf9f43439f21eac44578ceddbeab82ffe29f3f11d6d4a5f939cb2a1')
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"
}
|