Name: psutil Version: 5.9.0 Release: 1 Summary: Cross-platform lib for process and system monitoring in Python. License: BSD URL: https://github.com/giampaolo/psutil Source0: https://files.pythonhosted.org/packages/47/b6/ea8a7728f096a597f0032564e8013b705aa992a0990becd773dcc4d7b4a7/psutil-5.9.0.tar.gz #skip 2 tests that fail in mock chroots #Patch0: python-psutil-skip-tests-in-mock.patch %bcond_without dotests #With /bin/tar, we get checksum error. So these macros are included. %global __gzip /opt/freeware/bin/gzip %global __tar /opt/freeware/bin/tar %define python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") BuildRequires: gcc BuildRequires: grep BuildRequires: make BuildRequires: python3-devel >= 3.7.11 %global _description %{expand: psutil is a module providing an interface for retrieving information on all running processes and system utilization (CPU, memory, disks, network, users) in a portable way by using Python, implementing many functionalities offered by command line tools such as: ps, top, df, kill, free, lsof, free, netstat, ifconfig, nice, ionice, iostat, iotop, uptime, pidof, tty, who, taskset, pmap.} %description %{_description} %package -n python3-psutil Summary: %{summary} License: BSD Provides: python3-psutil = %{version} Provides: python-psutil Provides: python3-psutil(ppc-64) Provides: python3.7-psutil Provides: python3.7dist(psutil) Provides: python3dist(psutil) %description -n python3-psutil %{_description} %package -n python3-psutil-tests Summary: %{summary}, test suite Provides: python3-psutil = %{version} Requires: python3 >= 3.7.11 Requires: python3-devel >= 3.7.11 Provides: python3-psutil-tests = %{version} %description -n python3-psutil-tests The test suite for psutil. %prep %autosetup -n %{name}-%{version} -p1 # Remove shebangs find psutil -name \*.py | while read file; do sed -i.orig -e '1{/^#!/d}' $file && \ touch -r $file.orig $file && \ rm $file.orig done %build export PATH=/opt/freeware/bin:$PATH python3 setup.py build %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} python3 setup.py install --root %{buildroot} %check #( make test CI_TESTING=1 PYTHON=/opt/freeware/bin/python3 PYTHONPATH=%{buildroot}/%{python3_sitearch} || true ) %if %{with dotests} python3 -m venv python_venv . ./python_venv/bin/activate ulimit -d unlimited ulimit -n 20000 ulimit -m unlimited ## ulimit -f unlimited #( PYTHONPATH=%{buildroot}/%{python_sitelib} python3 -m psutil.tests || true ) ( make test CI_TESTING=1 PYTHON=/opt/freeware/bin/python3 PYTHONPATH=%{buildroot}/%{python3_sitearch} || true ) deactivate %endif %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files -n python3-psutil %defattr(-,root,system,-) %doc LICENSE %doc CREDITS HISTORY.rst README.rst %{python3_sitearch}/%{name}/ %{python3_sitearch}/%{name}-*.egg-info/ %exclude %{python3_sitearch}/%{name}/tests %files -n python3-psutil-tests %defattr(-,root,system,-) %{python3_sitearch}/%{name}/tests/ %changelog * Fri May 20 2022 Sangeetha Bandi - 5.9.0-1 - First port on AIX