/
python-hardware.spec
159 lines (130 loc) · 3.77 KB
/
python-hardware.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
%{?!_licensedir:%global license %%doc}
%{!?upstream_version: %global upstream_version %{version}}
%if 0%{?fedora}
%global with_python3 1
%endif
Name: python-hardware
Summary: Hardware detection and classification utilities
Version: 0.14
Release: 3%{?dist}
License: ASL 2.0
Group: Development/Languages
URL: https://pypi.python.org/pypi/hardware
Source0: https://pypi.python.org/packages/source/h/hardware/hardware-%{upstream_version}.tar.gz
BuildArch: noarch
BuildRequires: python-setuptools
BuildRequires: python2-devel
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-pbr
%endif # if with_python3
BuildRequires: python-pbr
BuildRequires: python-sphinx
BuildRequires: python-oslo-sphinx
BuildRequires: git
Requires: python-babel
Requires: python-ipaddr
Requires: python-netaddr
%if 0%{?fedora}
Requires: python-pexpect
%else
Requires: pexpect
%endif
Requires: python-ptyprocess
Requires: python-pandas
Requires: python-pbr
Requires: fio
Requires: sysbench
%prep
%autosetup -S git -v -n hardware-%{upstream_version}
rm -rf *.egg-info
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%endif # with_python3
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
%build
%{__python2} setup.py build
%{__python2} setup.py build_sphinx
rm -rf doc/build/html/.buildinfo
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
%endif # with_python3
%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
%endif # with_python3
%{__python2} setup.py install -O1 --skip-build --root=%{buildroot}
%description
Hardware detection and classification utilities.
Features:
* detect hardware features of a Linux systems:
** RAID
** hard drives
** IPMI
** network cards
** DMI info
** memory settings
** processor features
* filter hardware according to hardware profiles
%if 0%{?with_python3}
%package -n python3-hardware
Summary: Hardware detection and classification utilities
Group: Development/Languages
Requires: python3-babel
Requires: python3-netaddr
Requires: python3-pexpect
%description -n python3-hardware
Hardware detection and classification utilities.
Features:
* detect hardware features of a Linux systems:
** RAID
** hard drives
** IPMI
** network cards
** DMI info
** memory settings
** processor features
* filter hardware according to hardware profiles
%endif # with_python3
%package doc
Summary: Documentation for Hardware detection and classification utilities
Group: Documentation
%description doc
Documentation for Hardware detection and classification utilities.
%files
%license LICENSE
%doc README.rst
%{python2_sitelib}/hardware*
%exclude %{python2_sitelib}/hardware/test*
%{_bindir}/hardware-cardiff
%{_bindir}/hardware-detect
%files doc
%license LICENSE
%doc doc/build/html
%if 0%{?with_python3}
%files -n python3-hardware
%license LICENSE
%doc README.rst
%{python3_sitelib}/hardware*
%exclude %{python3_sitelib}/hardware/test*
%endif # with_python3
%changelog
* Tue May 26 2015 John Trowbridge <trown@redhat.com> - 0.14-3
- Add fio and sysbench to requirements
* Tue May 05 2015 Haïkel Guémar <hguemar@fedoraproject> - 0.14-2
- Fix requirements
* Tue Mar 31 2015 Frederic Lepied <frederic.lepied@redhat.com> - 0.14-1
- new version (bug #1196176)
* Thu Mar 26 2015 Frederic Lepied <frederic.lepied@redhat.com> - 0.13-1
- new version (bug #1196176)
* Wed Mar 18 2015 Frederic Lepied <frederic.lepied@redhat.com> - 0.12-1
- new version (bug #1196176)
* Tue Feb 24 2015 Dmitry Tantsur <divius.inside@gmail.com> - 0.11-1
- new version (bug #1195701)
* Fri Feb 13 2015 Dmitry Tantsur <dtantsur@redhat.com> - 0.9-1
- Initial package build