Adapt to new Fedora packaging guidelines

This commit is contained in:
Sandro Bonazzola 2023-06-01 10:19:53 +02:00
parent de452814b3
commit de860bd5c7

View File

@ -1,7 +1,7 @@
Summary: A set of tools to gather troubleshooting information from a system
Name: sos
Version: 4.5.4
Release: 2%{?dist}
Release: 3%{?dist}
Source0: https://github.com/sosreport/sos/archive/%{version}.tar.gz
License: GPL-2.0-or-later
BuildArch: noarch
@ -28,11 +28,25 @@ support technicians and developers.
%prep
%setup -qn %{name}-%{version}
%if 0%{?fedora} >= 39
%generate_buildrequires
%pyproject_buildrequires
%endif
%build
%if 0%{?fedora} >= 39
%pyproject_wheel
%else
%py3_build
%endif
%install
%if 0%{?fedora} >= 39
%pyproject_install
%pyproject_save_files sos
%else
%py3_install '--install-scripts=%{_sbindir}'
%endif
install -d -m 755 %{buildroot}%{_sysconfdir}/%{name}
install -d -m 700 %{buildroot}%{_sysconfdir}/%{name}/cleaner
@ -50,9 +64,15 @@ rm -rf %{buildroot}/usr/config/
# internationalization is currently broken. Uncomment this line once fixed.
# %%files -f %%{name}.lang
%files
%if 0%{?fedora} >= 39
%{_bindir}/sos
%{_bindir}/sosreport
%{_bindir}/sos-collector
%else
%{_sbindir}/sos
%{_sbindir}/sosreport
%{_sbindir}/sos-collector
%endif
%dir /etc/sos/cleaner
%dir /etc/sos/presets.d
%dir /etc/sos/extras.d
@ -66,6 +86,9 @@ rm -rf %{buildroot}/usr/config/
%config(noreplace) %{_sysconfdir}/sos/sos.conf
%changelog
* Thu Jun 01 2023 Sandro Bonazzola <sbonazzo@redhat.com> - 4.5.4-3
- Adapt to new Fedora packaging guidelines
* Mon May 29 2023 Sandro Bonazzola <sbonazzo@redhat.com> - 4.5.4-2
- Remove unneeded requirements