@@ -5,11 +5,13 @@ Summary: Metalk8s SOS report custom plugins
5
5
6
6
BuildRequires: /usr/bin/pathfix.py
7
7
8
- # Does not work with 4.0.0 and later
9
- Requires: sos >= 3.1, sos < 4.0
8
+ # sos layout changed in version 4.0, in order to make things simpler
9
+ # let's consider we have sos >= 4.0 for RHEL 8+ and sos < 4.0 for RHEL 7
10
10
%if 0%{rhel } >= 8
11
+ Requires: sos >= 4.0
11
12
Requires: python3 >= 3.6
12
13
%else
14
+ Requires: sos >= 3.1, sos < 4.0
13
15
Requires: python >= 2.6, python < 2.8
14
16
# NameError on FileNotFoundError in sos 3.5 python2.7
15
17
Conflicts: sos = 3.5
@@ -27,14 +29,16 @@ Source1: ../../common/metalk8s-sosreport/containerd.py
27
29
28
30
%if 0%{rhel } >= 8
29
31
%define python_lib %{python3_sitelib }
32
+ %define report_plugins %{python_lib }/sos/report/plugins
30
33
%else
31
34
%define python_lib %{python_sitelib }
35
+ %define report_plugins %{python_lib }/sos/plugins
32
36
%endif
33
37
34
38
%install
35
- install -m 755 -d %{buildroot }/%{python_lib }/sos/plugins
36
- install -p -m 755 %{_topdir }/SOURCES/metalk8s.py %{buildroot }/%{python_lib }/sos/plugins /metalk8s.py
37
- install -p -m 755 %{_topdir }/SOURCES/containerd.py %{buildroot }/%{python_lib }/sos/plugins /containerd.py
39
+ install -m 755 -d %{buildroot }/%{report_plugins }
40
+ install -p -m 755 %{_topdir }/SOURCES/metalk8s.py %{buildroot }/%{report_plugins } /metalk8s.py
41
+ install -p -m 755 %{_topdir }/SOURCES/containerd.py %{buildroot }/%{report_plugins } /containerd.py
38
42
%if 0%{rhel } > = 8
39
43
pathfix.py -pni " %{__python3} %{py3_shbang_opts}" %{buildroot }%{python_lib }
40
44
%else
@@ -43,18 +47,18 @@ pathfix.py -pni "%{__python} %{py_shbang_opts}" %{buildroot}%{python_lib}
43
47
44
48
%files
45
49
%defattr(-,root,root)
46
- %{python_lib }/sos/plugins /containerd.py
47
- %{python_lib }/sos/plugins /metalk8s.py
50
+ %{report_plugins } /containerd.py
51
+ %{report_plugins } /metalk8s.py
48
52
%if 0%{rhel } > = 8
49
- %{python_lib }/sos/plugins /__pycache__/containerd.cpython-%{python3_version_nodots }.pyc
50
- %{python_lib }/sos/plugins /__pycache__/containerd.cpython-%{python3_version_nodots }.opt-? .pyc
51
- %{python_lib }/sos/plugins /__pycache__/metalk8s.cpython-%{python3_version_nodots }.pyc
52
- %{python_lib }/sos/plugins /__pycache__/metalk8s.cpython-%{python3_version_nodots }.opt-? .pyc
53
+ %{report_plugins } /__pycache__/containerd.cpython-%{python3_version_nodots }.pyc
54
+ %{report_plugins } /__pycache__/containerd.cpython-%{python3_version_nodots }.opt-? .pyc
55
+ %{report_plugins } /__pycache__/metalk8s.cpython-%{python3_version_nodots }.pyc
56
+ %{report_plugins } /__pycache__/metalk8s.cpython-%{python3_version_nodots }.opt-? .pyc
53
57
%else
54
- %{python_lib }/sos/plugins /metalk8s.pyc
55
- %{python_lib }/sos/plugins /containerd.pyc
56
- %{python_lib }/sos/plugins /metalk8s.pyo
57
- %{python_lib }/sos/plugins /containerd.pyo
58
+ %{report_plugins } /metalk8s.pyc
59
+ %{report_plugins } /containerd.pyc
60
+ %{report_plugins } /metalk8s.pyo
61
+ %{report_plugins } /containerd.pyo
58
62
%endif
59
63
60
64
%changelog
0 commit comments