From 4db58f5d2d6a77b7b100c95dbcf7af8a172387b9 Mon Sep 17 00:00:00 2001 From: unkin-agent Date: Sat, 26 Sep 2026 19:11:26 +1000 Subject: [PATCH] Add go-cache-plugin vendored package Package the tailscale/go-cache-plugin GOCACHEPROG binary for el9 and Fedora 42/43/44. Upstream has no tags, so pin commit 3031b5d and version by its commit date. --- rpms/go-cache-plugin/metadata.yaml | 22 +++++++++++++++++ rpms/go-cache-plugin/resources/build.sh | 17 +++++++++++++ rpms/go-cache-plugin/resources/nfpm.yaml | 31 ++++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 rpms/go-cache-plugin/metadata.yaml create mode 100755 rpms/go-cache-plugin/resources/build.sh create mode 100644 rpms/go-cache-plugin/resources/nfpm.yaml diff --git a/rpms/go-cache-plugin/metadata.yaml b/rpms/go-cache-plugin/metadata.yaml new file mode 100644 index 0000000..dcfa2c5 --- /dev/null +++ b/rpms/go-cache-plugin/metadata.yaml @@ -0,0 +1,22 @@ +name: go-cache-plugin +github: tailscale/go-cache-plugin +description: A GOCACHEPROG implementation that backs the Go build cache with S3. +arch: amd64 +platform: linux +maintainer: Tailscale +homepage: https://github.com/tailscale/go-cache-plugin +license: BSD-3-Clause +dist_tag: true +builds: +- repository: + - almalinux/el9 + image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: 1 + version: 2026.7.22 +- repository: + - fedora/42 + - fedora/43 + - fedora/44 + image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: 1 + version: 2026.7.22 diff --git a/rpms/go-cache-plugin/resources/build.sh b/rpms/go-cache-plugin/resources/build.sh new file mode 100755 index 0000000..760db8d --- /dev/null +++ b/rpms/go-cache-plugin/resources/build.sh @@ -0,0 +1,17 @@ +#!/usr/bin/bash +set -e + +# Upstream publishes no tags or releases; PACKAGE_VERSION dates this commit. +COMMIT=3031b5d01c50d2748a32c7c9386ea7049883f38e + +# go.mod requires go 1.26.1 +export GOTOOLCHAIN=go1.26.1 + +# Compile the go-cache-plugin binary using Go +GOBIN=/app go install github.com/tailscale/go-cache-plugin/cmd/go-cache-plugin@${COMMIT} + +# Process nfpm.yaml with envsubst +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +# Build the RPM +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm diff --git a/rpms/go-cache-plugin/resources/nfpm.yaml b/rpms/go-cache-plugin/resources/nfpm.yaml new file mode 100644 index 0000000..cdbac3a --- /dev/null +++ b/rpms/go-cache-plugin/resources/nfpm.yaml @@ -0,0 +1,31 @@ +# nfpm.yaml + +name: ${PACKAGE_NAME} +version: ${PACKAGE_VERSION} +release: ${PACKAGE_RELEASE} +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} +section: default +priority: extra +description: "${PACKAGE_DESCRIPTION}" + +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} + +disable_globbing: false + +replaces: + - go-cache-plugin + +provides: + - go-cache-plugin + +# Files to include in the package +contents: + - src: /app/go-cache-plugin + dst: /usr/bin/go-cache-plugin + file_info: + mode: 0755 + owner: root + group: root