From d067e117d8fba2bfe8fbb662bfa75573ba26427c Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Tue, 14 Jan 2025 14:37:26 -0800 Subject: [PATCH] main/bootmac: upgrade to 0.6, support systemd (MR 6050) This new version includes initial support for systemd (for bluetooth only atm). udev rules are only installed for openrc systems, bt config on systemd was replaced by a unit file and using bootmac for wifi has issues (https://gitlab.postmarketos.org/postmarketOS/bootmac/-/issues/7) [ci:skip-build]: already built successfully in CI --- main/bootmac/APKBUILD | 26 +++++++++++++++++----- main/bootmac/bootmac-systemd.post-install | 4 ++++ main/bootmac/bootmac-systemd.pre-deinstall | 4 ++++ 3 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 main/bootmac/bootmac-systemd.post-install create mode 100644 main/bootmac/bootmac-systemd.pre-deinstall diff --git a/main/bootmac/APKBUILD b/main/bootmac/APKBUILD index ebba8a536..ae4d58c5d 100644 --- a/main/bootmac/APKBUILD +++ b/main/bootmac/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Dylan Van Assche pkgname=bootmac -pkgver=0.5.0 -pkgrel=2 +pkgver=0.6.0 +pkgrel=0 pkgdesc="Configure MAC addresses at boot" url="https://gitlab.postmarketos.org/postmarketOS/bootmac" arch="all" @@ -9,15 +9,31 @@ license="GPLv3-or-later" source="https://gitlab.postmarketos.org/postmarketOS/bootmac/-/archive/v$pkgver/bootmac-v$pkgver.tar.gz" depends="bluez-btmgmt bluez-deprecated" options="!check" +subpackages="$pkgname-openrc $pkgname-systemd" builddir="$srcdir/$pkgname-v$pkgver" package() { - install -Dm644 "$builddir"/bootmac.rules \ - "$pkgdir"/usr/lib/udev/rules.d/90-bootmac.rules + install -Dm644 "$builddir"/bootmac-wifi.rules \ + "$pkgdir"/usr/lib/udev/rules.d/90-bootmac-wifi.rules + install -Dm644 "$builddir"/bootmac-bluetooth.rules \ + "$pkgdir"/usr/lib/udev/rules.d/90-bootmac-bluetooth.rules install -Dm755 "$builddir"/bootmac \ "$pkgdir"/usr/bin/bootmac + install -Dm644 "$builddir"/bootmac-bluetooth.service \ + -t "$pkgdir"/usr/lib/systemd/system/ +} + +openrc() { + default_openrc + amove usr/lib/udev/rules.d/90-bootmac-bluetooth.rules + amove usr/lib/udev/rules.d/90-bootmac-wifi.rules +} + +systemd() { + install="$subpkgname.post-install $subpkgname.pre-deinstall" + default_systemd } sha512sums=" -32409d0ad978aa92cde061b69071e01bb6de9f7e8d33e4d7f67f2bddc192a8ea710b8c3e01b9618768c3a8b1d297a6fd717fc4dad3c47e7bec508f2d5f198dda bootmac-v0.5.0.tar.gz +164f35b2e008aa0f7b7ad42338e46d8fdac1ec2d4403123b390706437603b1d2060659130a477823734fbda56fa45e9987fb9a2c08cf1e87adebea979e634bbb bootmac-v0.6.0.tar.gz " diff --git a/main/bootmac/bootmac-systemd.post-install b/main/bootmac/bootmac-systemd.post-install new file mode 100644 index 000000000..60073166b --- /dev/null +++ b/main/bootmac/bootmac-systemd.post-install @@ -0,0 +1,4 @@ +#!/bin/sh + +. /usr/lib/systemd/systemd-apk-macros.sh +systemd_service_post_install system bootmac-bluetooth.service diff --git a/main/bootmac/bootmac-systemd.pre-deinstall b/main/bootmac/bootmac-systemd.pre-deinstall new file mode 100644 index 000000000..145d9711d --- /dev/null +++ b/main/bootmac/bootmac-systemd.pre-deinstall @@ -0,0 +1,4 @@ +#!/bin/sh + +. /usr/lib/systemd/systemd-apk-macros.sh +systemd_service_pre_deinstall system bootmac-bluetooth.service