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