Initial Commit

This commit is contained in:
2026-01-25 14:20:02 +01:00
commit e8a06373c4
6 changed files with 176 additions and 0 deletions

15
.SRCINFO Normal file
View File

@@ -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

12
.editorconfig Normal file
View File

@@ -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

6
.gitignore vendored Normal file
View File

@@ -0,0 +1,6 @@
pkg
src
*tar.gz
*tar.zst
*tar.zst.sig
*zip

75
PKGBUILD Normal file
View File

@@ -0,0 +1,75 @@
# Maintainer: Markus Pesch <markus.pesch plus apps at cryptic.systems>
pkgname=opa-regal
_pkgname=regal
pkgver=0.38.0 # renovate: datasource=github-tags depName=open-policy-agent/regal extractVersion='^v?(?<version>.*)$'
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"
}

61
README.md Normal file
View File

@@ -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
```

7
renovate.json Normal file
View File

@@ -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"
]
}