[arch-commits] Commit in cri-tools/repos (3 files)

David Runge dvzrv at gemini.archlinux.org
Sat Aug 27 08:15:42 UTC 2022


    Date: Saturday, August 27, 2022 @ 08:15:42
  Author: dvzrv
Revision: 1284562

archrelease: copy trunk to community-testing-x86_64

Added:
  cri-tools/repos/community-testing-x86_64/
  cri-tools/repos/community-testing-x86_64/PKGBUILD
    (from rev 1284561, cri-tools/trunk/PKGBUILD)
  cri-tools/repos/community-testing-x86_64/cri-tools-1.24.1-makefile.patch
    (from rev 1284561, cri-tools/trunk/cri-tools-1.24.1-makefile.patch)

---------------------------------+
 PKGBUILD                        |   70 ++++++++++++++++++++++++++++++++++++++
 cri-tools-1.24.1-makefile.patch |   31 ++++++++++++++++
 2 files changed, 101 insertions(+)

Copied: cri-tools/repos/community-testing-x86_64/PKGBUILD (from rev 1284561, cri-tools/trunk/PKGBUILD)
===================================================================
--- community-testing-x86_64/PKGBUILD	                        (rev 0)
+++ community-testing-x86_64/PKGBUILD	2022-08-27 08:15:42 UTC (rev 1284562)
@@ -0,0 +1,70 @@
+# Maintainer: David Runge <dvzrv at archlinux.org>
+
+pkgbase=cri-tools
+pkgname=(crictl critest)
+pkgver=1.25.0
+_commit=a12c2d088df8bea138eaeb5a0217d98b6cf93a44  # v1.25.0
+pkgrel=1
+pkgdesc="CLI and validation tools for Kubelet Container Runtime Interface (CRI)"
+arch=(x86_64)
+url="https://github.com/kubernetes-sigs/cri-tools"
+license=(Apache)
+groups=(kubernetes-tools)
+depends=(glibc)
+makedepends=(git go)
+# can only build from git: https://github.com/kubernetes-sigs/cri-tools/issues/676
+source=(
+  git+https://github.com/kubernetes-sigs/$pkgbase#commit=$_commit
+  $pkgbase-1.24.1-makefile.patch
+)
+sha512sums=('SKIP'
+            'b3c47dfd7a624faecc94627dbcb6279af6927a5c4bd470b244619b2dc24b1afc2a3378491583686e0c763c98191d1f2122afa75cdf9c4f4a7a70e344f5c7e5a4')
+b2sums=('SKIP'
+        '51e53be22879437df77507c1157a80081cfd5db12ecd3f24e3ed7d4f421e79ad8c48347ba3e2888e896b2cbb658a13f61bbbe123e4ed34ef315864e5eef9ca85')
+
+prepare() {
+  # set CGO_ENABLED, honor GOFLAGS and allow adding to GO_LDFLAGS
+  patch -Np1 -d $pkgbase -i ../$pkgbase-1.24.1-makefile.patch
+}
+
+build() {
+  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"
+  # NOTE: this ensures the binaries have full RELRO
+  export GO_LDFLAGS="-linkmode=external"
+
+  make -C $pkgbase
+
+  # crictl shell completion
+  mkdir -vp completions
+  local _binary
+  for _binary in crictl; do
+    $pkgbase/build/bin/$_binary completion bash > completions/$_binary
+    $pkgbase/build/bin/$_binary completion zsh > completions/_$_binary
+  done
+}
+
+package_crictl() {
+  pkgdesc="A CLI for CRI-compatible container runtimes"
+
+  install -vDm 755 $pkgbase/build/bin/$pkgname -t "$pkgdir/usr/bin/"
+  # shell completion
+  install -vDm 644 completions/$pkgname -t "$pkgdir/usr/share/bash-completion/completions/"
+  install -vDm 644 completions/_$pkgname -t "$pkgdir/usr/share/zsh/site-functions/"
+  # docs
+  install -vDm 644 $pkgbase/docs/$pkgname.md -t "$pkgdir/usr/share/doc/$pkgname/"
+  install -vDm 644 $pkgbase/docs/examples/*.{json,yaml} -t "$pkgdir/usr/share/doc/$pkgname/examples/"
+  install -vDm 644 $pkgbase/{{CHANGELOG,CONTRIBUTING,README,code-of-conduct}.md,SECURITY_CONTACTS} -t "$pkgdir/usr/share/doc/$pkgname"
+}
+
+package_critest() {
+  pkgdesc="A benchmarking CLI for CRI-compatible container runtimes"
+
+  install -vDm 755 $pkgbase/build/bin/$pkgname -t "$pkgdir/usr/bin/"
+  # docs
+  install -vDm 644 $pkgbase/docs/{benchmark,validation}.md -t "$pkgdir/usr/share/doc/$pkgname/"
+  install -vDm 644 $pkgbase/{{CHANGELOG,CONTRIBUTING,README,code-of-conduct}.md,SECURITY_CONTACTS} -t "$pkgdir/usr/share/doc/$pkgname/"
+}

Copied: cri-tools/repos/community-testing-x86_64/cri-tools-1.24.1-makefile.patch (from rev 1284561, cri-tools/trunk/cri-tools-1.24.1-makefile.patch)
===================================================================
--- community-testing-x86_64/cri-tools-1.24.1-makefile.patch	                        (rev 0)
+++ community-testing-x86_64/cri-tools-1.24.1-makefile.patch	2022-08-27 08:15:42 UTC (rev 1284562)
@@ -0,0 +1,31 @@
+diff --git i/Makefile w/Makefile
+index f5a11604..6dec06a9 100644
+--- i/Makefile
++++ w/Makefile
+@@ -34,7 +34,7 @@ BINDIR ?= /usr/local/bin
+ 
+ VERSION := $(shell git describe --tags --dirty --always)
+ VERSION := $(VERSION:v%=%)
+-GO_LDFLAGS := -X $(PROJECT)/pkg/version.Version=$(VERSION)
++GO_LDFLAGS := $(GO_LDFLAGS) -X $(PROJECT)/pkg/version.Version=$(VERSION)
+ 
+ BUILD_PATH := $(shell pwd)/build
+ BUILD_BIN_PATH := $(BUILD_PATH)/bin
+@@ -63,7 +63,7 @@ critest:
+ 	@$(MAKE) -B $(CRITEST)
+ 
+ $(CRITEST):
+-	CGO_ENABLED=0 $(GO_TEST) -c -o $@ \
++	CGO_ENABLED=1 $(GO_TEST) -c -o $@ \
+ 		-ldflags '$(GO_LDFLAGS)' \
+ 		-trimpath \
+ 	     $(PROJECT)/cmd/critest
+@@ -72,7 +72,7 @@ crictl:
+ 	@$(MAKE) -B $(CRICTL)
+ 
+ $(CRICTL):
+-	CGO_ENABLED=0 $(GO_BUILD) -o $@ \
++	CGO_ENABLED=1 $(GO_BUILD) -o $@ \
+ 		-ldflags '$(GO_LDFLAGS)' \
+ 		-trimpath \
+ 		$(PROJECT)/cmd/crictl



More information about the arch-commits mailing list