summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD43
1 files changed, 36 insertions, 7 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 9313ca0233d7..92454e544433 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,16 +1,45 @@
-# Maintainer: tercean <cg@zknt.org>
+# Maintainer: Josephine Pfeiffer <jpfeiffe@redhat.com>
pkgname=tekton-cli-bin
-pkgver=0.19.1
+pkgver=0.29.1
pkgrel=1
pkgdesc='A CLI for interacting with Tekton.'
arch=('x86_64')
url='https://github.com/tektoncd/cli'
-license=('Apache')
-provides=('tekton-cli')
-source=("https://github.com/tektoncd/cli/releases/download/v${pkgver}/tkn_${pkgver}_Linux_x86_64.tar.gz")
-sha256sums=('3e246a60e4ace03c394e18590ec0ec1a0cb14393008833acd75a6889fe91ffc2')
+license=('Apache-2.0')
+makedepends=(git go)
+conflicts=(tektoncd-cli tekton-cli)
+_commit="d48a2cc72e7f695b4a90cee62678fd9764a7db85" # v0.29.1
+source=("git+$url#commit=$_commit")
+sha256sums=('SKIP')
+
+pkgver() {
+ cd "$srcdir/cli"
+ git describe --tags | sed 's/^v//;s/-/+/g'
+}
+
+prepare(){
+ cd "$srcdir/cli"
+ mkdir -p build/
+}
+
+build() {
+ cd "$srcdir/cli"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+ go build -o build ./cmd/tkn
+}
+
+check() {
+ cd "$srcdir/cli"
+ go test -v $(go list ./... | grep -v third_party/)
+}
package() {
- install -Dm 755 "$srcdir/tkn" "${pkgdir}/usr/bin/tkn"
+ cd "$srcdir/cli"
+ install -Dm755 build/tkn "$pkgdir"/usr/bin/tkn
+ install -Dm644 LICENSE "$pkgdir/usr/share/licenses/tkn/LICENSE"
}