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