upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / trivy / repos / community-x86_64 / PKGBUILD
blobd0ba9430533dbf705a5c171e8b85236ba5323546
1 # Maintainer: Justin Kromlinger <hashworks@archlinux.org>
2 # Contributor: Hao Long <imlonghao@archlinuxcn.org>
4 pkgname=trivy
5 pkgver=0.41.0
6 pkgrel=1
7 pkgdesc='A Simple and Comprehensive Vulnerability Scanner for Containers, Suitable for CI'
8 arch=('x86_64')
9 url='https://github.com/aquasecurity/trivy'
10 license=('Apache')
11 depends=('glibc')
12 optdepends=('rpm: RHEL/CentOS based image support')
13 makedepends=('go' 'btrfs-progs')
14 provides=('trivy')
15 conflicts=('trivy')
16 source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz")
17 b2sums=('48e8cc03137d653ff434f2b29baf01b8a862df9ae59ce14eed958ff8b5e56c726d74d38faa539cb6c16855b4cae9f76c4010397fae3d967bf5aad954db0181f7')
19 prepare() {
20   cd ${pkgname}-${pkgver}
22   find docs -type f -name "*.md" \
23     -exec sed "s|\(../\)*imgs/\(.*\.[a-z]\{3\}\)|${url}/raw/main/docs/imgs/\2|g" -i {} \;
25   rm -Rf docs/{build,imgs}
28 build() {
29   cd ${pkgname}-${pkgver}/cmd/trivy
31   export CGO_CPPFLAGS="${CPPFLAGS}"
32   export CGO_CFLAGS="${CFLAGS}"
33   export CGO_CXXFLAGS="${CXXFLAGS}"
34   export CGO_LDFLAGS="${LDFLAGS}"
35   export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
36   go build -ldflags "-linkmode=external -s -w -X=main.version=${pkgver}" .
39 package() {
40   cd ${pkgname}-${pkgver}
42   install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
43   install -Dm755 "cmd/trivy/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
45   mkdir -p "${pkgdir}/usr/share/doc"
46   cp -r docs "${pkgdir}/usr/share/doc/${pkgname}"