Accepting request 509498 from home:TheBlackCat:branches:devel:languages:python

Fix various rpmlint warnings and errors

OBS-URL: https://build.opensuse.org/request/show/509498
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psutil?expand=0&rev=76
This commit is contained in:
Dirk Mueller 2017-07-14 11:26:23 +00:00 committed by Git OBS Bridge
parent 19c53d8855
commit 6da2ce2bb5
2 changed files with 29 additions and 5 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Jul 11 14:24:34 UTC 2017 - toddrme2178@gmail.com
- Fix various rpmlint warnings and errors
-------------------------------------------------------------------
Sat Apr 29 16:13:29 UTC 2017 - michael@stroeder.com

View File

@ -16,6 +16,8 @@
#
%bcond_with test
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-psutil
Version: 5.2.2
@ -27,6 +29,7 @@ Url: https://pypi.python.org/pypi/psutil/
Source: https://files.pythonhosted.org/packages/source/p/psutil/psutil-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: net-tools
Requires: procps
@ -47,14 +50,30 @@ sed -i "1s/#!.*//" psutil/{__init__.py,_compat.py,_psbsd.py,_pslinux.py,_psosx.p
%install
%python_install
# not working due to lack of root priveleges
# %check
# make test
# make memtest
%{python_expand mkdir -p %{buildroot}%{_docdir}/%{$python_prefix}-psutil
cp -r scripts %{buildroot}%{_docdir}/%{$python_prefix}-psutil/
find %{buildroot}%{_docdir}/%{$python_prefix}-psutil/scripts/ -type f -name "*.py" -exec sed -i "s|#!/usr/bin/env python|#!%__$python|" {} \;
find %{buildroot}%{$python_sitearch}/psutil/tests/ -type f -name "*.py" -exec sed -i "s|#!/usr/bin/env python|#!%__$python|" {} \;
chmod a+x %{buildroot}%{$python_sitearch}/psutil/tests/*.py
chmod a-x %{buildroot}%{$python_sitearch}/psutil/tests/__init__.py
$python -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/psutil/tests/
$python -O -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/psutil/tests/
%fdupes %{buildroot}%{_docdir}/%{$python_prefix}-psutil/
%fdupes %{buildroot}%{$python_sitearch}
}
%if %{with test}
%check
make test
make memtest
%endif
%files %{python_files}
%defattr(-,root,root,-)
%doc CREDITS scripts HISTORY.rst LICENSE README.rst
%doc CREDITS HISTORY.rst LICENSE README.rst
%{_docdir}/%{python_prefix}-psutil/scripts/
%{python_sitearch}/psutil/
%{python_sitearch}/psutil/_psutil_*.so
%{python_sitearch}/psutil-%{version}-py*.egg-info