From 0bda547b2d7694ab40e0237ea6ae8a25a237ee50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= Date: Thu, 11 Apr 2024 13:57:26 +0200 Subject: [PATCH 1/2] abuild: add systemd splitfunc Co-authored-by: Caleb Connolly --- abuild.in | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/abuild.in b/abuild.in index 36317d6..74e47f1 100644 --- a/abuild.in +++ b/abuild.in @@ -815,6 +815,11 @@ postcheck() { && ! is_openrc_pkg "$name"; then warning "Found OpenRC directory (/etc/conf.d or /etc/init.d) but name doesn't end with -openrc" fi + # look for /usr/lib/systemd + if [ -e "$dir"/usr/lib/systemd ] \ + && ! is_systemd_pkg "$name"; then + warning "Found systemd directory (/usr/lib/systemd) but it's not in a systemd package" + fi # look for /usr/share/doc if [ -e "$dir"/usr/share/doc ] \ && ! is_doc_pkg "$name"; then @@ -1371,6 +1376,11 @@ is_openrc_pkg() { test "${1%-openrc}" != "$1" } +# returns true if this is the -systemd package +is_systemd_pkg() { + test "${1%-systemd}" != "$1" || test "systemd" == "$1" +} + # returns true if this is the -bash-completion package is_bashcomp_pkg() { test "${1%-bash-completion}" != "$1" @@ -2143,6 +2153,24 @@ openrc() { default_openrc } +# predefined splitfunc systemd +default_systemd() { + depends="$depends_systemd" + pkgdesc="$pkgdesc (systemd files)" + install_if="systemd ${subpkgname%-systemd}=$pkgver-r$pkgrel" + + if [ -d lib/systemd ]; then + error "Detected /lib/systemd dir, should be installed to /usr/lib/systemd" + return 1 + fi + + amove usr/lib/systemd +} + +systemd() { + default_systemd +} + default_devhelp() { depends="" pkgdesc="$pkgname - devhelp files" -- 2.45.2