summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerry Y. Chen2021-04-22 02:25:23 +0800
committerJerry Y. Chen2021-04-22 02:25:23 +0800
commite99c42711bed83e70d030fe5b52b5623b412a99a (patch)
treeb8a1f27dce46e7ad2d564b1f769493eb571e4946
downloadaur-e99c42711bed83e70d030fe5b52b5623b412a99a.tar.gz
Fork from Official Community/skaffold 1.20.0-1
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD64
-rw-r--r--build_info.patch23
3 files changed, 106 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..a61d15a74cc
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = skaffold
+ pkgdesc = A command line tool that facilitates continuous development for Kubernetes applications
+ pkgver = 1.20.0
+ pkgrel = 1
+ url = https://github.com/GoogleContainerTools/skaffold
+ arch = x86_64
+ license = Apache
+ makedepends = go
+ depends = docker
+ optdepends = minikube: To use Minikube
+ optdepends = kubectl: For Kubernetes support
+ optdepends = bash-completion: Tab autocompletion
+ source = skaffold-1.20.0.tar.gz::https://github.com/GoogleContainerTools/skaffold/archive/v1.20.0.tar.gz
+ source = build_info.patch
+ sha256sums = d47ee974acf1c4432dab3ecdffeadbe271d2ff8098b811da2e73a04f9d9af957
+ sha256sums = e90797011d2f79c79a6b184a5e9c35c4e5c582622d075b0022675b96fccefc46
+
+pkgname = skaffold
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..f51e0dac8eb
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,64 @@
+# Maintainer Christian Rebischke <chris.rebischke@archlinux.org>
+# Maintainer: Fredy GarcĂ­a <frealgagu at gmail dot com>
+# Maintainer: Maxim Baz <${pkgname} at maximbaz dot com>
+# Contributor: Stefan Cocora <stefan dot cocora at gmail dot com>
+
+pkgname=skaffold
+pkgver=1.20.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")
+makedepends=("go")
+optdepends=(
+ "minikube: To use Minikube"
+ "kubectl: For Kubernetes support"
+ "bash-completion: Tab autocompletion"
+)
+source=(
+ "${pkgname}-${pkgver}.tar.gz::https://github.com/GoogleContainerTools/${pkgname}/archive/v${pkgver}.tar.gz"
+ "build_info.patch"
+)
+sha256sums=('d47ee974acf1c4432dab3ecdffeadbe271d2ff8098b811da2e73a04f9d9af957'
+ 'e90797011d2f79c79a6b184a5e9c35c4e5c582622d075b0022675b96fccefc46')
+_commit="c48e97690d8daffd68141c2a68fcbe3df6f6936a"
+
+prepare() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -Np1 -i "${srcdir}/build_info.patch"
+
+ rm -rf "${srcdir}/gopath"
+ mkdir -p "${srcdir}/gopath/bin"
+ mkdir -p "${srcdir}/gopath/src/github.com/GoogleContainerTools"
+ ln -rTsf "${srcdir}/${pkgname}-${pkgver}" "${srcdir}/gopath/src/github.com/GoogleContainerTools/${pkgname}"
+}
+
+build() {
+ cd "${srcdir}/gopath/src/github.com/GoogleContainerTools/${pkgname}"
+ export GOPATH="${srcdir}/gopath"
+ export PATH="${PATH}:${GOPATH}/bin"
+ export VERSION="v${pkgver}"
+ export COMMIT="${_commit}"
+ export TREE_STATE="clean"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -mod=readonly -modcacherw -x -v -ldflags=-linkmode=external"
+ make install
+
+ # To avoid issues deleting directories next time
+ go clean --modcache
+
+ # Create completion files
+ "${srcdir}/gopath/bin/${pkgname}" completion bash > "${srcdir}/${pkgname}-completion.bash"
+ "${srcdir}/gopath/bin/${pkgname}" completion zsh > "${srcdir}/${pkgname}-completion.zsh"
+}
+
+package() {
+ install -Dm755 "${srcdir}/gopath/bin/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
+ install -Dm644 "${srcdir}/${pkgname}-completion.bash" "${pkgdir}/usr/share/bash-completion/completions/${pkgname}"
+ install -Dm644 "${srcdir}/${pkgname}-completion.zsh" "${pkgdir}/usr/share/zsh/site-functions/_skaffold"
+}
diff --git a/build_info.patch b/build_info.patch
new file mode 100644
index 00000000000..9b587d8219b
--- /dev/null
+++ b/build_info.patch
@@ -0,0 +1,23 @@
+diff --git a/Makefile b/Makefile
+index dd22ea0..aa47490 100644
+--- a/Makefile
++++ b/Makefile
+@@ -35,7 +35,8 @@ SKAFFOLD_TEST_PACKAGES = ./pkg/skaffold/... ./cmd/... ./hack/... ./pkg/webhook/.
+ GO_FILES = $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./pkg/diag/*")
+
+ VERSION_PACKAGE = $(REPOPATH)/pkg/skaffold/version
+-COMMIT = $(shell git rev-parse HEAD)
++COMMIT ?= $(shell git rev-parse HEAD)
++TREE_STATE ?= $(if $(shell git status --porcelain),dirty,clean)
+
+ ifeq "$(strip $(VERSION))" ""
+ override VERSION = $(shell git describe --always --tags --dirty)
+@@ -52,7 +53,7 @@ GO_BUILD_TAGS_windows = "release"
+ 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)
+-GO_LDFLAGS += -X $(VERSION_PACKAGE).gitTreeState=$(if $(shell git status --porcelain),dirty,clean)
++GO_LDFLAGS += -X $(VERSION_PACKAGE).gitTreeState=$(TREE_STATE)
+ GO_LDFLAGS += -s -w
+
+ GO_LDFLAGS_windows =" $(GO_LDFLAGS) -extldflags \"$(LDFLAGS_windows)\""