]> git.pld-linux.org Git - packages/python-psutil.git/blob - python-psutil.spec
d87b9918c1b36e6b8a91811bccb11495f175a4ae
[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.1
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:  78f2a25d70cf8682551a0e4d739d5a3c
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.6
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.6
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 %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)
89 install -d tests
90 ln -sf ../scripts tests
91 ln -sf ../setup.py tests
92 %endif
93
94 %build
95 %if %{with python2}
96 %py_build
97
98 %if %{with tests}
99 cd tests
100 ln -snf ../build-2/lib.*/psutil psutil
101 PYTHONPATH=$(pwd) \
102 %{__python} psutil/tests/__main__.py
103 cd ..
104 %endif
105 %endif
106
107 %if %{with python3}
108 %py3_build
109
110 %if %{with tests}
111 cd tests
112 ln -snf ../build-3/lib.*/psutil psutil
113 PYTHONPATH=$(pwd) \
114 %{__python3} psutil/tests/__main__.py
115 cd ..
116 %endif
117 %endif
118
119 %if %{with doc}
120 %{__make} -C docs html \
121         SPHINXBUILD=sphinx-build-2
122 %endif
123
124 %install
125 rm -rf $RPM_BUILD_ROOT
126
127 %if %{with python2}
128 %py_install
129
130 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/psutil/tests
131 %py_postclean
132 %endif
133
134 %if %{with python3}
135 %py3_install
136
137 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/psutil/tests
138 %endif
139
140 %clean
141 rm -rf $RPM_BUILD_ROOT
142
143 %if %{with python2}
144 %files
145 %defattr(644,root,root,755)
146 %doc CREDITS HISTORY.rst LICENSE README.rst
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
152 %endif
153
154 %if %{with python3}
155 %files -n python3-%{module}
156 %defattr(644,root,root,755)
157 %doc CREDITS HISTORY.rst LICENSE README.rst
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
164 %endif
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.110866 seconds and 2 git commands to generate.