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