]> git.pld-linux.org Git - packages/python-psutil.git/blame - python-psutil.spec
BR: rpmbuild(macros) >= 1.710
[packages/python-psutil.git] / python-psutil.spec
CommitLineData
02ee3b03
MK
1#
2# Conditional build:
3%bcond_without tests # do not perform "make test"
b5b42a71
AM
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
02ee3b03
MK
6
7%define module psutil
8Summary: A cross-platform process and system utilities module for Python
9Summary(pl.UTF-8): Wieloplatformowe narzędzia do procesów i systemu dla Pythona
10Name: python-%{module}
0a81eebb 11Version: 3.0.1
b8039469 12Release: 4
02ee3b03
MK
13License: BSD
14Group: Development/Languages/Python
fba9537b 15Source0: https://pypi.python.org/packages/source/p/psutil/%{module}-%{version}.tar.gz
0a81eebb 16# Source0-md5: 037dc67b7902d10f49f6fa5404a73a24
02ee3b03 17URL: http://code.google.com/p/psutil/
b5b42a71
AM
18BuildRequires: rpm-pythonprov
19%if %{with python2}
02ee3b03
MK
20BuildRequires: python-devel
21BuildRequires: python-distribute
b5b42a71
AM
22%endif
23%if %{with python3}
24BuildRequires: python3-devel
25BuildRequires: python3-distribute
26BuildRequires: python3-modules
27%endif
7fbc6e55 28BuildRequires: rpmbuild(macros) >= 1.710
02ee3b03
MK
29Requires: python-modules
30BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32%description
33Module providing an interface for retrieving information on all
34running processes and system utilization (CPU, disk, memory, network)
35in a portable way by using Python, implementing many functionalities
36offered by command line tools.
37
38%description -l pl.UTF-8
39Moduł dostarczający interfejs do informacji o działających procesach
40oraz zużyciu systemu (procesor, dyski, pamięć, sieć) w przenośny
41sposób używjąc Pythona. Implementuje wiele funkcjonalności oferowanych
42przez narzędzia linii komend.
43
b5b42a71
AM
44%package -n python3-%{module}
45Summary: A cross-platform process and system utilities module for Python
46Summary(pl.UTF-8): Wieloplatformowe narzędzia do procesów i systemu dla Pythona
47Group: Libraries/Python
48Requires: python3-modules
49
50%description -n python3-%{module}
51Module providing an interface for retrieving information on all
52running processes and system utilization (CPU, disk, memory, network)
53in a portable way by using Python, implementing many functionalities
54offered by command line tools.
55
56%description -n python3-%{module} -l pl.UTF-8
57Module providing an interface for retrieving information on all
58running processes and system utilization (CPU, disk, memory, network)
59in a portable way by using Python, implementing many functionalities
60offered by command line tools.
61
02ee3b03
MK
62%prep
63%setup -q -n %{module}-%{version}
64
02ee3b03 65%build
b5b42a71 66%if %{with python2}
02ee3b03 67CC="%{__cc}" \
b5b42a71 68CFLAGS="%{rpmcppflags} %{rpmcflags}" \
28ffe788 69%py_build
b5b42a71
AM
70%{?with_tests:export PYTHONPATH=$(pwd)/build-2; %{__python} setup.py test}
71%endif
02ee3b03 72
b5b42a71
AM
73%if %{with python3}
74CC="%{__cc}" \
75CFLAGS="%{rpmcppflags} %{rpmcflags}" \
28ffe788 76%py3_build
b5b42a71
AM
77%{?with_tests:export PYTHONPATH=$(pwd)/build-3; %{__python3} setup.py test}
78%endif
02ee3b03
MK
79
80%install
81rm -rf $RPM_BUILD_ROOT
02ee3b03 82
b5b42a71 83%if %{with python2}
28ffe788 84%py_install
02ee3b03 85
02ee3b03 86%py_postclean
b5b42a71
AM
87%endif
88
89%if %{with python3}
28ffe788 90%py3_install
b5b42a71
AM
91%endif
92
93%if %{with python2}
94install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
95cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
96%endif
97%if %{with python3}
98install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
99cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
100find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
101 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
102%endif
02ee3b03
MK
103
104%clean
105rm -rf $RPM_BUILD_ROOT
106
b5b42a71 107%if %{with python2}
02ee3b03
MK
108%files
109%defattr(644,root,root,755)
b5b42a71 110%doc CREDITS README.rst HISTORY.rst
02ee3b03 111
0a81eebb
AM
112%dir %{py_sitedir}/%{module}
113%{py_sitedir}/%{module}/*.py*
114%attr(755,root,root) %{py_sitedir}/%{module}/_psutil_linux.so
115%attr(755,root,root) %{py_sitedir}/%{module}/_psutil_posix.so
02ee3b03
MK
116
117%if "%{py_ver}" > "2.4"
118%{py_sitedir}/%{module}-*.egg-info
119%endif
120%{_examplesdir}/%{name}-%{version}
b5b42a71
AM
121%endif
122
123%if %{with python3}
124%files -n python3-%{module}
125%defattr(644,root,root,755)
126%doc CREDITS README.rst HISTORY.rst
127
0a81eebb
AM
128%dir %{py3_sitedir}/%{module}
129%{py3_sitedir}/%{module}/*.py
130%{py3_sitedir}/%{module}/__pycache__
131%attr(755,root,root) %{py3_sitedir}/%{module}/_psutil_linux.*.so
132%attr(755,root,root) %{py3_sitedir}/%{module}/_psutil_posix.*.so
b5b42a71
AM
133
134%{py3_sitedir}/%{module}-%{version}-py*.egg-info
135%{_examplesdir}/python3-%{module}-%{version}
136%endif
This page took 0.087478 seconds and 4 git commands to generate.