2016-08-16 15:51:38 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-py-cpuinfo
|
|
|
|
#
|
2018-12-04 13:49:41 +00:00
|
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
2016-08-16 15:51:38 +00:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2018-12-04 13:49:41 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2016-08-16 15:51:38 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2017-04-19 15:53:26 +00:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2018-12-04 17:19:06 +00:00
|
|
|
%bcond_without tests
|
2016-08-16 15:51:38 +00:00
|
|
|
Name: python-py-cpuinfo
|
2017-04-19 15:53:26 +00:00
|
|
|
Version: 3.1.0
|
2016-08-16 15:51:38 +00:00
|
|
|
Release: 0
|
2017-04-19 15:53:26 +00:00
|
|
|
Summary: Get CPU info with pure Python
|
2016-08-16 15:51:38 +00:00
|
|
|
License: MIT
|
|
|
|
Group: Development/Languages/Python
|
2018-12-04 17:19:06 +00:00
|
|
|
URL: https://github.com/workhorsy/py-cpuinfo
|
2016-08-16 15:51:38 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/p/py-cpuinfo/py-cpuinfo-%{version}.tar.gz
|
2018-12-04 13:49:41 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2017-04-19 15:53:26 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2016-08-16 15:51:38 +00:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(preun): update-alternatives
|
2018-12-04 17:19:06 +00:00
|
|
|
BuildArch: noarch
|
2017-04-19 15:53:26 +00:00
|
|
|
%python_subpackages
|
2016-08-16 15:51:38 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
Py-cpuinfo gets CPU info with pure Python. Py-cpuinfo should work
|
|
|
|
without any extra programs or libraries, beyond what your OS
|
|
|
|
provides. It does not require any compilation(C/C++, assembly, et
|
|
|
|
cetera) to use. It works on Linux, OS X, Windows, BSD, Solaris,
|
|
|
|
Cygwin, Haiku, and BeagleBone. It currently only works on X86 and some
|
|
|
|
ARM CPUs.
|
|
|
|
|
|
|
|
These approaches are used for getting info:
|
|
|
|
1. Windows Registry (Windows)
|
|
|
|
2. /proc/cpuinfo (Linux)
|
|
|
|
3. sysctl (OS X)
|
|
|
|
4. dmesg (Unix/Linux)
|
|
|
|
5. isainfo and kstat (Solaris)
|
|
|
|
6. cpufreq-info (BeagleBone)
|
|
|
|
7. lscpu (Unix/Linux)
|
|
|
|
8. sysinfo (Haiku)
|
|
|
|
9. Querying the CPUID register (Intel X86 CPUs)
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n py-cpuinfo-%{version}
|
|
|
|
|
|
|
|
%build
|
2017-04-19 15:53:26 +00:00
|
|
|
%python_build
|
2016-08-16 15:51:38 +00:00
|
|
|
|
|
|
|
%install
|
2017-04-19 15:53:26 +00:00
|
|
|
%python_install
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2016-08-16 15:51:38 +00:00
|
|
|
|
|
|
|
# Prepare for update-alternatives usage
|
2017-04-19 15:53:26 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/cpuinfo
|
|
|
|
|
|
|
|
%if %{with tests}
|
|
|
|
%check
|
|
|
|
%python_exec test_suite.py
|
|
|
|
%endif
|
2016-08-16 15:51:38 +00:00
|
|
|
|
|
|
|
%post
|
2017-04-19 15:53:26 +00:00
|
|
|
%python_install_alternative cpuinfo
|
2016-08-16 15:51:38 +00:00
|
|
|
|
|
|
|
%preun
|
2017-04-19 15:53:26 +00:00
|
|
|
%python_uninstall_alternative cpuinfo
|
2016-08-16 15:51:38 +00:00
|
|
|
|
2017-04-19 15:53:26 +00:00
|
|
|
%files %{python_files}
|
2018-12-04 17:19:06 +00:00
|
|
|
%license LICENSE
|
|
|
|
%doc README.rst ChangeLog
|
2017-04-19 15:53:26 +00:00
|
|
|
%python_alternative %{_bindir}/cpuinfo
|
2016-08-16 15:51:38 +00:00
|
|
|
%{python_sitelib}/*
|
|
|
|
|
|
|
|
%changelog
|