You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
123 lines
2.8 KiB
123 lines
2.8 KiB
11 years ago
|
%global with_python3 1
|
||
|
%global module_name cpuinfo
|
||
|
|
||
|
Name: python-%{module_name}
|
||
|
Version: 0.1.2
|
||
|
Release: 2%{?dist}
|
||
|
Summary: Getting CPU info
|
||
|
|
||
|
License: MIT
|
||
|
URL: https://github.com/workhorsy/py-cpuinfo
|
||
|
Source0: https://pypi.python.org/packages/source/p/py-%{module_name}/py-%{module_name}-%{version}.tar.gz
|
||
|
|
||
|
BuildArch: noarch
|
||
|
BuildRequires: python2-devel
|
||
|
BuildRequires: python-setuptools
|
||
|
|
||
|
%if 0%{?with_python3}
|
||
|
%package -n python3-%{module_name}
|
||
|
Summary: Getting CPU info
|
||
|
License: MIT
|
||
|
BuildRequires: python3-devel
|
||
|
BuildRequires: python3-setuptools
|
||
|
%endif
|
||
|
|
||
|
|
||
|
%description
|
||
|
Py-cpuinfo gets CPU info with pure Python. Py-cpuinfo should work without
|
||
|
any extra programs or libraries, beyond what your OS provides.
|
||
|
|
||
|
These approaches are used for getting info:
|
||
|
Windows Registry
|
||
|
/proc/cpuinfo
|
||
|
sysctl
|
||
|
dmesg
|
||
|
isainfo and psrinfo
|
||
|
Querying x86 CPUID register
|
||
|
|
||
|
%if 0%{?with_python3}
|
||
|
%description -n python3-%{module_name}
|
||
|
Py-cpuinfo gets CPU info with pure Python. Py-cpuinfo should work without
|
||
|
any extra programs or libraries, beyond what your OS provides.
|
||
|
|
||
|
These approaches are used for getting info:
|
||
|
Windows Registry
|
||
|
/proc/cpuinfo
|
||
|
sysctl
|
||
|
dmesg
|
||
|
isainfo and psrinfo
|
||
|
Querying x86 CPUID register
|
||
|
|
||
|
%endif
|
||
|
|
||
|
%prep
|
||
|
%setup -q -n py-%{module_name}-%{version}
|
||
|
rm -rf *.egg-info
|
||
|
|
||
|
sed -i -e '/^#!\//, 1d' cpuinfo/cpuinfo.py
|
||
|
|
||
|
%if 0%{?with_python3}
|
||
|
rm -rf %{py3dir}
|
||
|
cp -a . %{py3dir}
|
||
|
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
|
||
|
%endif
|
||
|
|
||
|
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
|
||
|
|
||
|
%build
|
||
|
%{__python2} setup.py build
|
||
|
|
||
|
%if 0%{?with_python3}
|
||
|
pushd %{py3dir}
|
||
|
%{__python3} setup.py build
|
||
|
popd
|
||
|
%endif
|
||
|
|
||
|
%install
|
||
|
%if 0%{?with_python3}
|
||
|
pushd %{py3dir}
|
||
|
%{__python3} setup.py install --skip-build --root=%{buildroot}
|
||
|
popd
|
||
|
%endif
|
||
|
|
||
|
%{__python2} setup.py install --skip-build --root=%{buildroot}
|
||
|
|
||
|
%check
|
||
|
%{__python2} setup.py test
|
||
|
|
||
|
%if 0%{?with_python3}
|
||
|
pushd %{py3dir}
|
||
|
%{__python3} setup.py test
|
||
|
popd
|
||
|
%endif
|
||
|
|
||
|
%files -n python-%{module_name}
|
||
|
%doc README.rst LICENSE ChangeLog
|
||
|
%{_bindir}/cpuinfo
|
||
|
%{python2_sitelib}/%{module_name}/
|
||
|
%{python2_sitelib}/py_%{module_name}-%{version}-py2.*.egg-info
|
||
|
|
||
|
%if 0%{?with_python3}
|
||
|
%files -n python3-%{module_name}
|
||
|
%doc README.rst LICENSE ChangeLog
|
||
|
%{_bindir}/cpuinfo
|
||
|
%{python3_sitelib}/%{module_name}/
|
||
|
%{python3_sitelib}/py_%{module_name}-%{version}-py3.*.egg-info
|
||
|
%endif
|
||
|
|
||
|
|
||
|
%changelog
|
||
|
* Fri Oct 03 2014 Parag Nemade <pnemade AT redhat DOT com> - 0.1.2-2
|
||
|
- Clean the spec to follow py3 guidelines
|
||
|
|
||
|
* Wed Oct 01 2014 Parag Nemade <pnemade AT redhat DOT com> - 0.1.2-1
|
||
|
- Update to 0.1.2 release
|
||
|
|
||
|
* Mon Sep 22 2014 Parag Nemade <pnemade AT redhat DOT com> - 0.1.0-2
|
||
|
- fix rpmlint messages
|
||
|
- Added upstream LICENSE file not in tarball
|
||
|
|
||
|
* Mon Sep 22 2014 Parag Nemade <pnemade AT redhat DOT com> - 0.1.0-1
|
||
|
- Initial packaging
|
||
|
|