1
0
Fork 0
mirror of https://gitlab.postmarketos.org/postmarketOS/pmaports.git synced 2025-07-12 16:19:48 +03:00

systemd/*: use new abuild systemd helpers

Adjust everything to use the new systemd abuild helpers. These generate
the post-install/pre-deinstall and post-upgrade scripts automagically,
and abuild now provides some helpers where it's necessary to finegle
things a bit (e.g. see the pipewire-pulse-systemd subpackage).

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
Co-authored-by: Clayton Craft <clayton@craftyguy.net>
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6334
This commit is contained in:
Caleb Connolly 2025-03-19 22:31:49 +00:00
parent 310ce2f500
commit a679e5132c
No known key found for this signature in database
GPG key ID: 0583312B195F64B6
40 changed files with 27 additions and 200 deletions

View file

@ -4,7 +4,7 @@ maintainer="Jane Rachinger <jane400+pmaports@postmarketos.org>"
pkgname=cups
pkgver=99992.4.11
_pkgver=2.4.11
pkgrel=0
pkgrel=1
pkgdesc="The CUPS Printing System"
url="https://github.com/OpenPrinting/cups/"
arch="all"
@ -97,11 +97,6 @@ package() {
find usr/share/cups/model -name "*.ppd" -exec gzip -n9f {} +
}
systemd() {
install="$subpkgname.post-install $subpkgname.pre-deinstall"
default_systemd
}
dev() {
default_dev

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_post_install system cups.path cups.socket cups.service

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_pre_deinstall system cups.path cups.socket cups.service

View file

@ -3,7 +3,7 @@
pkgname=gdm
pkgver=99948.0
_pkgver=48.0
pkgrel=0
pkgrel=1
pkgdesc="GNOME display manager"
url="https://wiki.gnome.org/Projects/GDM"
# blocked by gnome-shell
@ -76,11 +76,6 @@ package() {
install -m755 -D "$srcdir/Xsession" "$pkgdir"/etc/gdm
}
systemd() {
install="$subpkgname.post-install $subpkgname.pre-deinstall"
default_systemd
}
sha512sums="
3e4a320cc6a0b43d65122bacd2b99531695f20ec809a767b957d63a511e00da017a9a4abe815596c6ad1398c5d427418d5c51bf6162216f60fdae5e8095bd305 gdm-48.0.tar.xz
aa302c33c9b31e823ab98ca80c330c3f7eaa10d05c402cf111d78a35fbec82ce90bff34c19b713b6e352428c31df91f04bd01b58cae8968e130a991c73382020 0001-DOWNSTREAM-use-bin-touch-instead-of-usr-bin-touch.patch

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_post_install system gdm.service

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_pre_deinstall system gdm.service

View file

@ -4,7 +4,7 @@
pkgname=gnome-keyring
pkgver=99946.2
_pkgver=46.2
pkgrel=0
pkgrel=1
pkgdesc="GNOME keyring"
url="https://wiki.gnome.org//Projects/GnomeKeyring"
arch="all"
@ -67,11 +67,6 @@ package() {
make DESTDIR="$pkgdir" install
}
systemd() {
install="$subpkgname.post-install $subpkgname.pre-deinstall"
default_systemd
}
sha512sums="
4229ca0606bdd1b84a3c737288df7f1fc1f8715734e3001964babd882201c3d818deabb3a7662dbf9b67316f03b234de84da3128fb991a500ef8305c2f962ba2 gnome-keyring-46.2.tar.xz
53e04eade3579fe5d65d11d6cde6c5fdffc9f73a3a7f372b1f4dbc7437212e753123c12854d3a5a7a22f3beb1b00604eec0371615ceb0f7024cb38cf35e33065 0001-build-Use-p11_module_configs-as-default-pkcs11-confi.patch

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_post_install user gnome-keyring-daemon

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_pre_deinstall user gnome-keyring-daemon

View file

@ -5,7 +5,7 @@ maintainer="Jane Rachinger <jane400+pmaports@postmarketos.org>"
pkgname=networkmanager
pkgver=9991.52.0
_pkgver=1.52.0
pkgrel=0
pkgrel=1
pkgdesc="Network Management daemon"
url="https://wiki.gnome.org/Projects/NetworkManager"
arch="all"
@ -232,11 +232,6 @@ _default_plugin() {
amove $_plugindir/libnm*-${subpkgname#"$pkgname"-}.so
}
systemd() {
install="$subpkgname.post-install $subpkgname.pre-deinstall"
default_systemd
}
sha512sums="
6669467bad7a4965b92124506d25649bd6c95e90c34213edb3f854df9a163507ac5dd381ff53800254a2db703f23233f8dc5b59a75042532bd573fc8c7022158 networkmanager-1.52.0.tar.gz
0f79016bf717dea43830962f524deae8d1cedc274376e40bd912ebe63208c5b1c3b7a5aa14379da19020c587dbd5588df2f0066ca1540070a226983a43e4159b networkmanager.conf

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_post_install system NetworkManager.service

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_pre_deinstall system NetworkManager.service

View file

@ -3,7 +3,7 @@
pkgname=pipewire
pkgver=9991.4.1
_pkgver=1.4.1
pkgrel=0
pkgrel=1
_so_ver=0.3
pkgdesc="Multimedia processing graphs"
url="https://pipewire.org/"
@ -49,6 +49,7 @@ subpackages="
$pkgname-doc
$pkgname-alsa
$pkgname-pulse
$pkgname-pulse-systemd:pulse_systemd
$pkgname-jack
$pkgname-jack-dev:jackdev
$pkgname-dev
@ -60,8 +61,9 @@ subpackages="
$pkgname-spa-tools:spa_tools
$pkgname-lang
$pkgname-echo-cancel:echo_cancel
$pkgname-systemd
"
install="$pkgname.post-upgrade $pkgname.post-install $pkgname.pre-deinstall"
install="$pkgname.post-upgrade $pkgname.post-install"
source="$pkgname-$_pkgver.tar.gz::https://github.com/PipeWire/pipewire/archive/refs/tags/$_pkgver.tar.gz
pipewire.desktop
pipewire-launcher.sh
@ -143,7 +145,6 @@ pulse() {
"
provides="pulseaudio=$pkgver-r$pkgrel pulseaudio-bluez=$pkgver-r$pkgrel"
provider_priority=1
install="$subpkgname.post-install $subpkgname.pre-deinstall"
amove usr/bin/pipewire-pulse
amove usr/lib/pipewire-$_so_ver/libpipewire-module-protocol-pulse.so
@ -151,8 +152,15 @@ pulse() {
amove usr/lib/pipewire-$_so_ver/libpipewire-module-filter-chain.so
amove usr/share/pipewire/pipewire-pulse.conf
amove usr/share/pipewire/pipewire-pulse.conf.avail
}
pulse_systemd() {
amove usr/lib/systemd/user/pipewire-pulse.service
amove usr/lib/systemd/user/pipewire-pulse.socket
# We can't just call default_systemd because that would take
# all the systemd unit files!
default_systemd_install_scripts
}
jack() {

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_post_install user pipewire-pulse.socket

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_pre_deinstall user pipewire-pulse.socket

View file

@ -1,6 +1,3 @@
#!/bin/sh
addgroup -S pipewire 2>/dev/null
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_post_install user pipewire.socket

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_pre_deinstall user pipewire.socket

View file

@ -2,7 +2,7 @@
# Co-maintainer: Clayton Craft <clayton@craftyguy.net>
# pmbootstrap installs this, if systemd is selected in "pmbootstrap init".
pkgname=postmarketos-base-systemd
pkgver=34
pkgver=35
pkgrel=0
pkgdesc="Meta package for running postmarketOS with systemd"
url="https://postmarketos.org"

View file

@ -1,7 +1,5 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
system_preset_path="/usr/lib/systemd/system-preset/90-base.preset"
user_preset_path="/usr/lib/systemd/user-preset/90-base.preset"
@ -89,8 +87,10 @@ policy_changed() {
check_and_apply_presets() {
local type="$1"
local preset_path=""
local extra_args=""
if [ "$type" = user ]; then
preset_path="$user_preset_path"
extra_args="--global"
else
preset_path="$system_preset_path"
type="system"
@ -106,7 +106,7 @@ check_and_apply_presets() {
echo " wildcards are not supported yet, skipping"
else
if [ -f "/usr/lib/systemd/$type/$entry" ]; then
systemd_service_post_install "$type" "$entry"
systemctl --no-reload preset $extra_args "$entry"
else
echo " no unit file found, skipping"
fi

View file

@ -3,7 +3,7 @@
pkgname=wireplumber
pkgver=9990.5.8
_pkgver=0.5.8
pkgrel=0
pkgrel=1
pkgdesc="Session / policy manager implementation for PipeWire"
url="https://pipewire.org/"
arch="all"
@ -30,12 +30,12 @@ subpackages="
$pkgname-lang
$pkgname-zsh-completion
$pkgname-doc
$pkgname-systemd
"
source="https://gitlab.freedesktop.org/PipeWire/wireplumber/-/archive/$_pkgver/wireplumber-$_pkgver.tar.gz"
provides="pipewire-session-manager"
provider_priority=50
install="$pkgname.post-install $pkgname.pre-deinstall"
builddir="$srcdir/$pkgname-$_pkgver"
case "$CARCH" in

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_post_install user wireplumber.service

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_pre_deinstall user wireplumber.service

View file

@ -1,7 +1,7 @@
# Maintainer: Dylan Van Assche <me@dylanvanassche.be>
pkgname=bootmac
pkgver=0.6.0
pkgrel=0
pkgrel=1
pkgdesc="Configure MAC addresses at boot"
url="https://gitlab.postmarketos.org/postmarketOS/bootmac"
arch="all"
@ -29,11 +29,6 @@ openrc() {
amove usr/lib/udev/rules.d/90-bootmac-wifi.rules
}
systemd() {
install="$subpkgname.post-install $subpkgname.pre-deinstall"
default_systemd
}
sha512sums="
164f35b2e008aa0f7b7ad42338e46d8fdac1ec2d4403123b390706437603b1d2060659130a477823734fbda56fa45e9987fb9a2c08cf1e87adebea979e634bbb bootmac-v0.6.0.tar.gz
"

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_post_install system bootmac-bluetooth.service

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_pre_deinstall system bootmac-bluetooth.service

View file

@ -1,6 +1,6 @@
pkgname=hexagonfs-firmware-loader
pkgver=1.0.0
pkgrel=0
pkgrel=1
pkgdesc="Prepare the HexagonFS directory from msm-firmware-loader mounts"
url="https://postmarketos.org/"
subpackages="$pkgname-openrc $pkgname-systemd"
@ -42,11 +42,6 @@ openrc() {
default_openrc
}
systemd() {
install="$subpkgname.post-install $subpkgname.pre-deinstall"
default_systemd
}
sha512sums="
64c50d1e92cc29b3e8c0e5ee0c14603c5d3b6c9f9671038928cb3093a1276e6004452e55c5f7e3793b72bbc0a7dc48063ed29ba779ece2edea5ac743fa1ec473 hexagonrpcd.confd
77c2d49b21afab2ae848d9f32bb88b7bc10c10215ed4f418e8c71ed4e5772ef5a67eded5f420244de66f90b1bb9f53c168395b9587c50a8c1903556acb6b2c7d hexagonfs-firmware-loader-1.0.0.tar.gz

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_post_install system hexagonfs-firmware-loader

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_pre_deinstall system hexagonfs-firmware-loader

View file

@ -1,6 +1,6 @@
pkgname=msm-firmware-loader
pkgver=1.6.0
pkgrel=0
pkgrel=1
pkgdesc="Set of init services to automatically load firmware from device partitions"
url="https://postmarketos.org/"
subpackages="$pkgname-openrc $pkgname-systemd $pkgname-wcnss"
@ -40,11 +40,6 @@ openrc() {
default_openrc
}
systemd() {
install="$subpkgname.post-install $subpkgname.pre-deinstall"
default_systemd
}
wcnss() {
pkgdesc="Use WiFi/BT firmware from stock firmware partition using $pkgname"
provides="firmware-qcom-msm8916-wcnss=$pkgver-r$pkgrel"

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_post_install system msm-firmware-loader msm-firmware-loader-unpack

View file

@ -1,4 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_pre_deinstall system msm-firmware-loader msm-firmware-loader-unpack

View file

@ -2,7 +2,7 @@
# Based On: postmarketos-ui-fbkeyboard
pkgname=postmarketos-ui-buffyboard
pkgver=1
pkgrel=0
pkgrel=1
pkgdesc="Plain framebuffer console with modern touchscreen keyboard support"
url="https://gitlab.postmarketos.org/postmarketOS/buffybox"
arch="all"
@ -32,11 +32,6 @@ openrc() {
mkdir -p "$subpkgdir"
}
systemd() {
install="$subpkgname.post-install $subpkgname.pre-deinstall"
default_systemd
}
sha512sums="
81178d6f86dbe24c8ddfd0c1c29504f12941232f11124d21aedde54d2a82c34e03fba8e82e5bbc285d94e216e812763291787e086b51e8eb258562714e4dadcd buffyboard.init
0bf529465d5d882e64f1804c0a809bc38c1fbadaf52b276848708c761d53014c8d302c2573200d2f831090d6833abc6da6f89f28e9b309dc63f9ca10d148b4b2 buffyboard.service

View file

@ -1,10 +0,0 @@
#!/bin/sh
# This file is forcefully included into CI shellcheck by:
# $(find . -path './main/postmarketos-ui-*/*.post-install')
# in .ci/shellcheck.sh. Silence it here to avoid error:
# SC1091 (info): Not following: /usr/lib/systemd/systemd-apk-macros.sh:
# openBinaryFile: does not exist (No such file or directory)
# shellcheck disable=SC1091
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_post_install system buffyboard

