From 6092c4857e231582ce81e1af0eff68aa54fcfd9554efdee80c3e9e0645f4df9c Mon Sep 17 00:00:00 2001 From: Todd R Date: Tue, 16 Aug 2016 15:51:38 +0000 Subject: [PATCH] Accepting request 419647 from home:TheBlackCat:branches:devel:languages:python Python 2 version of python3-py-cpuinfo. Needed by python-tables. OBS-URL: https://build.opensuse.org/request/show/419647 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-py-cpuinfo?expand=0&rev=1 --- .gitattributes | 23 +++++++++++ .gitignore | 1 + py-cpuinfo-0.2.3.tar.gz | 3 ++ python-py-cpuinfo.changes | 15 +++++++ python-py-cpuinfo.spec | 84 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 126 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 py-cpuinfo-0.2.3.tar.gz create mode 100644 python-py-cpuinfo.changes create mode 100644 python-py-cpuinfo.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/py-cpuinfo-0.2.3.tar.gz b/py-cpuinfo-0.2.3.tar.gz new file mode 100644 index 0000000..8d77d73 --- /dev/null +++ b/py-cpuinfo-0.2.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6a016fdbc4e7fadf2d519090fcb4fa9d0831bad4e85245d938e5c2fe7623ca6 +size 21033 diff --git a/python-py-cpuinfo.changes b/python-py-cpuinfo.changes new file mode 100644 index 0000000..07d750f --- /dev/null +++ b/python-py-cpuinfo.changes @@ -0,0 +1,15 @@ +------------------------------------------------------------------- +Tue Aug 16 15:46:46 UTC 2016 - toddrme2178@gmail.com + +- Initial python 2 version. + +------------------------------------------------------------------- +Tue Aug 16 15:42:24 UTC 2016 - toddrme2178@gmail.com + +- Implement update-alternatives + +------------------------------------------------------------------- +Tue Jul 5 03:04:57 UTC 2016 - arun@gmx.de + +- initial version + diff --git a/python-py-cpuinfo.spec b/python-py-cpuinfo.spec new file mode 100644 index 0000000..626818f --- /dev/null +++ b/python-py-cpuinfo.spec @@ -0,0 +1,84 @@ +# +# spec file for package python-py-cpuinfo +# +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# +# 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. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +Name: python-py-cpuinfo +Version: 0.2.3 +Release: 0 +Summary: Get CPU info with pure Python 2 & 3 +License: MIT +Group: Development/Languages/Python +Url: https://github.com/workhorsy/py-cpuinfo +Source: https://files.pythonhosted.org/packages/source/p/py-cpuinfo/py-cpuinfo-%{version}.tar.gz +BuildRequires: python-devel +BuildRequires: python-setuptools +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildArch: noarch +Requires(post): update-alternatives +Requires(preun): update-alternatives + +%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 +python setup.py build + +%install +python setup.py install --prefix=%{_prefix} --root=%{buildroot} + +# Prepare for update-alternatives usage +mkdir -p %{buildroot}%{_sysconfdir}/alternatives +mv %{buildroot}%{_bindir}/cpuinfo %{buildroot}%{_bindir}/cpuinfo-%{py_ver} +ln -s -f %{_sysconfdir}/alternatives/cpuinfo %{buildroot}%{_bindir}/cpuinfo + +%post +%_sbindir/update-alternatives \ + --install %{_bindir}/cpuinfo cpuinfo %{_bindir}/cpuinfo-%{py_ver} 30 + +%preun +if [ $1 -eq 0 ] ; then + %_sbindir/update-alternatives --remove cpuinfo %{_bindir}/cpuinfo-%{py_ver} +fi + +%files +%defattr(-,root,root,-) +%doc README.rst LICENSE ChangeLog +%{_bindir}/cpuinfo +%{_bindir}/cpuinfo-%{py_ver} +%ghost %{_sysconfdir}/alternatives/cpuinfo +%{python_sitelib}/* + +%changelog