]>
Commit | Line | Data |
---|---|---|
70e92c41 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # unit tests | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: Get CPU info with pure Python 2 | |
8 | Summary(pl.UTF-8): Pobieranie informacji o CPU w czystym Pythonie 2 | |
9 | Name: python-py-cpuinfo | |
08203024 | 10 | Version: 8.0.0 |
eecebf32 | 11 | Release: 3 |
70e92c41 JB |
12 | License: MIT |
13 | Group: Libraries/Python | |
14 | #Source0Download: https://pypi.org/simple/py-cpuinfo/ | |
15 | Source0: https://files.pythonhosted.org/packages/source/p/py-cpuinfo/py-cpuinfo-%{version}.tar.gz | |
08203024 | 16 | # Source0-md5: cf3bec89839a0bf18c5f6c1c18aaee10 |
70e92c41 JB |
17 | URL: https://github.com/workhorsy/py-cpuinfo |
18 | %if %{with python2} | |
19 | BuildRequires: python-modules >= 1:2.7 | |
20 | BuildRequires: python-setuptools | |
21 | %endif | |
22 | %if %{with python3} | |
23 | BuildRequires: python3-modules >= 1:3.2 | |
24 | BuildRequires: python3-setuptools | |
25 | %endif | |
26 | BuildRequires: rpm-pythonprov | |
27 | BuildRequires: rpmbuild(macros) >= 1.714 | |
28 | Requires: python-modules >= 1:2.7 | |
29 | BuildArch: noarch | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | Py-cpuinfo gets CPU info with pure Python. Py-cpuinfo should work | |
34 | without any extra programs or libraries, beyond what your OS provides. | |
35 | It does not require any compilation (C/C++, assembly, et cetera) to | |
36 | use. It works with Python 2 and 3. | |
37 | ||
38 | %description -l pl.UTF-8 | |
39 | Py-cpuinfo pobiera informacje o CPU z poziomu czystego Pythona. | |
40 | Powinien działać bez dodatkowych programów czy bibliotek, tylko z tym, | |
41 | co udostępnia system operacyjny. Nie wymaga żadnej kompilacji (C/C++, | |
42 | asemblera itp.). Działa z Pythonem 2 i 3. | |
43 | ||
44 | %package -n python3-py-cpuinfo | |
45 | Summary: Get CPU info with pure Python 3 | |
46 | Summary(pl.UTF-8): Pobieranie informacji o CPU w czystym Pythonie 3 | |
47 | Group: Libraries/Python | |
48 | Requires: python3-modules >= 1:3.2 | |
49 | ||
50 | %description -n python3-py-cpuinfo | |
51 | Py-cpuinfo gets CPU info with pure Python. Py-cpuinfo should work | |
52 | without any extra programs or libraries, beyond what your OS provides. | |
53 | It does not require any compilation (C/C++, assembly, et cetera) to | |
54 | use. It works with Python 2 and 3. | |
55 | ||
56 | %description -n python3-py-cpuinfo -l pl.UTF-8 | |
57 | Py-cpuinfo pobiera informacje o CPU z poziomu czystego Pythona. | |
58 | Powinien działać bez dodatkowych programów czy bibliotek, tylko z tym, | |
59 | co udostępnia system operacyjny. Nie wymaga żadnej kompilacji (C/C++, | |
60 | asemblera itp.). Działa z Pythonem 2 i 3. | |
61 | ||
62 | %prep | |
63 | %setup -q -n py-cpuinfo-%{version} | |
64 | ||
65 | %build | |
66 | %if %{with python2} | |
ff1159f4 JB |
67 | %py_build |
68 | ||
69 | %if %{with tests} | |
70 | %{__python} test_suite.py | |
71 | %endif | |
70e92c41 JB |
72 | %endif |
73 | ||
74 | %if %{with python3} | |
ff1159f4 JB |
75 | %py3_build |
76 | ||
77 | %if %{with tests} | |
78 | %{__python3} test_suite.py | |
79 | %endif | |
70e92c41 JB |
80 | %endif |
81 | ||
82 | %install | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | ||
85 | %if %{with python2} | |
86 | %py_install | |
87 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/cpuinfo{,-py2} | |
88 | ||
89 | %py_postclean | |
90 | %endif | |
91 | ||
92 | %if %{with python3} | |
93 | %py3_install | |
94 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/cpuinfo{,-py3} | |
95 | %endif | |
96 | ||
97 | %clean | |
98 | rm -rf $RPM_BUILD_ROOT | |
99 | ||
100 | %if %{with python2} | |
101 | %files | |
102 | %defattr(644,root,root,755) | |
103 | %doc ChangeLog LICENSE README.rst | |
104 | %attr(755,root,root) %{_bindir}/cpuinfo-py2 | |
105 | %{py_sitescriptdir}/cpuinfo | |
106 | %{py_sitescriptdir}/py_cpuinfo-%{version}-py*.egg-info | |
107 | %endif | |
108 | ||
109 | %if %{with python3} | |
110 | %files -n python3-py-cpuinfo | |
111 | %defattr(644,root,root,755) | |
112 | %doc ChangeLog LICENSE README.rst | |
113 | %attr(755,root,root) %{_bindir}/cpuinfo-py3 | |
114 | %{py3_sitescriptdir}/cpuinfo | |
115 | %{py3_sitescriptdir}/py_cpuinfo-%{version}-py*.egg-info | |
116 | %endif |