View file

@ -1,10 +0,0 @@
#!/bin/sh
# This file is forcefully included into CI shellcheck by:
# $(find . -path './main/postmarketos-ui-*/*.pre-deinstall')
# in .ci/shellcheck.sh. Silence it here to avoid error:
# SC1091 (info): Not following: /usr/lib/systemd/systemd-apk-macros.sh:
# openBinaryFile: does not exist (No such file or directory)
# shellcheck disable=SC1091
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_pre_deinstall system buffyboard

View file

@ -1,7 +1,7 @@
# Reference: https://postmarketos.org/uipkg
# Maintainer: Ferenc Bakonyi <bakonyi.ferenc@gmail.com>
pkgname=postmarketos-ui-fbkeyboard
pkgver=4
pkgver=5
pkgrel=0
pkgdesc="Plain framebuffer console with touchscreen keyboard support"
url="https://github.com/bakonyiferenc/fbkeyboard"
@ -32,11 +32,6 @@ openrc() {
mkdir -p "$subpkgdir"
}
systemd() {
install="$subpkgname.post-install $subpkgname.pre-deinstall"
default_systemd
}
sha512sums="
bed2c48abfac7cc9bc16fb16cd3ae3a7048121d2867b961458f0d3a9520e16598c8115a7b00808bded64904956aea445fa31a3106c52bab87cfba3420be309b8 fbkeyboard.init
5b70d6087a4448673a4f3f1868ee93f67517edcdf02a6aeec7381b9c91e43cf213a96714388b437497026188276f9c55e759c9fb75e3465422188e9cd00724c9 fbkeyboard.service

