Accepting request 960025 from home:mwilck:modprobe.d

- Add code to restore user modifications for modprobe.d %config files
  after moving the files to %_modprobedir
- Use %_modprobedir (jsc#SLE-20639)

OBS-URL: https://build.opensuse.org/request/show/960025
OBS-URL: https://build.opensuse.org/package/show/Base:System/bluez?expand=0&rev=321
This commit is contained in:
Stefan Seyfried 2022-03-07 22:17:00 +00:00 committed by Git OBS Bridge
parent 24dbb512dc
commit 8cf70b3675
2 changed files with 29 additions and 4 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Sun Mar 6 20:53:09 UTC 2022 - Martin Wilck <mwilck@suse.com>
- Add code to restore user modifications for modprobe.d %config files
after moving the files to %_modprobedir
- Use %_modprobedir (jsc#SLE-20639)
-------------------------------------------------------------------
Sat Mar 5 09:07:00 UTC 2022 - Stefan Seyfried <seife+obs@b1-systems.com>

View File

@ -23,7 +23,13 @@
%bcond_with mesh
%endif
%bcond_without bluez_deprecated
#
%if 0%{?suse_version} < 1550 && 0%{?sle_version} <= 150300
# systemd-rpm-macros is wrong in 15.3 and below
%global _modprobedir /lib/modprobe.d
%endif
%global modprobe_d_files 50-bluetooth.conf
Name: bluez
Version: 5.63
Release: 0
@ -246,7 +252,7 @@ autoreconf -fi
%install
%make_install
find %{buildroot} -type f -name "*.la" -delete -print
install --mode=0644 -D %{SOURCE7} %{buildroot}/%{_sysconfdir}/modprobe.d/50-bluetooth.conf
install --mode=0644 -D %{SOURCE7} %{buildroot}/%{_modprobedir}/50-bluetooth.conf
# no idea why this is suddenly necessary...
install --mode 0755 -d %{buildroot}%{_localstatedir}/lib/bluetooth
@ -303,6 +309,11 @@ touch -r %{SOURCE0} %{buildroot}%{_defaultdocdir}/%{name}/README-mesh.SUSE
%pre
%service_add_pre bluetooth.service bluetooth-mesh.service
# Avoid restoring outdated stuff in posttrans
for _f in %{?modprobe_d_files}; do
[ ! -f "/etc/modprobe.d/${_f}.rpmsave" ] || \
mv -f "/etc/modprobe.d/${_f}.rpmsave" "/etc/modprobe.d/${_f}.rpmsave.old" || :
done
%post
%{?udev_rules_update:%udev_rules_update}
@ -319,6 +330,13 @@ touch -r %{SOURCE0} %{buildroot}%{_defaultdocdir}/%{name}/README-mesh.SUSE
%postun
%service_del_postun bluetooth.service bluetooth-mesh.service
%posttrans
# Migration of modprobe.conf files to _modprobedir
for _f in %{?modprobe_d_files}; do
[ ! -f "/etc/modprobe.d/${_f}.rpmsave" ] || \
mv -fv "/etc/modprobe.d/${_f}.rpmsave" "/etc/modprobe.d/${_f}" || :
done
%post -n libbluetooth3 -p /sbin/ldconfig
%postun -n libbluetooth3 -p /sbin/ldconfig
@ -372,8 +390,8 @@ touch -r %{SOURCE0} %{buildroot}%{_defaultdocdir}/%{name}/README-mesh.SUSE
# not packaged, boo#1151518
###%%config %%{_sysconfdir}/dbus-1/system.d/bluetooth-mesh.conf
%dir %{_localstatedir}/lib/bluetooth
%dir %{_sysconfdir}/modprobe.d
%config(noreplace) %{_sysconfdir}/modprobe.d/50-bluetooth.conf
%dir %{_modprobedir}
%{_modprobedir}/50-bluetooth.conf
%{_unitdir}/bluetooth.service
%if %{with mesh}
%{_unitdir}/bluetooth-mesh.service