]> git.pld-linux.org Git - packages/python-psutil.git/blame_incremental - python-psutil.spec
- up to 5.4.8
[packages/python-psutil.git] / python-psutil.spec
... / ...
CommitLineData
1# TODO:
2# - Fix tests (a few fail)
3#
4# Conditional build:
5%bcond_with tests # unit tests
6%bcond_without python2 # CPython 2.x module
7%bcond_without python3 # CPython 3.x module
8
9%define module psutil
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}
13Version: 5.4.8
14Release: 1
15License: BSD
16Group: Development/Languages/Python
17#Source0Download: https://pypi.org/simple/psutil/
18Source0: https://github.com/giampaolo/psutil/archive/release-%{version}/%{module}-%{version}.tar.gz
19# Source0-md5: 27a34a9aba8bec93cc0927647999b400
20URL: https://github.com/giampaolo/psutil
21BuildRequires: rpm-pythonprov
22BuildRequires: rpmbuild(macros) >= 1.714
23%if %{with python2}
24BuildRequires: python-devel >= 1:2.6
25%if %{with tests}
26BuildRequires: python-ipaddress
27BuildRequires: python-mock
28%if "%{py_ver}" < "2.7"
29BuildRequires: python-unittest2
30%endif
31%endif
32%endif
33%if %{with python3}
34BuildRequires: python3-devel >= 1:3.4
35BuildRequires: python3-modules >= 1:3.4
36%endif
37Requires: python-modules >= 1:2.6
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
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
56Requires: python3-modules >= 1:3.4
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
70%prep
71%setup -q -n %{module}-release-%{version}
72
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
81%build
82%if %{with python2}
83%py_build
84# "test" target causes endless loop, so...
85
86%if %{with tests}
87cd tests
88ln -snf ../build-2/lib.*/psutil psutil
89PYTHONPATH=$(pwd) \
90%{__python} -m psutil.tests
91cd ..
92%endif
93%endif
94
95%if %{with python3}
96%py3_build
97
98%if %{with tests}
99cd tests
100ln -snf ../build-3/lib.*/psutil psutil
101PYTHONPATH=$(pwd) \
102%{__python3} -m psutil.tests
103cd ..
104%endif
105%endif
106
107%install
108rm -rf $RPM_BUILD_ROOT
109
110%if %{with python2}
111%py_install
112
113%{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/psutil/tests
114%py_postclean
115%endif
116
117%if %{with python3}
118%py3_install
119
120%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/psutil/tests
121%endif
122
123%clean
124rm -rf $RPM_BUILD_ROOT
125
126%if %{with python2}
127%files
128%defattr(644,root,root,755)
129%doc CREDITS HISTORY.rst IDEAS LICENSE README.rst
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
135%endif
136
137%if %{with python3}
138%files -n python3-%{module}
139%defattr(644,root,root,755)
140%doc CREDITS HISTORY.rst IDEAS LICENSE README.rst
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
147%endif
This page took 0.030559 seconds and 4 git commands to generate.