From 012d9a551b81c02f676b0d1ae51ba40a8e4c18d0e0965e921f6ae0fd17586900 Mon Sep 17 00:00:00 2001 From: Antonio Larrosa Date: Fri, 13 Jan 2023 10:58:55 +0000 Subject: [PATCH] Accepting request 1058202 from home:alarrosa:branches:multimedia:libs - Backport the workaround from SLE/Leap for the bug in systemd scripts that didn't set the default enable state for the wireplumber user service when installing wireplumber. The bug (boo#1200485) was fixed but that's only for new installations while this workaround will fix old installations (boo#1202008). This is used to automatically fix installations of SLE 15 SP4/Leap 15.4 that were not updated during it's lifetime and upgrade directly to SP5/15.5 . OBS-URL: https://build.opensuse.org/request/show/1058202 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=56 --- wireplumber.changes | 12 ++++++++++++ wireplumber.spec | 25 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/wireplumber.changes b/wireplumber.changes index e5e7b90..519fe9d 100644 --- a/wireplumber.changes +++ b/wireplumber.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri Jan 13 10:51:07 UTC 2023 - Antonio Larrosa + +- Backport the workaround from SLE/Leap for the bug in systemd + scripts that didn't set the default enable state for the + wireplumber user service when installing wireplumber. The bug + (boo#1200485) was fixed but that's only for new installations + while this workaround will fix old installations (boo#1202008). + This is used to automatically fix installations of + SLE 15 SP4/Leap 15.4 that were not updated during it's lifetime + and upgrade directly to SP5/15.5 . + ------------------------------------------------------------------- Wed Jan 11 12:41:28 UTC 2023 - Antonio Larrosa diff --git a/wireplumber.spec b/wireplumber.spec index 3be6abb..4021b23 100644 --- a/wireplumber.spec +++ b/wireplumber.spec @@ -77,6 +77,8 @@ BuildRequires: gcc9-c++ %else BuildRequires: gcc-c++ %endif +%{?systemd_ordering} + %description WirePlumber is a modular session / policy manager for PipeWire and @@ -182,6 +184,29 @@ export XDG_RUNTIME_DIR=/tmp %post %systemd_user_post wireplumber.service +%if 0%{?suse_version} <= 1500 +# If the pipewire.socket user unit is not enabled and the workaround +# for boo#1186561 has never been executed, we need to execute it now +if [ ! -L %{_sysconfdir}/systemd/user/pipewire.service.wants/wireplumber.service \ + -a ! -f %{_localstatedir}/lib/pipewire/wireplumber_post_workaround \ + -a -x %{_bindir}/systemctl ]; then + for service in wireplumber.service ; do + %{_bindir}/systemctl --global preset "$service" || : + done + + mkdir -p %{_localstatedir}/lib/pipewire + cat << EOF > %{_localstatedir}/lib/pipewire/wireplumber_post_workaround +# The existence of this file means that the wireplumber user services were +# enabled at least once. Please don't remove this file as that would +# make the services to be enabled again in the next package update. +# +# Check the following bugs for more information: +# https://bugzilla.opensuse.org/show_bug.cgi?id=1200485 +EOF +fi +%endif + + %preun %systemd_user_preun wireplumber.service