diff --git a/python-psutil.changes b/python-psutil.changes index 1de53f0..96f1aa4 100644 --- a/python-psutil.changes +++ b/python-psutil.changes @@ -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 diff --git a/python-psutil.spec b/python-psutil.spec index 26dbc44..ff5536a 100644 --- a/python-psutil.spec +++ b/python-psutil.spec @@ -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