From bc29b809129a91b7c38827ff8423c014383f3f7e Mon Sep 17 00:00:00 2001 From: Aurel Canciu Date: Mon, 30 Nov 2020 21:18:46 +0200 Subject: [PATCH] Add PKGBUILD templates Signed-off-by: Aurel Canciu --- ci/aur/flux-bin/.SRCINFO.template | 17 ++++++++++++ ci/aur/flux-bin/PKGBUILD.template | 39 +++++++++++++++++++++++++++ ci/aur/flux-git/.SRCINFO.template | 19 +++++++++++++ ci/aur/flux-git/PKGBUILD.template | 45 +++++++++++++++++++++++++++++++ ci/aur/flux-go/.SRCINFO.template | 19 +++++++++++++ ci/aur/flux-go/PKGBUILD.template | 43 +++++++++++++++++++++++++++++ 6 files changed, 182 insertions(+) create mode 100644 ci/aur/flux-bin/.SRCINFO.template create mode 100644 ci/aur/flux-bin/PKGBUILD.template create mode 100644 ci/aur/flux-git/.SRCINFO.template create mode 100644 ci/aur/flux-git/PKGBUILD.template create mode 100644 ci/aur/flux-go/.SRCINFO.template create mode 100644 ci/aur/flux-go/PKGBUILD.template diff --git a/ci/aur/flux-bin/.SRCINFO.template b/ci/aur/flux-bin/.SRCINFO.template new file mode 100644 index 00000000..7f20ef92 --- /dev/null +++ b/ci/aur/flux-bin/.SRCINFO.template @@ -0,0 +1,17 @@ +pkgbase = flux-bin + pkgdesc = Open and extensible continuous delivery solution for Kubernetes + pkgver = ${PKGVER} + pkgrel = ${PKGREL} + url = https://fluxcd.io/ + arch = x86_64 + arch = armv6h + arch = armv7h + arch = aarch64 + license = APACHE + optdepends = kubectl + source_x86_64 = flux-bin-${PKGVER}.tar.gz::https://github.com/fluxcd/flux2/releases/download/v1/flux_${PKGVER}_linux_amd64.tar.gz + source_armv6h = flux-bin-${PKGVER}.tar.gz::https://github.com/fluxcd/flux2/releases/download/v1/flux_${PKGVER}_linux_arm.tar.gz + source_armv7h = flux-bin-${PKGVER}.tar.gz::https://github.com/fluxcd/flux2/releases/download/v1/flux_${PKGVER}_linux_arm.tar.gz + source_aarch64 = flux-bin-${PKGVER}.tar.gz::https://github.com/fluxcd/flux2/releases/download/v1/flux_${PKGVER}_linux_arm64.tar.gz + +pkgname = flux-bin diff --git a/ci/aur/flux-bin/PKGBUILD.template b/ci/aur/flux-bin/PKGBUILD.template new file mode 100644 index 00000000..6bb09e17 --- /dev/null +++ b/ci/aur/flux-bin/PKGBUILD.template @@ -0,0 +1,39 @@ +# Maintainer: Aurel Canciu +# Maintainer: Hidde Beydals + +pkgname=flux-bin +pkgver=${PKGVER} +pkgrel=${PKGREL} +pkgdesc="Open and extensible continuous delivery solution for Kubernetes" +url="https://fluxcd.io/" +arch=("x86_64" "armv6h" "armv7h" "aarch64") +license=("APACHE") +optdepends=("kubectl") +source_x86_64=( + "$pkgname-$pkgver.tar.gz::https://github.com/fluxcd/flux2/releases/download/v${pkgver}/flux_${pkgver}_linux_amd64.tar.gz" +) +source_armv6h=( + "$pkgname-$pkgver.tar.gz::https://github.com/fluxcd/flux2/releases/download/v${pkgver}/flux_${pkgver}_linux_arm.tar.gz" +) +source_armv7h=( + "$pkgname-$pkgver.tar.gz::https://github.com/fluxcd/flux2/releases/download/v${pkgver}/flux_${pkgver}_linux_arm.tar.gz" +) +source_aarch64=( + "$pkgname-$pkgver.tar.gz::https://github.com/fluxcd/flux2/releases/download/v${pkgver}/flux_${pkgver}_linux_arm64.tar.gz" +) +sha256sums_x86_64=( + ${SHA256SUM_AMD64} +) +sha256sums_armv6h=( + ${SHA256SUM_ARM} +) +sha256sums_armv7h=( + ${SHA256SUM_ARM} +) +sha256sums_aarch64=( + ${SHA256SUM_ARM64} +) + +package() { + install -Dm755 flux "$pkgdir/usr/bin/flux" +} diff --git a/ci/aur/flux-git/.SRCINFO.template b/ci/aur/flux-git/.SRCINFO.template new file mode 100644 index 00000000..54ce3ad2 --- /dev/null +++ b/ci/aur/flux-git/.SRCINFO.template @@ -0,0 +1,19 @@ +pkgbase = flux-git + pkgdesc = Open and extensible continuous delivery solution for Kubernetes + pkgver = ${PKGVER} + pkgrel = ${PKGREL} + url = https://fluxcd.io/ + arch = x86_64 + arch = armv6h + arch = armv7h + arch = aarch64 + license = APACHE + makedepends = go + depends = glibc + optdepends = kubectl + provides = flux-bin + conflicts = flux-bin + source = git+https://github.com/fluxcd/flux2.git + md5sums = SKIP + +pkgname = flux-git diff --git a/ci/aur/flux-git/PKGBUILD.template b/ci/aur/flux-git/PKGBUILD.template new file mode 100644 index 00000000..4d3a233d --- /dev/null +++ b/ci/aur/flux-git/PKGBUILD.template @@ -0,0 +1,45 @@ +# Maintainer: Aurel Canciu +# Maintainer: Hidde Beydals + +pkgname=flux-git +pkgver=${PKGVER} +pkgrel=${PKGREL} +pkgdesc="Open and extensible continuous delivery solution for Kubernetes" +url="https://fluxcd.io/" +arch=("x86_64" "armv6h" "armv7h" "aarch64") +license=("APACHE") +provides=("flux-bin") +conflicts=("flux-bin") +depends=("glibc") +makedepends=("go") +optdepends=("kubectl") +source=( + "git+https://github.com/fluxcd/flux2.git" +) +md5sums=('SKIP') + +pkgver() { + cd "flux2" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +build() { + cd "flux2" + export CGO_LDFLAGS="$LDFLAGS" + export CGO_CFLAGS="$CFLAGS" + export CGO_CXXFLAGS="$CXXFLAGS" + export CGO_CPPFLAGS="$CPPFLAGS" + export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" + go build -ldflags "-X main.VERSION=$pkgver" -o flux-bin ./cmd/flux +} + +check() { + cd "flux2" + make test +} + +package() { + cd "flux2" + install -Dm755 flux-bin "$pkgdir/usr/bin/flux" + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} diff --git a/ci/aur/flux-go/.SRCINFO.template b/ci/aur/flux-go/.SRCINFO.template new file mode 100644 index 00000000..ba0cfd77 --- /dev/null +++ b/ci/aur/flux-go/.SRCINFO.template @@ -0,0 +1,19 @@ +pkgbase = flux-go + pkgdesc = Open and extensible continuous delivery solution for Kubernetes + pkgver = ${PKGVER} + pkgrel = ${PKGREL} + url = https://fluxcd.io/ + arch = x86_64 + arch = armv6h + arch = armv7h + arch = aarch64 + license = APACHE + makedepends = go + depends = glibc + optdepends = kubectl + provides = flux-bin + conflicts = flux-bin + replaces = flux-cli + source = flux-go-${PKGVER}.tar.gz::https://github.com/fluxcd/flux2/archive/v${PKGVER}.tar.gz + +pkgname = flux-go diff --git a/ci/aur/flux-go/PKGBUILD.template b/ci/aur/flux-go/PKGBUILD.template new file mode 100644 index 00000000..c5747339 --- /dev/null +++ b/ci/aur/flux-go/PKGBUILD.template @@ -0,0 +1,43 @@ +# Maintainer: Aurel Canciu +# Maintainer: Hidde Beydals + +pkgname=flux-go +pkgver=${PKGVER} +pkgrel=${PKGREL} +pkgdesc="Open and extensible continuous delivery solution for Kubernetes" +url="https://fluxcd.io/" +arch=("x86_64" "armv6h" "armv7h" "aarch64") +license=("APACHE") +provides=("flux-bin") +conflicts=("flux-bin") +replaces=("flux-cli") +depends=("glibc") +makedepends=("go") +optdepends=("kubectl") +source=( + "$pkgname-$pkgver.tar.gz::https://github.com/fluxcd/flux2/archive/v$pkgver.tar.gz" +) +sha256sums=( + ${SHA256SUM} +) + +build() { + cd "flux2-$pkgver" + export CGO_LDFLAGS="$LDFLAGS" + export CGO_CFLAGS="$CFLAGS" + export CGO_CXXFLAGS="$CXXFLAGS" + export CGO_CPPFLAGS="$CPPFLAGS" + export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" + go build -ldflags "-X main.VERSION=$pkgver" -o flux-bin ./cmd/flux +} + +check() { + cd "flux2-$pkgver" + make test +} + +package() { + cd "flux2-$pkgver" + install -Dm755 flux-bin "$pkgdir/usr/bin/flux" + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +}