-
Notifications
You must be signed in to change notification settings - Fork 7
/
beaker-system-scan.spec
208 lines (178 loc) · 6.82 KB
/
beaker-system-scan.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
%if 0%{?rhel} && 0%{?rhel} <= 5
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif
# Python 3 on Fedora 29+ / RHEL8+, Python 2 otherwise.
%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
%bcond_without python3
%else
%bcond_with python3
%endif
# Can't run tests on older RHELs, we are missing pytest.
%if 0%{?fedora} || 0%{?rhel} >= 7
# Also can't run tests on non-x86 platforms because of
# the mess with conditionally compiling hvm_detect.
%ifarch x86_64
%bcond_without tests
%else
%bcond_with tests
%endif
%else
%bcond_with tests
%endif
# x86_64 is the only arch with compiled code (hvm_detect), all other arches are
# pure Python and hence debuginfo is empty.
%ifnarch x86_64
%global debug_package %{nil}
%endif
Name: beaker-system-scan
Version: 2.5
Release: 2%{?dist}
Summary: Collect and upload hardware information to Beaker
Group: Applications/System
License: GPLv2+
URL: http://beaker-project.org/
Source0: http://beaker-project.org/releases/%{name}-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: gcc
%if %{with python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
Requires: python3-linux-procfs
Requires: python3-setuptools
Requires: python3-lxml
%if %{with tests}
BuildRequires: python3-pytest
# runtime requirements also needed for tests
BuildRequires: python3-linux-procfs
BuildRequires: python3-lxml
%endif
%else
BuildRequires: python2-devel
BuildRequires: python-setuptools
Requires: python-linux-procfs
Requires: python-setuptools
Requires: python-lxml
%if %{with tests}
BuildRequires: pytest
# runtime requirements also needed for tests
BuildRequires: python-linux-procfs
BuildRequires: python-lxml
%endif
%endif
Requires: lshw
%if 0%{?rhel} < 6 && !(0%{?fedora} > 0)
Requires: python-simplejson
%ifarch x86_64
Requires: kmod-kvm
%endif
%endif
%ifarch x86_64
Requires: /usr/bin/iasl
%endif
Requires: device-mapper-multipath
%description
beaker-system-scan is a small script to collect details about the hardware of
the system it is run on, and upload those details to a Beaker server.
%prep
%setup -q
%if 0%{?rhel} == 5
sed -r -i -e 's/except (.*) as (.*):/except \1, \2:/' systemscan/*.py
%endif
%build
%if %{with python3}
make %{?_smp_mflags} PYTHON="%{__python3}" CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%else
make %{?_smp_mflags} PYTHON="%{__python}" CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%endif
%install
rm -rf %{buildroot}
%if %{with python3}
make install PYTHON="%{__python3}" DESTDIR=%{buildroot}
%else
make install PYTHON="%{__python}" DESTDIR=%{buildroot}
%endif
%if %{with tests}
%check
%if %{with python3}
PYTHONPATH=. py.test-3 -vv tests/
%else
PYTHONPATH=. py.test -vv tests/
%endif
%endif
%files
%doc COPYING
%if %{with python3}
%{python3_sitelib}/systemscan
%{python3_sitelib}/bkr.systemscan*.egg-info
%else
%{python_sitelib}/systemscan
%{python_sitelib}/bkr.systemscan*.egg-info
%endif
%{_libexecdir}/%{name}
%{_bindir}/%{name}
%changelog
* Fri Feb 05 2021 Renan Rodrigo <[email protected]> 2.5-2
- Update dist-git repos ([email protected])
- fix: checking asumptions when counting interfaces ([email protected])
* Wed Oct 23 2019 Martin Styk <[email protected]> 2.5-1
- Threat all ethernet devices correctly, not only eth* ([email protected])
- Update dist-git branches ([email protected])
- Update tito.props ([email protected])
* Fri Jul 26 2019 Martin Styk <[email protected]> 2.4-1
- Ignore disk nodes with id="medium" from lshw XML ([email protected])
* Tue Jul 31 2018 Dan Callaghan <[email protected]> 2.3-3
- tests: can't check the value of 'Numa' ([email protected])
* Tue Jul 31 2018 Dan Callaghan <[email protected]> 2.3-2
- disable tests on non-x86 platforms ([email protected])
* Tue Jul 31 2018 Dan Callaghan <[email protected]> 2.3-1
- collect firmware information ([email protected])
- Python 3 support ([email protected])
- tests: refactor to make it easier to add new samples ([email protected])
- tests: add missing /proc/cpuinfo sample for APM Mustang ([email protected])
- tests: better assertion messages ([email protected])
- run tests in rpmbuild ([email protected])
* Wed Jun 15 2016 Dan Callaghan <[email protected]> 2.2-1
- KVM module is called kvm_hv on POWER ([email protected])
* Thu Aug 27 2015 Dan Callaghan <[email protected]> 2.1-1
- fix DISKSPACE cumulative rounding error ([email protected])
- identify PnP devices by looking for <capability id="pnp">
- omit 0000:0000 from USBID key-values ([email protected])
- work around wrong PCI class for virtio memory balloon ([email protected])
* Thu Aug 13 2015 Dan Callaghan <[email protected]> 2.0-4
- ensure disk sector sizes are always populated ([email protected])
* Wed Aug 12 2015 Dan Callaghan <[email protected]> 2.0-3
- CPUFAMILY and CPUMODELNUMBER are numeric ([email protected])
* Tue Aug 11 2015 Dan Callaghan <[email protected]> 2.0-2
- convert DISK_CONTROLLER value to a real unicode object ([email protected])
* Fri Aug 07 2015 Dan Callaghan <[email protected]> 2.0-1
- use 'lshw' instead of 'smolt'
- new regression test suite
* Wed Jan 28 2015 Amit Saha <[email protected]> 1.6-1
- Make the code Python 2.4 compatible ([email protected])
- iasl => /usr/bin/iasl ([email protected])
- Add runtime dependencies on parted and python-setuptools ([email protected])
* Thu Oct 16 2014 Amit Saha <[email protected]> 1.5-1
- Redirect stdout of "service multipathd restart" to /dev/null
- Ignore failures from getdriver.sh when finding the bootdisk
* Fri Aug 29 2014 Amit Saha <[email protected]> 1.4-1
- Try a more recent version of libparted for Fedora 20+ and RHEL 7+
- Always return 0 from hvm_detect ([email protected])
- Couple of random changes: ([email protected])
- Add Fedora checking for kmod-kvm ([email protected])
- Add a new switch to output JSON data when run in debug mode
* Thu May 08 2014 Amit Saha <[email protected]> 1.3-1
- s390x 'identification' should be converted to an integer ([email protected])
- s390x and ppc: Fill in CPU model field ([email protected])
- Make iasl a conditional dependency for x86_64 ([email protected])
* Tue Jul 30 2013 Dan Callaghan <[email protected]> 1.2-3
- kmod-kvm is for x86_64 only ([email protected])
* Fri Jul 26 2013 Dan Callaghan <[email protected]> 1.2-2
- %%{python_sitelib} is not defined on RHEL5 ([email protected])
* Fri Jul 26 2013 Dan Callaghan <[email protected]> 1.2-1
- initial version, based on /distribution/inventory task from Beaker