Fix issues in Arch Linux AUR publishing process
This commit is contained in:
18
.SRCINFO
Normal file
18
.SRCINFO
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
pkgbase = numa-git
|
||||||
|
pkgdesc = Portable DNS resolver in Rust — .numa local domains, ad blocking, developer overrides, DNS-over-HTTPS
|
||||||
|
pkgver = 0.9.1.r0.g1234abc
|
||||||
|
pkgrel = 1
|
||||||
|
url = https://github.com/razvandimescu/numa
|
||||||
|
arch = x86_64
|
||||||
|
arch = aarch64
|
||||||
|
license = MIT
|
||||||
|
makedepends = cargo
|
||||||
|
makedepends = git
|
||||||
|
depends = gcc-libs
|
||||||
|
depends = glibc
|
||||||
|
provides = numa
|
||||||
|
conflicts = numa
|
||||||
|
source = numa::git+https://github.com/razvandimescu/numa.git
|
||||||
|
sha256sums = SKIP
|
||||||
|
|
||||||
|
pkgname = numa-git
|
||||||
12
.github/workflows/publish-aur.yml
vendored
12
.github/workflows/publish-aur.yml
vendored
@@ -128,13 +128,15 @@ jobs:
|
|||||||
|
|
||||||
# METADATA GENERATION:
|
# METADATA GENERATION:
|
||||||
# '.SRCINFO' is a machine-readable version of the PKGBUILD.
|
# '.SRCINFO' is a machine-readable version of the PKGBUILD.
|
||||||
# The AUR website uses this file to display package details like dependencies and version.
|
# We must run this as a non-root user ('builduser') inside the container.
|
||||||
# We generate it inside an Arch container to ensure 'makepkg' is available.
|
|
||||||
docker run --rm -v $(pwd):/pkg archlinux:latest /bin/bash -c "
|
docker run --rm -v $(pwd):/pkg archlinux:latest /bin/bash -c "
|
||||||
pacman -Syu --noconfirm --needed binutils git
|
pacman -Syu --noconfirm --needed binutils git sudo
|
||||||
|
useradd -m builduser
|
||||||
|
chown -R builduser:builduser /pkg
|
||||||
cd /pkg
|
cd /pkg
|
||||||
git config --global --add safe.directory '*'
|
sudo -u builduser git config --global --add safe.directory '*'
|
||||||
makepkg --printsrcinfo > .SRCINFO
|
# "makepkg -od" fetches the source first so pkgver() can calculate the version.
|
||||||
|
sudo -u builduser makepkg -od && sudo -u builduser makepkg --printsrcinfo > .SRCINFO
|
||||||
"
|
"
|
||||||
|
|
||||||
# Set the commit identity using secrets for security and auditability.
|
# Set the commit identity using secrets for security and auditability.
|
||||||
|
|||||||
17
PKGBUILD
17
PKGBUILD
@@ -15,34 +15,37 @@ source=("$_pkgname::git+$url.git")
|
|||||||
sha256sums=('SKIP')
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
pkgver() {
|
pkgver() {
|
||||||
cd "$_pkgname"
|
cd "$srcdir/$_pkgname"
|
||||||
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' | sed 's/^v//'
|
( set -o pipefail
|
||||||
|
git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
|
||||||
|
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||||
|
) | sed 's/^v//'
|
||||||
}
|
}
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
cd "$_pkgname"
|
cd "$srcdir/$_pkgname"
|
||||||
export RUSTUP_TOOLCHAIN=stable
|
export RUSTUP_TOOLCHAIN=stable
|
||||||
cargo fetch --locked
|
cargo fetch --locked
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd "$_pkgname"
|
cd "$srcdir/$_pkgname"
|
||||||
export RUSTUP_TOOLCHAIN=stable
|
export RUSTUP_TOOLCHAIN=stable
|
||||||
cargo build --frozen --release
|
cargo build --frozen --release
|
||||||
}
|
}
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
cd "$_pkgname"
|
cd "$srcdir/$_pkgname"
|
||||||
export RUSTUP_TOOLCHAIN=stable
|
export RUSTUP_TOOLCHAIN=stable
|
||||||
cargo test --frozen
|
cargo test --frozen
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
cd "$_pkgname"
|
cd "$srcdir/$_pkgname"
|
||||||
install -Dm755 "target/release/$_pkgname" "$pkgdir/usr/bin/$_pkgname"
|
install -Dm755 "target/release/$_pkgname" "$pkgdir/usr/bin/$_pkgname"
|
||||||
|
|
||||||
# Install service file with patched path
|
# Install service file with patched path
|
||||||
sed 's|/usr/local/bin/numa|/usr/bin/numa|g' numa.service > numa.service.patched
|
sed 's|ExecStart=/usr/local/bin/numa|ExecStart=/usr/bin/numa /etc/numa.toml|g' numa.service > numa.service.patched
|
||||||
install -Dm644 "numa.service.patched" "$pkgdir/usr/lib/systemd/system/numa.service"
|
install -Dm644 "numa.service.patched" "$pkgdir/usr/lib/systemd/system/numa.service"
|
||||||
|
|
||||||
install -Dm644 "numa.toml" "$pkgdir/etc/numa.toml"
|
install -Dm644 "numa.toml" "$pkgdir/etc/numa.toml"
|
||||||
|
|||||||
Reference in New Issue
Block a user