summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
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