View file

@ -1,10 +0,0 @@
#!/bin/sh
# This file is forcefully included into CI shellcheck by:
# $(find . -path './main/postmarketos-ui-*/*.post-install')
# in .ci/shellcheck.sh. Silence it here to avoid error:
# SC1091 (info): Not following: /usr/lib/systemd/systemd-apk-macros.sh:
# openBinaryFile: does not exist (No such file or directory)
# shellcheck disable=SC1091
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_post_install system fbkeyboard

View file

@ -1,10 +0,0 @@
#!/bin/sh
# This file is forcefully included into CI shellcheck by:
# $(find . -path './main/postmarketos-ui-*/*.pre-deinstall')
# in .ci/shellcheck.sh. Silence it here to avoid error:
# SC1091 (info): Not following: /usr/lib/systemd/systemd-apk-macros.sh:
# openBinaryFile: does not exist (No such file or directory)
# shellcheck disable=SC1091
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_pre_deinstall system fbkeyboard

View file

@ -1,7 +1,7 @@
# Maintainer: Jakko <jahau@rocketmail.com>
pkgname=swclock-offset
pkgver=0.2.5
pkgrel=0
pkgrel=1
pkgdesc="Keep system time at an offset to a non-writable RTC"
url="https://gitlab.postmarketos.org/postmarketOS/swclock-offset"
arch="noarch"
@ -15,13 +15,6 @@ package() {
make DESTDIR="$pkgdir" install
}
systemd() {
install="$subpkgname.post-install $subpkgname.pre-deinstall"
install_if="$pkgname=$pkgver-r$pkgrel systemd"
amove usr/lib/systemd
}
openrc() {
install="$subpkgname.post-install $subpkgname.pre-deinstall"
default_openrc

View file

@ -1,5 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_post_install system swclock-offset-boot.service
systemd_service_post_install system swclock-offset-shutdown.service

View file

@ -1,5 +0,0 @@
#!/bin/sh
. /usr/lib/systemd/systemd-apk-macros.sh
systemd_service_pre_deinstall system swclock-offset-boot.service
systemd_service_pre_deinstall system swclock-offset-shutdown.service