diff options
author | Maxim Baz | 2018-11-14 22:15:42 +0100 |
---|---|---|
committer | Maxim Baz | 2018-11-14 22:22:40 +0100 |
commit | cf4be235344435e6986547635191b07ae3789eac (patch) | |
tree | 026ae6568fa81f140d69d940cff55e6475fff8e5 | |
parent | 7ec7498de61014a31ef6c1b1c2aee1933640cd14 (diff) | |
download | aur-cf4be235344435e6986547635191b07ae3789eac.tar.gz |
skaffold: compile from sources with RELRO, make reproducible
-rw-r--r-- | .SRCINFO | 11 | ||||
-rw-r--r-- | PKGBUILD | 41 | ||||
-rw-r--r-- | build_flags.patch | 34 |
3 files changed, 71 insertions, 15 deletions
@@ -1,16 +1,19 @@ pkgbase = skaffold pkgdesc = A command line tool that facilitates continuous development for Kubernetes applications pkgver = 0.18.0 - pkgrel = 1 + pkgrel = 2 url = https://github.com/GoogleContainerTools/skaffold arch = x86_64 - license = APACHE + license = Apache + makedepends = go-pie depends = docker depends = kubectl-bin optdepends = google-cloud-sdk: To use GKE optdepends = minikube: To use Minikube - source = skaffold-0.18.0::https://storage.googleapis.com/skaffold/releases/v0.18.0/skaffold-linux-amd64 - sha256sums = 00de742c8052cacff5812d3aa4e4192d6e27e05652a6949fa4152fa18f359935 + source = skaffold-0.18.0::https://github.com/GoogleContainerTools/skaffold/archive/v0.18.0.tar.gz + source = build_flags.patch + sha256sums = 3ec621485d2ebeac3366346271527326c3c97115784597bff457ccce162be008 + sha256sums = 03be8856eec2169b72fae7369ce11c32a66cd49638e4e68bae7f63b0d5519a6a pkgname = skaffold @@ -1,18 +1,37 @@ # Maintainer: Fredy GarcĂa <frealgagu at gmail dot com> +# Maintainer: Maxim Baz <$pkgbuild at maximbaz dot com> +_pkgauthor=GoogleContainerTools pkgname=skaffold pkgver=0.18.0 -pkgrel=1 -pkgdesc="A command line tool that facilitates continuous development for Kubernetes applications" -arch=("x86_64") -url="https://github.com/GoogleContainerTools/${pkgname}" -license=("APACHE") -depends=("docker" "kubectl-bin") -optdepends=("google-cloud-sdk: To use GKE" - "minikube: To use Minikube") -source=("${pkgname}-${pkgver}::https://storage.googleapis.com/${pkgname}/releases/v${pkgver}/${pkgname}-linux-amd64") -sha256sums=("00de742c8052cacff5812d3aa4e4192d6e27e05652a6949fa4152fa18f359935") +pkgrel=2 +pkgdesc='A command line tool that facilitates continuous development for Kubernetes applications' +arch=('x86_64') +url="https://github.com/$_pkgauthor/$pkgname" +license=('Apache') +depends=('docker' 'kubectl-bin') +makedepends=('go-pie') +optdepends=('google-cloud-sdk: To use GKE' + 'minikube: To use Minikube') +source=("$pkgname-$pkgver::https://github.com/$_pkgauthor/$pkgname/archive/v$pkgver.tar.gz" + 'build_flags.patch') +sha256sums=('3ec621485d2ebeac3366346271527326c3c97115784597bff457ccce162be008' + '03be8856eec2169b72fae7369ce11c32a66cd49638e4e68bae7f63b0d5519a6a') + +prepare() { + mkdir -p "gopath/src/github.com/$_pkgauthor" + ln -rTsf "$pkgname-$pkgver" "gopath/src/github.com/$_pkgauthor/$pkgname" + + cd "$pkgname-$pkgver" + patch -Np1 -i ../build_flags.patch +} + +build() { + export GOPATH="$srcdir/gopath" + cd "gopath/src/github.com/$_pkgauthor/$pkgname" + VERSION="v$pkgver" make install +} package() { - install -Dm755 "${srcdir}/${pkgname}-${pkgver}" "${pkgdir}/usr/bin/${pkgname}" + install -Dm755 "gopath/bin/$pkgname" "$pkgdir/usr/bin/$pkgname" } diff --git a/build_flags.patch b/build_flags.patch new file mode 100644 index 000000000000..da945a0b1cb3 --- /dev/null +++ b/build_flags.patch @@ -0,0 +1,34 @@ +diff --git a/Makefile b/Makefile +index caa9d41f..f8516e59 100644 +--- a/Makefile ++++ b/Makefile +@@ -36,7 +36,11 @@ VERSION_PACKAGE = $(REPOPATH)/pkg/skaffold/version + COMMIT = $(shell git rev-parse HEAD) + VERSION ?= $(shell git describe --always --tags --dirty) + ++GO_GCFLAGS := "all=-trimpath=${PWD}" ++GO_ASMFLAGS := "all=-trimpath=${PWD}" ++ + GO_LDFLAGS :=" ++GO_LDFLAGS += -extldflags \"${LDFLAGS}\" + GO_LDFLAGS += -X $(VERSION_PACKAGE).version=$(VERSION) + GO_LDFLAGS += -X $(VERSION_PACKAGE).buildDate=$(shell date +'%Y-%m-%dT%H:%M:%SZ') + GO_LDFLAGS += -X $(VERSION_PACKAGE).gitCommit=$(COMMIT) +@@ -50,7 +54,7 @@ $(BUILD_DIR)/$(PROJECT): $(BUILD_DIR)/$(PROJECT)-$(GOOS)-$(GOARCH) + cp $(BUILD_DIR)/$(PROJECT)-$(GOOS)-$(GOARCH) $@ + + $(BUILD_DIR)/$(PROJECT)-%-$(GOARCH): $(GO_FILES) $(BUILD_DIR) +- GOOS=$* GOARCH=$(GOARCH) CGO_ENABLED=0 go build -ldflags $(GO_LDFLAGS) -tags $(GO_BUILD_TAGS) -o $@ $(BUILD_PACKAGE) ++ GOOS=$* GOARCH=$(GOARCH) CGO_ENABLED=0 go build -ldflags $(GO_LDFLAGS) -gcflags $(GO_GCFLAGS) -asmflags $(GO_ASMFLAGS) -tags $(GO_BUILD_TAGS) -o $@ $(BUILD_PACKAGE) + + %.sha256: % + shasum -a 256 $< > $@ +@@ -76,7 +80,7 @@ test: + + .PHONY: install + install: $(GO_FILES) $(BUILD_DIR) +- GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=0 go install -ldflags $(GO_LDFLAGS) -tags $(GO_BUILD_TAGS) $(BUILD_PACKAGE) ++ GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=0 go install -ldflags $(GO_LDFLAGS) -gcflags $(GO_GCFLAGS) -asmflags $(GO_ASMFLAGS) -tags $(GO_BUILD_TAGS) $(BUILD_PACKAGE) + + .PHONY: integration + integration: install $(BUILD_DIR)/$(PROJECT) |