upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / skaffold / trunk / PKGBUILD
blobcb44125b6cf313bf033bd5977516b2f5f77e8bf3
1 # Maintainer Christian Rebischke <chris.rebischke@archlinux.org>
2 # Maintainer: Fredy GarcĂ­a <frealgagu at gmail dot com>
3 # Maintainer: Maxim Baz <${pkgname} at maximbaz dot com>
4 # Contributor: Stefan Cocora <stefan dot cocora at gmail dot com>
6 pkgname=skaffold
7 pkgver=2.0.1
8 pkgrel=1
9 pkgdesc="A command line tool that facilitates continuous development for Kubernetes applications"
10 arch=("x86_64")
11 url="https://github.com/GoogleContainerTools/${pkgname}"
12 license=("Apache")
13 depends=("docker" "kompose")
14 makedepends=("go" "go-licenses")
15 optdepends=(
16   "minikube: To use Minikube"
17   "kubectl: For Kubernetes support"
18   "bash-completion: Tab autocompletion"
20 source=(
21   "${pkgname}-${pkgver}.tar.gz::https://github.com/GoogleContainerTools/${pkgname}/archive/v${pkgver}.tar.gz"
23 sha256sums=('58ca783891cb1dfe4a1c06027d637a3e699d1fd675b2235cdc8904400cc7744d')
24 b2sums=('b83904e78ac5b08b5c847b41e8e1866e8fc351e70ef1a7582a360de3a1e3f4ab48edc92413d47239de04e868c7a5095247aaf09ddf98291ae89868aa80a09cc8')
25 _commit="7ed1d722b53b55ac1c909f00d00a05b47d0964dd"
27 prepare() {
28   cd "${srcdir}/${pkgname}-${pkgver}"
30   rm -rf "${srcdir}/gopath"
31   mkdir -p "${srcdir}/gopath/bin"
32   mkdir -p "${srcdir}/gopath/src/github.com/GoogleContainerTools"
33   ln -rTsf "${srcdir}/${pkgname}-${pkgver}" "${srcdir}/gopath/src/github.com/GoogleContainerTools/${pkgname}"
36 build() {
37   cd "${srcdir}/gopath/src/github.com/GoogleContainerTools/${pkgname}"
38   export GOPATH="${srcdir}/gopath"
39   export PATH="${PATH}:${GOPATH}/bin"
40   export VERSION="v${pkgver}"
41   export COMMIT="${_commit}"
42   export TREE_STATE="clean"
43   export CGO_CPPFLAGS="${CPPFLAGS}"
44   export CGO_CFLAGS="${CFLAGS}"
45   export CGO_CXXFLAGS="${CXXFLAGS}"
46   export CGO_LDFLAGS="${LDFLAGS}"
47   export GOFLAGS="-buildmode=pie -mod=readonly -modcacherw -x -v -ldflags=-linkmode=external"
48   make install
50   # To avoid issues deleting directories next time
51   go clean --modcache
53   # Create completion files
54   "${srcdir}/gopath/bin/${pkgname}" completion bash > "${srcdir}/${pkgname}-completion.bash"
55   "${srcdir}/gopath/bin/${pkgname}" completion zsh > "${srcdir}/${pkgname}-completion.zsh"
58 package() {
59   install -Dm755 "${srcdir}/gopath/bin/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
60   install -Dm644 "${srcdir}/${pkgname}-completion.bash" "${pkgdir}/usr/share/bash-completion/completions/${pkgname}"
61   install -Dm644 "${srcdir}/${pkgname}-completion.zsh" "${pkgdir}/usr/share/zsh/site-functions/_skaffold"