Replace manual user/group creation with sysusers.d and tmpfiles.d

This commit is contained in:
Sandwich
2026-04-10 19:23:01 +02:00
parent 7f5dde119f
commit cb5a76eb5f
6 changed files with 21 additions and 16 deletions

View File

@@ -23,11 +23,15 @@ source=(
"$pkgname-$pkgver.tar.gz::https://github.com/jkingsman/Remote-Terminal-for-MeshCore/archive/refs/tags/$pkgver.tar.gz"
"remoteterm-meshcore.service"
"remoteterm.env"
"remoteterm-meshcore.sysusers"
"remoteterm-meshcore.tmpfiles"
)
# sha256sums are recomputed by `updpkgsums` in the publish workflow before
# the PKGBUILD is pushed to AUR. The committed values are intentionally SKIP
# so the file is honest about not tracking real hashes in this repo.
sha256sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP')
@@ -111,6 +115,12 @@ package() {
install -Dm640 "$srcdir/remoteterm.env" \
"$pkgdir/etc/remoteterm-meshcore/remoteterm.env"
# System user and data directory
install -Dm644 "$srcdir/remoteterm-meshcore.sysusers" \
"$pkgdir/usr/lib/sysusers.d/remoteterm-meshcore.conf"
install -Dm644 "$srcdir/remoteterm-meshcore.tmpfiles" \
"$pkgdir/usr/lib/tmpfiles.d/remoteterm-meshcore.conf"
# License
install -Dm644 LICENSE.md \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"

View File

@@ -1,14 +1,3 @@
pre_install() {
getent group remoteterm > /dev/null || groupadd -r remoteterm
getent passwd remoteterm > /dev/null || \
useradd -r -g remoteterm -d /var/lib/remoteterm-meshcore -s /sbin/nologin \
-c "RemoteTerm for MeshCore" remoteterm
}
pre_upgrade() {
pre_install
}
post_install() {
echo "==> Set your radio connection (serial, TCP, or BLE) in"
echo "==> /etc/remoteterm-meshcore/remoteterm.env"

View File

@@ -0,0 +1 @@
u remoteterm - "RemoteTerm for MeshCore" /var/lib/remoteterm-meshcore

View File

@@ -0,0 +1 @@
d /var/lib/remoteterm-meshcore 0750 remoteterm remoteterm