Skip to content
Snippets Groups Projects
Unverified Commit 310ce2f5 authored by Casey's avatar Casey :recycle:
Browse files

abuild: switch to reworked systemd support


Switch to the new refactored systemd service support.

Signed-off-by: default avatarCaleb Connolly <caleb@postmarketos.org>
Part-of: postmarketOS/pmaports!6334
parent 659b9c43
No related branches found
No related tags found
No related merge requests found
From 0bda547b2d7694ab40e0237ea6ae8a25a237ee50 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com>
Date: Thu, 11 Apr 2024 13:57:26 +0200
Subject: [PATCH 1/2] abuild: add systemd splitfunc
Co-authored-by: Caleb Connolly <caleb@postmarketos.org>
---
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
From d27596cd67928e4795dc99dbc139b231354c3381 Mon Sep 17 00:00:00 2001
From: Clayton Craft <clayton@craftyguy.net>
Date: Fri, 5 Jul 2024 10:38:50 -0700
Subject: [PATCH 2/2] abuild: add warning in -systemd split func about
non-usr-merged birs
---
abuild.in | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/abuild.in b/abuild.in
index 74e47f1..e5f9be0 100644
--- a/abuild.in
+++ b/abuild.in
@@ -2165,6 +2165,10 @@ default_systemd() {
fi
amove usr/lib/systemd
+
+ if [ -d bin ] || [ -d lib ] || [ -d usr/sbin ]; then
+ warning "Files should be installed to /usr/bin or /usr/lib, not /bin, /lib, or /usr/sbin"
+ fi
}
systemd() {
--
2.45.2
......@@ -6,7 +6,8 @@
pkgname=abuild
pkgver=99993.12.0
_pkgver=3.12.0
pkgrel=4
_commit=91b2698307ac4364b0de61e90d48b677c540a6f1
pkgrel=5
pkgdesc="Script to build Alpine Packages"
url="https://git.alpinelinux.org/cgit/abuild/"
arch="all"
......@@ -26,11 +27,9 @@ subpackages="
options="suid !check" # tests are SLOW in qemu
pkggroups="abuild"
source="
https://gitlab.alpinelinux.org/alpine/abuild/-/archive/$_pkgver/abuild-$_pkgver.tar.gz
0001-abuild-add-systemd-splitfunc.patch
0002-abuild-add-warning-in-systemd-split-func-about-non-u.patch
https://gitlab.alpinelinux.org/craftyguy/abuild/-/archive/$_commit/abuild-$_commit.tar.gz
"
builddir="$srcdir/$pkgname-$_pkgver"
builddir="$srcdir/$pkgname-$_commit"
build() {
make VERSION="$_pkgver-r$pkgrel"
......@@ -104,7 +103,5 @@ _rootbld() {
}
sha512sums="
00fac67aa96a83f33406dde60bd9526bfa5fdff690b84dbe867b6ed197f147b2afafcdfbda900c005e00a64a42bcb98ca425ffc8bf2158b9540cbb67d935577d abuild-3.12.0.tar.gz
52cc5857b3c93bd4595de1d06c3c600b88871c68f7a1ea51e10d720ddd9c8fb7f0f63cd2f4fe280c0d9adaf607de8b858f4add3e46b1a5a28cc6c711359f6c60 0001-abuild-add-systemd-splitfunc.patch
3782341dac814ecbcb7d2b4242d85f03ca2e4bf9eeb3b1e9524b2c434b05c864f5a4b5b8abc4031085e7e943e90780fe07b1e99d4cfadf0695340ad321647cac 0002-abuild-add-warning-in-systemd-split-func-about-non-u.patch
67bdfbc004f0d9784fb4d26426924c97a784bb717e677ff9a9f1cbfdeffa00de6cd9dbd443b01fafaad6ac75dc644a5f4bf6cf277b75e2bc0f02be1d74460818 abuild-91b2698307ac4364b0de61e90d48b677c540a6f1.tar.gz
"
From 0bda547b2d7694ab40e0237ea6ae8a25a237ee50 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com>
Date: Thu, 11 Apr 2024 13:57:26 +0200
Subject: [PATCH 1/2] abuild: add systemd splitfunc
Co-authored-by: Caleb Connolly <caleb@postmarketos.org>
---
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
From d27596cd67928e4795dc99dbc139b231354c3381 Mon Sep 17 00:00:00 2001
From: Clayton Craft <clayton@craftyguy.net>
Date: Fri, 5 Jul 2024 10:38:50 -0700
Subject: [PATCH 2/2] abuild: add warning in -systemd split func about
non-usr-merged birs
---
abuild.in | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/abuild.in b/abuild.in
index 74e47f1..e5f9be0 100644
--- a/abuild.in
+++ b/abuild.in
@@ -2165,6 +2165,10 @@ default_systemd() {
fi
amove usr/lib/systemd
+
+ if [ -d bin ] || [ -d lib ] || [ -d usr/sbin ]; then
+ warning "Files should be installed to /usr/bin or /usr/lib, not /bin, /lib, or /usr/sbin"
+ fi
}
systemd() {
--
2.45.2
......@@ -6,7 +6,8 @@
pkgname=abuild
pkgver=99993.12.0
_pkgver=3.12.0
pkgrel=4
_commit=91b2698307ac4364b0de61e90d48b677c540a6f1
pkgrel=5
pkgdesc="Script to build Alpine Packages"
url="https://git.alpinelinux.org/cgit/abuild/"
arch="all"
......@@ -26,11 +27,9 @@ subpackages="
options="suid !check" # tests are SLOW in qemu
pkggroups="abuild"
source="
https://gitlab.alpinelinux.org/alpine/abuild/-/archive/$_pkgver/abuild-$_pkgver.tar.gz
0001-abuild-add-systemd-splitfunc.patch
0002-abuild-add-warning-in-systemd-split-func-about-non-u.patch
https://gitlab.alpinelinux.org/craftyguy/abuild/-/archive/$_commit/abuild-$_commit.tar.gz
"
builddir="$srcdir/$pkgname-$_pkgver"
builddir="$srcdir/$pkgname-$_commit"
build() {
make VERSION="$_pkgver-r$pkgrel"
......@@ -104,7 +103,5 @@ _rootbld() {
}
sha512sums="
00fac67aa96a83f33406dde60bd9526bfa5fdff690b84dbe867b6ed197f147b2afafcdfbda900c005e00a64a42bcb98ca425ffc8bf2158b9540cbb67d935577d abuild-3.12.0.tar.gz
52cc5857b3c93bd4595de1d06c3c600b88871c68f7a1ea51e10d720ddd9c8fb7f0f63cd2f4fe280c0d9adaf607de8b858f4add3e46b1a5a28cc6c711359f6c60 0001-abuild-add-systemd-splitfunc.patch
3782341dac814ecbcb7d2b4242d85f03ca2e4bf9eeb3b1e9524b2c434b05c864f5a4b5b8abc4031085e7e943e90780fe07b1e99d4cfadf0695340ad321647cac 0002-abuild-add-warning-in-systemd-split-func-about-non-u.patch
67bdfbc004f0d9784fb4d26426924c97a784bb717e677ff9a9f1cbfdeffa00de6cd9dbd443b01fafaad6ac75dc644a5f4bf6cf277b75e2bc0f02be1d74460818 abuild-91b2698307ac4364b0de61e90d48b677c540a6f1.tar.gz
"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment