summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorDimitris Kiziridis2020-05-20 08:23:42 +0300
committerDimitris Kiziridis2020-05-20 08:23:42 +0300
commitfd4ff398a5e324716866c2f69911e10983a6a5a2 (patch)
tree9171464c0c44313d556613257594fbb6fdc82b10 /PKGBUILD
parent93e53f92ee18df365ce924d117eb51c17f41adf9 (diff)
downloadaur-clair.tar.gz
update pkgbuild, go-pie replaced
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD22
1 files changed, 13 insertions, 9 deletions
diff --git a/PKGBUILD b/PKGBUILD
index ce467b3fabb..c758fe460d1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -9,24 +9,28 @@ arch=('x86_64')
url='https://github.com/coreos/clair'
license=('Apache')
depends=('rpm-tools' 'postgresql' 'glibc')
-makedepends=('go-pie')
+makedepends=('go')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/quay/clair/archive/v${_pkgver}.tar.gz")
sha256sums=('f280ce47977c2ac41ec23569a7f142ead55968ed10fe2cf3e5986c18e442339b')
+prepare() {
+ cd "${srcdir}/${pkgname}-${_pkgver}"
+ mkdir -p build/
+}
+
build() {
cd "${srcdir}/${pkgname}-${_pkgver}"
- mkdir -p build
- export GOPATH="${srcdir}/go" PATH="${srcdir}/go/bin:${PATH}"
- go build \
- -ldflags "-s -w -X github.com/coreos/clair/pkg/version.Version=${pkgver}" \
- -gcflags="all=-trimpath=${GOPATH}/src" \
- -asmflags="all=-trimpath=${GOPATH}/src" \
- -o build/clair -v ./cmd/clair
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
+ go build -o build ./...
}
package() {
cd "${srcdir}/${pkgname}-${_pkgver}"
- install -Dm755 "build/clair" "${pkgdir}/usr/bin/clair"
+ install -Dm755 build/clair "${pkgdir}/usr/bin/clair"
install -Dm755 "config.yaml.sample" "${pkgdir}/etc/clair/config.yaml"
go clean -modcache # clean modcache
} \ No newline at end of file