Accepting request 960063 from home:mwilck:modprobe.d
- Fix modprobe.d location for 15.3 - Add code for safe modprobe.d migration (https://en.opensuse.org/openSUSE:Packaging_UsrEtc) OBS-URL: https://build.opensuse.org/request/show/960063 OBS-URL: https://build.opensuse.org/package/show/hardware/xboxdrv?expand=0&rev=17
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 7 20:22:50 UTC 2022 - Martin Wilck <mwilck@suse.com>
|
||||
|
||||
- Fix modprobe.d location for 15.3
|
||||
- Add code for safe modprobe.d migration
|
||||
(https://en.opensuse.org/openSUSE:Packaging_UsrEtc)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 7 15:11:37 UTC 2022 - Johannes Segitz <jsegitz@suse.com>
|
||||
|
||||
|
||||
+19
-3
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package xboxdrv
|
||||
#
|
||||
# Copyright (c) 2020 SUSE LLC
|
||||
# Copyright (c) 2022 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -15,10 +15,13 @@
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
%if 0%{?suse_version} < 1550 && 0%{?sle_version} < 150300
|
||||
# systemd-rpm-macros(or kmod) is wrong in 15.2
|
||||
|
||||
%if 0%{?suse_version} < 1550 && 0%{?sle_version} <= 150300
|
||||
# systemd-rpm-macros is wrong in 15.3 and before
|
||||
%define _modprobedir /lib/modprobe.d
|
||||
%endif
|
||||
%global modprobe_d_files 50-xpad.conf
|
||||
|
||||
Name: xboxdrv
|
||||
Version: 0.8.8
|
||||
Release: 0
|
||||
@@ -89,6 +92,11 @@ rm %{buildroot}%{_bindir}/%{name}ctl
|
||||
|
||||
%pre
|
||||
%service_add_pre %{name}.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
|
||||
%service_add_post %{name}.service
|
||||
@@ -99,6 +107,13 @@ rm %{buildroot}%{_bindir}/%{name}ctl
|
||||
%postun
|
||||
%service_del_postun %{name}.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
|
||||
|
||||
%files
|
||||
%license COPYING
|
||||
%doc AUTHORS NEWS PROTOCOL README.md TODO
|
||||
@@ -106,6 +121,7 @@ rm %{buildroot}%{_bindir}/%{name}ctl
|
||||
%if 0%{?suse_version} < 1550 && 0%{?sle_version} < 150300
|
||||
%dir %{_modprobedir}
|
||||
%endif
|
||||
%dir %{_modprobedir}
|
||||
%{_modprobedir}/50-xpad.conf
|
||||
%{_bindir}/%{name}
|
||||
%{_sbindir}/rc%{name}
|
||||
|
||||
Reference in New Issue
Block a user