]> git.pld-linux.org Git - packages/python-psutil.git/blob - python-psutil.spec
- release 2 (by relup.sh)
[packages/python-psutil.git] / python-psutil.spec
1 # TODO:
2 # - Fix tests
3 #
4 # Conditional build:
5 %bcond_with     tests   # do not perform "make test"
6 %bcond_without  python2 # CPython 2.x module
7 %bcond_without  python3 # CPython 3.x module
8
9 %define         module  psutil
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}
13 Version:        5.4.5
14 Release:        2
15 License:        BSD
16 Group:          Development/Languages/Python
17 #Source0Download: https://pypi.python.org/simple/psutil/
18 Source0:        https://github.com/giampaolo/psutil/archive/release-%{version}.tar.gz
19 # Source0-md5:  ce3e6b33706dd73eea4c37566eb9a0a1
20 URL:            https://github.com/giampaolo/psutil
21 BuildRequires:  rpm-pythonprov
22 BuildRequires:  rpmbuild(macros) >= 1.714
23 %if %{with python2}
24 BuildRequires:  python-devel >= 1:2.6
25 %if %{with tests}
26 BuildRequires:  python-mock
27 %if "%{py_ver}" < "2.7"
28 BuildRequires:  python-unittest2
29 %endif
30 %endif
31 %endif
32 %if %{with python3}
33 BuildRequires:  python3-devel >= 1:3.2
34 BuildRequires:  python3-modules >= 1:3.2
35 %endif
36 Requires:       python-modules >= 1:2.6
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
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
55 Requires:       python3-modules >= 1:3.2
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
69 %prep
70 %setup -q -n %{module}-release-%{version}
71
72 %build
73 %if %{with python2}
74 %py_build
75
76 %{?with_tests:export PYTHONPATH=$(echo $(pwd)/build-2/lib.*); %{__python} psutil/tests/__main__.py}
77 %endif
78
79 %if %{with python3}
80 %py3_build
81
82 %{?with_tests:export PYTHONPATH=$(echo $(pwd)/build-3/lib.*); %{__python3} psutil/tests/__main__.py}
83 %endif
84
85 %install
86 rm -rf $RPM_BUILD_ROOT
87
88 %if %{with python2}
89 %py_install
90
91 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/psutil/tests
92 %py_postclean
93 %endif
94
95 %if %{with python3}
96 %py3_install
97
98 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/psutil/tests
99 %endif
100
101 %clean
102 rm -rf $RPM_BUILD_ROOT
103
104 %if %{with python2}
105 %files
106 %defattr(644,root,root,755)
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
113 %endif
114
115 %if %{with python3}
116 %files -n python3-%{module}
117 %defattr(644,root,root,755)
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
125 %endif
This page took 0.079038 seconds and 3 git commands to generate.