]> git.pld-linux.org Git - packages/python-psutil.git/blame - python-psutil.spec
rebuild with python 3.10
[packages/python-psutil.git] / python-psutil.spec
CommitLineData
fb9dc603 1# TODO:
658986de 2# - Fix tests (a few fail)
52ca0973 3#
02ee3b03 4# Conditional build:
748d284f 5%bcond_without doc # Sphinx documentation
658986de 6%bcond_with tests # unit tests
748d284f
JB
7%bcond_without python2 # CPython 2.x module
8%bcond_without python3 # CPython 3.x module
02ee3b03 9
72bc27e5 10%define module psutil
02ee3b03
MK
11Summary: A cross-platform process and system utilities module for Python
12Summary(pl.UTF-8): Wieloplatformowe narzędzia do procesów i systemu dla Pythona
13Name: python-%{module}
1cbe6543 14Version: 5.9.0
1bbffd2c 15Release: 3
02ee3b03
MK
16License: BSD
17Group: Development/Languages/Python
658986de
JB
18#Source0Download: https://pypi.org/simple/psutil/
19Source0: https://github.com/giampaolo/psutil/archive/release-%{version}/%{module}-%{version}.tar.gz
1cbe6543 20# Source0-md5: 080d75a78be3ef1ce72c39a9b001197d
72bc27e5 21URL: https://github.com/giampaolo/psutil
b5b42a71 22BuildRequires: rpm-pythonprov
52ca0973 23BuildRequires: rpmbuild(macros) >= 1.714
b5b42a71 24%if %{with python2}
52ca0973
JB
25BuildRequires: python-devel >= 1:2.6
26%if %{with tests}
658986de 27BuildRequires: python-ipaddress
79c2de42 28BuildRequires: python-mock
52ca0973
JB
29%if "%{py_ver}" < "2.7"
30BuildRequires: python-unittest2
31%endif
32%endif
b5b42a71
AM
33%endif
34%if %{with python3}
658986de
JB
35BuildRequires: python3-devel >= 1:3.4
36BuildRequires: python3-modules >= 1:3.4
b5b42a71 37%endif
52ca0973 38Requires: python-modules >= 1:2.6
02ee3b03
MK
39BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41%description
42Module providing an interface for retrieving information on all
43running processes and system utilization (CPU, disk, memory, network)
44in a portable way by using Python, implementing many functionalities
45offered by command line tools.
46
47%description -l pl.UTF-8
48Moduł dostarczający interfejs do informacji o działających procesach
49oraz zużyciu systemu (procesor, dyski, pamięć, sieć) w przenośny
50sposób używjąc Pythona. Implementuje wiele funkcjonalności oferowanych
51przez narzędzia linii komend.
52
b5b42a71
AM
53%package -n python3-%{module}
54Summary: A cross-platform process and system utilities module for Python
55Summary(pl.UTF-8): Wieloplatformowe narzędzia do procesów i systemu dla Pythona
56Group: Libraries/Python
658986de 57Requires: python3-modules >= 1:3.4
b5b42a71
AM
58
59%description -n python3-%{module}
60Module providing an interface for retrieving information on all
61running processes and system utilization (CPU, disk, memory, network)
62in a portable way by using Python, implementing many functionalities
63offered by command line tools.
64
65%description -n python3-%{module} -l pl.UTF-8
66Module providing an interface for retrieving information on all
67running processes and system utilization (CPU, disk, memory, network)
68in a portable way by using Python, implementing many functionalities
69offered by command line tools.
70
748d284f
JB
71%package apidocs
72Summary: API documentation for Python psutil module
73Summary(pl.UTF-8): Dokumentacja API modułu Pythona psutil
74Group: Documentation
75
76%description apidocs
77API documentation for Python psutil module.
78
79%description apidocs -l pl.UTF-8
80Dokumentacja API modułu Pythona psutil.
81
02ee3b03 82%prep
cfcf3673 83%setup -q -n %{module}-release-%{version}
02ee3b03 84
658986de
JB
85%if %{with tests}
86# prepare subdir to run tests from
87# (cannot use topdir with PYTHONPATH=build-?/lib.* because python finds psutil dir without
88# _psutil_linux module inside in cwd before build-?/lib.*/psutil dir from PYTHONPATH)
89install -d tests
90ln -sf ../scripts tests
748d284f 91ln -sf ../setup.py tests
658986de
JB
92%endif
93
02ee3b03 94%build
b5b42a71 95%if %{with python2}
28ffe788 96%py_build
52ca0973 97
658986de
JB
98%if %{with tests}
99cd tests
100ln -snf ../build-2/lib.*/psutil psutil
101PYTHONPATH=$(pwd) \
748d284f 102%{__python} psutil/tests/__main__.py
658986de
JB
103cd ..
104%endif
b5b42a71 105%endif
02ee3b03 106
b5b42a71 107%if %{with python3}
28ffe788 108%py3_build
52ca0973 109
658986de
JB
110%if %{with tests}
111cd tests
112ln -snf ../build-3/lib.*/psutil psutil
113PYTHONPATH=$(pwd) \
748d284f 114%{__python3} psutil/tests/__main__.py
658986de
JB
115cd ..
116%endif
b5b42a71 117%endif
02ee3b03 118
748d284f
JB
119%if %{with doc}
120%{__make} -C docs html \
121 SPHINXBUILD=sphinx-build-2
122%endif
123
02ee3b03
MK
124%install
125rm -rf $RPM_BUILD_ROOT
02ee3b03 126
b5b42a71 127%if %{with python2}
28ffe788 128%py_install
02ee3b03 129
52ca0973 130%{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/psutil/tests
02ee3b03 131%py_postclean
b5b42a71
AM
132%endif
133
134%if %{with python3}
28ffe788 135%py3_install
52ca0973
JB
136
137%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/psutil/tests
b5b42a71
AM
138%endif
139
02ee3b03
MK
140%clean
141rm -rf $RPM_BUILD_ROOT
142
b5b42a71 143%if %{with python2}
02ee3b03
MK
144%files
145%defattr(644,root,root,755)
eb891aca 146%doc CREDITS HISTORY.rst LICENSE README.rst
52ca0973
JB
147%dir %{py_sitedir}/psutil
148%attr(755,root,root) %{py_sitedir}/psutil/_psutil_linux.so
149%attr(755,root,root) %{py_sitedir}/psutil/_psutil_posix.so
150%{py_sitedir}/psutil/*.py[co]
151%{py_sitedir}/psutil-%{version}-py*.egg-info
b5b42a71
AM
152%endif
153
154%if %{with python3}
155%files -n python3-%{module}
156%defattr(644,root,root,755)
eb891aca 157%doc CREDITS HISTORY.rst LICENSE README.rst
52ca0973
JB
158%dir %{py3_sitedir}/psutil
159%attr(755,root,root) %{py3_sitedir}/psutil/_psutil_linux.*.so
160%attr(755,root,root) %{py3_sitedir}/psutil/_psutil_posix.*.so
161%{py3_sitedir}/psutil/*.py
162%{py3_sitedir}/psutil/__pycache__
163%{py3_sitedir}/psutil-%{version}-py*.egg-info
b5b42a71 164%endif
748d284f
JB
165
166%if %{with doc}
167%files apidocs
168%defattr(644,root,root,755)
169%doc docs/_build/html/{_modules,_static,*.html,*.js}
170%endif
This page took 0.075131 seconds and 4 git commands to generate.