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