From e8a06373c4c053502ceafd05df8e5d4b290089e9 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Sun, 25 Jan 2026 14:20:02 +0100 Subject: [PATCH] Initial Commit --- .SRCINFO | 15 +++++++++++ .editorconfig | 12 +++++++++ .gitignore | 6 +++++ PKGBUILD | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 61 +++++++++++++++++++++++++++++++++++++++++ renovate.json | 7 +++++ 6 files changed, 176 insertions(+) create mode 100644 .SRCINFO create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 PKGBUILD create mode 100644 README.md create mode 100644 renovate.json diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..28907f3 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,15 @@ +pkgbase = opa-regal + pkgdesc = Regal is a linter and language server for Rego + pkgver = 0.38.0 + pkgrel = 1 + url = https://github.com/open-policy-agent/regal + arch = armv7h + arch = aarch64 + arch = x86_64 + license = Apache 2.0 + makedepends = go + source = https://github.com/open-policy-agent/regal/archive/refs/tags/v0.38.0.zip + sha512sums = 5d6f093b17743d22d0fa65e850f8e55f5b55150d48d66b185af46858977ad7df51f6071ed987a3d4bcbf5e068e6e2735f5cf256f19b61b2fd3fac2a9822e117e + b2sums = 2a6f8bef4ec0f77aad7544d83d8b759ab45278fd66edee207073870c08a53b599bbcbbef4c6a2ecbaeaa8d82a015b4822417d2f2c02501086bc1209ec78b9fca + +pkgname = opa-regal diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..1166a4a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = false \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9c60cd8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +pkg +src +*tar.gz +*tar.zst +*tar.zst.sig +*zip \ No newline at end of file diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..872adcc --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,75 @@ +# Maintainer: Markus Pesch + +pkgname=opa-regal +_pkgname=regal +pkgver=0.38.0 # renovate: datasource=github-tags depName=open-policy-agent/regal extractVersion='^v?(?.*)$' +pkgrel=1 +pkgdesc="Regal is a linter and language server for Rego" +arch=('armv7h' 'aarch64' 'x86_64') +url="https://github.com/open-policy-agent/${_pkgname}" +license=('Apache 2.0') +makedepends=('go') +source=( + "$url/archive/refs/tags/v${pkgver}.zip" +) +sha512sums=('5d6f093b17743d22d0fa65e850f8e55f5b55150d48d66b185af46858977ad7df51f6071ed987a3d4bcbf5e068e6e2735f5cf256f19b61b2fd3fac2a9822e117e') +b2sums=('2a6f8bef4ec0f77aad7544d83d8b759ab45278fd66edee207073870c08a53b599bbcbbef4c6a2ecbaeaa8d82a015b4822417d2f2c02501086bc1209ec78b9fca') + +prepare() { + cd ${_pkgname}-${pkgver} + + export GONOSUMDB="${GONOSUMDB}" + export GOPATH="${srcdir}" + export GOPROXY="${GOPROXY}" + + env | sort | grep -E '^C?GO' + + go mod download -modcacherw +} + +build() { + cd "${_pkgname}-${pkgver}" + + # https://wiki.archlinux.org/title/Go_package_guidelines + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + + export GONOSUMDB="${GONOSUMDB}" + export GOPATH="${srcdir}" + export GOPROXY="${GOPROXY}" + + env | sort | grep -E '^C?GO' + + go build -v \ + -buildmode=pie \ + -mod=readonly \ + -modcacherw \ + -ldflags "\ + -s -w + -X github.com/open-policy-agent/regal/pkg/version.Version=${pkgver} + -X github.com/open-policy-agent/regal/pkg/version.Commit=${pkgver} + -X github.com/open-policy-agent/regal/pkg/version.Timestamp=$(date --iso-8601=seconds) + -X github.com/open-policy-agent/regal/pkg/version.Hostname=AUR + " \ + -trimpath \ + -o ${_pkgname} . + + ${_pkgname} completion bash > ${_pkgname}.bash + ${_pkgname} completion fish > ${_pkgname}.fish + ${_pkgname} completion zsh > ${_pkgname}.zsh +} + +package() { + # binary + install -D --mode 0755 "${_pkgname}-${pkgver}/${_pkgname}" "$pkgdir/usr/bin/${_pkgname}" + + # completions + install -D --mode 0644 "${_pkgname}-${pkgver}/${_pkgname}.bash" "$pkgdir/usr/share/bash-completion/completions/${_pkgname}" + install -D --mode 0644 "${_pkgname}-${pkgver}/${_pkgname}.fish" "$pkgdir/usr/share/fish/vendor_completions.d/${_pkgname}.fish" + install -D --mode 0644 "${_pkgname}-${pkgver}/${_pkgname}.zsh" "$pkgdir/usr/share/zsh/site-functions/_${_pkgname}" + + # license + install -D --mode 0755 "${_pkgname}-${pkgver}/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..b67d80f --- /dev/null +++ b/README.md @@ -0,0 +1,61 @@ +# opa-regal + +![AUR version](https://img.shields.io/aur/version/opa-regal?label=AUR) +![AUR votes](https://img.shields.io/aur/votes/opa-regal) + +This repository contains build files to build the Arch Linux package `opa-regal`. Instead of building the package +yourself, it can also be obtained from the following private repository. More detailed are described +[here](#obtaining-pre-built-packages-from-a-repository). + +## Build + +Clone this repository and use `makepkg` to build the package by yourself. For example: + +```bash +git clone https://aur.archlinux.org/opa-regal.git +cd opa-regal +makepkg +``` + +## Yay + +The build files are also available via AUR and can be installed via an AUR helper like `yay`. + +```bash +yay --sync --aur opa-regal +``` + +## Obtaining pre-built packages from a repository + +Instead of building the packages locally, it is also possible to configure an additional repository to install the +package directly via `pacman`. The following commands are used to create the repository, configure the GPG key to verify +the packages and install the package: + +```bash +# Create drop-in directory +sudo mkdir --parents /etc/pacman.d/repos + +# Create configuration of the repository 'volker.raschek' +sudo tee /etc/pacman.d/repos/volker.raschek.conf > /dev/null <<'EOF' +[volker.raschek] +SigLevel = PackageRequired TrustedOnly +Include = /etc/pacman.d/repos/volker.raschek.list +EOF + +# Create mirror list of the repository 'volker.raschek' +sudo tee /etc/pacman.d/repos/volker.raschek.list > /dev/null <<'EOF' +Server = https://aur.cryptic.systems/$repo/$arch +EOF + +# Import gpg key of the repository 'volker.raschek' +sudo pacman-key --keyserver hkps://keys.openpgp.org --recv-keys 9B146D11A9ED6CA7E279EB1A852BCC170D81A982 + +# Extend existing pacman configuration of the repository 'volker.raschek' +sudo echo "Include = /etc/pacman.d/repos/*.conf" >> /etc/pacman.conf + +# Update pacman cache +sudo pacman --sync --refresh + +# Install the package and receive updates directly via pacman :) +sudo pacman --sync opa-regal +``` diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..29b2cb9 --- /dev/null +++ b/renovate.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "local>volker.raschek/renovate-config:default#master", + "local>volker.raschek/renovate-config:regexp#master" + ] +} \ No newline at end of file