rpmbuilder/rpms/incus/resources/build.sh
Ben Vincent 5cdbe3a6b5
All checks were successful
Build / build-8 (pull_request) Successful in 5m45s
Build / build-9 (pull_request) Successful in 8m54s
feat: enhance GitHub release tracking with pattern support and version extraction
- Add github_release_pattern field to support multi-product repositories
- Implement get_github_releases_by_pattern() for filtered release matching
- Add parse_github_version_release() to extract version-release components
- Update openbao plugin packages with release patterns and correct versions
- Configure openbao-plugins meta package for manual versioning
- Fix HashiCorp package GitHub repository references
- Support complex tag formats like "secrets-consul-v0.1.0" and "v7.1.3-1"

This enables automatic updates for packages sharing GitHub repos while
maintaining proper RPM version/release semantics and backward compatibility.
2025-12-30 22:38:23 +11:00

55 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/bash
set -e
# Install build dependencies
dnf makecache && dnf install -y \
unzip \
libtool \
autoconf \
automake \
gcc \
make \
git \
go \
cowsql-devel \
libacl-devel \
libcap-devel \
libseccomp-devel \
libuv-devel \
raft-devel \
libudev-devel \
lxc-devel \
libsqlite3x-devel \
sqlite-devel \
systemd-rpm-macros \
bash-completion \
gettext \
help2man \
curl-minimal
# Download and extract incus source
curl -L -o /app/incus.tar.gz https://github.com/lxc/incus/archive/refs/tags/v${PACKAGE_VERSION}.tar.gz
tar -C /app -xf incus.tar.gz
# Install specific Go version
curl -L -O https://go.dev/dl/go1.24.1.linux-amd64.tar.gz
rm -rf /usr/local/go
tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz
# Set up Go environment and build incus
export PATH=/usr/local/go/bin:$PATH
pushd /app/incus-${PACKAGE_VERSION}
make deps
export CGO_CFLAGS="-I/root/go/deps/raft/include/ -I/root/go/deps/cowsql/include/"
export CGO_LDFLAGS="-L/root/go/deps/raft/.libs -L/root/go/deps/cowsql/.libs/"
export LD_LIBRARY_PATH="/root/go/deps/raft/.libs/:/root/go/deps/cowsql/.libs/"
export CGO_LDFLAGS_ALLOW="(-Wl,-wrap,pthread_create)|(-Wl,-z,now)"
make build
popd
# Build the RPMs
nfpm pkg --config /app/resources/nfpm_incus.yaml --target /app/dist --packager rpm
nfpm pkg --config /app/resources/nfpm_incus-client.yaml --target /app/dist --packager rpm
nfpm pkg --config /app/resources/nfpm_incus-tools.yaml --target /app/dist --packager rpm