]>
Commit | Line | Data |
---|---|---|
fb9dc603 MK |
1 | # TODO: |
2 | # - Fix tests | |
52ca0973 | 3 | # |
02ee3b03 | 4 | # Conditional build: |
79c2de42 | 5 | %bcond_with tests # do not perform "make test" |
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 |
10 | Summary: A cross-platform process and system utilities module for Python |
11 | Summary(pl.UTF-8): Wieloplatformowe narzędzia do procesów i systemu dla Pythona | |
12 | Name: python-%{module} | |
2d7eca37 | 13 | Version: 5.4.5 |
d10a6568 | 14 | Release: 2 |
02ee3b03 MK |
15 | License: BSD |
16 | Group: Development/Languages/Python | |
52ca0973 | 17 | #Source0Download: https://pypi.python.org/simple/psutil/ |
cfcf3673 | 18 | Source0: https://github.com/giampaolo/psutil/archive/release-%{version}.tar.gz |
2d7eca37 | 19 | # Source0-md5: ce3e6b33706dd73eea4c37566eb9a0a1 |
72bc27e5 | 20 | URL: https://github.com/giampaolo/psutil |
b5b42a71 | 21 | BuildRequires: rpm-pythonprov |
52ca0973 | 22 | BuildRequires: rpmbuild(macros) >= 1.714 |
b5b42a71 | 23 | %if %{with python2} |
52ca0973 JB |
24 | BuildRequires: python-devel >= 1:2.6 |
25 | %if %{with tests} | |
79c2de42 | 26 | BuildRequires: python-mock |
52ca0973 JB |
27 | %if "%{py_ver}" < "2.7" |
28 | BuildRequires: python-unittest2 | |
29 | %endif | |
30 | %endif | |
b5b42a71 AM |
31 | %endif |
32 | %if %{with python3} | |
52ca0973 JB |
33 | BuildRequires: python3-devel >= 1:3.2 |
34 | BuildRequires: python3-modules >= 1:3.2 | |
b5b42a71 | 35 | %endif |
52ca0973 | 36 | Requires: python-modules >= 1:2.6 |
02ee3b03 MK |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
38 | ||
39 | %description | |
40 | Module providing an interface for retrieving information on all | |
41 | running processes and system utilization (CPU, disk, memory, network) | |
42 | in a portable way by using Python, implementing many functionalities | |
43 | offered by command line tools. | |
44 | ||
45 | %description -l pl.UTF-8 | |
46 | Moduł dostarczający interfejs do informacji o działających procesach | |
47 | oraz zużyciu systemu (procesor, dyski, pamięć, sieć) w przenośny | |
48 | sposób używjąc Pythona. Implementuje wiele funkcjonalności oferowanych | |
49 | przez narzędzia linii komend. | |
50 | ||
b5b42a71 AM |
51 | %package -n python3-%{module} |
52 | Summary: A cross-platform process and system utilities module for Python | |
53 | Summary(pl.UTF-8): Wieloplatformowe narzędzia do procesów i systemu dla Pythona | |
54 | Group: Libraries/Python | |
52ca0973 | 55 | Requires: python3-modules >= 1:3.2 |
b5b42a71 AM |
56 | |
57 | %description -n python3-%{module} | |
58 | Module providing an interface for retrieving information on all | |
59 | running processes and system utilization (CPU, disk, memory, network) | |
60 | in a portable way by using Python, implementing many functionalities | |
61 | offered by command line tools. | |
62 | ||
63 | %description -n python3-%{module} -l pl.UTF-8 | |
64 | Module providing an interface for retrieving information on all | |
65 | running processes and system utilization (CPU, disk, memory, network) | |
66 | in a portable way by using Python, implementing many functionalities | |
67 | offered by command line tools. | |
68 | ||
02ee3b03 | 69 | %prep |
cfcf3673 | 70 | %setup -q -n %{module}-release-%{version} |
02ee3b03 | 71 | |
02ee3b03 | 72 | %build |
b5b42a71 | 73 | %if %{with python2} |
28ffe788 | 74 | %py_build |
52ca0973 | 75 | |
2d7eca37 | 76 | %{?with_tests:export PYTHONPATH=$(echo $(pwd)/build-2/lib.*); %{__python} psutil/tests/__main__.py} |
b5b42a71 | 77 | %endif |
02ee3b03 | 78 | |
b5b42a71 | 79 | %if %{with python3} |
28ffe788 | 80 | %py3_build |
52ca0973 | 81 | |
2d7eca37 | 82 | %{?with_tests:export PYTHONPATH=$(echo $(pwd)/build-3/lib.*); %{__python3} psutil/tests/__main__.py} |
b5b42a71 | 83 | %endif |
02ee3b03 MK |
84 | |
85 | %install | |
86 | rm -rf $RPM_BUILD_ROOT | |
02ee3b03 | 87 | |
b5b42a71 | 88 | %if %{with python2} |
28ffe788 | 89 | %py_install |
02ee3b03 | 90 | |
52ca0973 | 91 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/psutil/tests |
02ee3b03 | 92 | %py_postclean |
b5b42a71 AM |
93 | %endif |
94 | ||
95 | %if %{with python3} | |
28ffe788 | 96 | %py3_install |
52ca0973 JB |
97 | |
98 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/psutil/tests | |
b5b42a71 AM |
99 | %endif |
100 | ||
02ee3b03 MK |
101 | %clean |
102 | rm -rf $RPM_BUILD_ROOT | |
103 | ||
b5b42a71 | 104 | %if %{with python2} |
02ee3b03 MK |
105 | %files |
106 | %defattr(644,root,root,755) | |
52ca0973 JB |
107 | %doc CREDITS HISTORY.rst IDEAS LICENSE README.rst |
108 | %dir %{py_sitedir}/psutil | |
109 | %attr(755,root,root) %{py_sitedir}/psutil/_psutil_linux.so | |
110 | %attr(755,root,root) %{py_sitedir}/psutil/_psutil_posix.so | |
111 | %{py_sitedir}/psutil/*.py[co] | |
112 | %{py_sitedir}/psutil-%{version}-py*.egg-info | |
b5b42a71 AM |
113 | %endif |
114 | ||
115 | %if %{with python3} | |
116 | %files -n python3-%{module} | |
117 | %defattr(644,root,root,755) | |
52ca0973 JB |
118 | %doc CREDITS HISTORY.rst IDEAS LICENSE README.rst |
119 | %dir %{py3_sitedir}/psutil | |
120 | %attr(755,root,root) %{py3_sitedir}/psutil/_psutil_linux.*.so | |
121 | %attr(755,root,root) %{py3_sitedir}/psutil/_psutil_posix.*.so | |
122 | %{py3_sitedir}/psutil/*.py | |
123 | %{py3_sitedir}/psutil/__pycache__ | |
124 | %{py3_sitedir}/psutil-%{version}-py*.egg-info | |
b5b42a71 | 125 | %endif |