moonlock/pkg/PKGBUILD
nevaforget 0eefe76a3a Add PKGBUILD and remove stale moongreet icon
Add Arch Linux PKGBUILD for makepkg installation. Installs the
Python package, PAM config, and example config file. Fix pkgver()
to handle repos without tags (sed always exits 0 on empty input).

Remove leftover moongreet icon that was accidentally included in
the data directory.
2026-03-26 13:48:07 +01:00

58 lines
1.3 KiB
Bash

# ABOUTME: PKGBUILD for Moonlock — secure Wayland lockscreen.
# ABOUTME: Builds from git source with automatic version detection.
# Maintainer: Dominik Kressler
pkgname=moonlock-git
pkgver=0.1.0
pkgrel=1
pkgdesc="A secure Wayland lockscreen with GTK4, PAM and fingerprint support"
arch=('any')
url="https://gitea.moonarch.de/nevaforget/moonlock"
license=('MIT')
depends=(
'python'
'python-gobject'
'gtk4'
'gtk4-layer-shell'
'pam'
)
makedepends=(
'git'
'python-build'
'python-installer'
'python-hatchling'
)
optdepends=(
'fprintd: fingerprint authentication support'
)
provides=('moonlock')
conflicts=('moonlock')
source=("git+${url}.git")
sha256sums=('SKIP')
pkgver() {
cd "$srcdir/moonlock"
if git describe --long --tags 2>/dev/null; then
git describe --long --tags | sed 's/^v//;s/-/.r/;s/-/./'
else
printf "0.0.0.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
fi
}
build() {
cd "$srcdir/moonlock"
python -m build --wheel --no-isolation
}
package() {
cd "$srcdir/moonlock"
python -m installer --destdir="$pkgdir" dist/*.whl
# PAM configuration
install -Dm644 config/moonlock-pam "$pkgdir/etc/pam.d/moonlock"
# Example config
install -Dm644 config/moonlock.toml.example "$pkgdir/etc/moonlock/moonlock.toml.example"
}