3 %bcond_with doc # don't build doc (not provided by package)
4 %bcond_without tests # do not perform "make test"
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
8 %define module line_profiler
9 Summary: module for doing line-by-line profiling of functions
10 Summary(pl.UTF-8): Moduł do optymalizacji linia po linii kodu funkcji
11 # Name must match the python module/package name (as in 'import' statement)
12 Name: python-%{module}
16 Group: Libraries/Python
17 Source0: https://github.com/rkern/line_profiler/archive/%{version}.tar.gz
18 # Source0-md5: bd1cb2ba21af02339beab7ddc3a69c66
19 URL: https://github.com/rkern/line_profiler
20 BuildRequires: rpmbuild(macros) >= 1.710
21 BuildRequires: rpm-pythonprov
23 BuildRequires: python-Cython
24 BuildRequires: python-devel
25 BuildRequires: python-distribute
26 BuildRequires: python-ipython
29 BuildRequires: python3-Cython
30 BuildRequires: python3-devel
31 BuildRequires: python3-distribute
32 BuildRequires: python3-ipython
33 BuildRequires: python3-modules
35 Requires: python-modules
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 line_profiler will profile the time individual lines of code take to
40 execute. The profiler is implemented in C via Cython in order to
41 reduce the overhead of profiling
43 %description -l pl.UTF-8
44 line_profile wskazuje czas wykonywania poszczególnych linii kodu. Jest
45 zaimplementowany w C poprzez Cythona tak aby zredukować narzut
48 %package -n python3-%{module}
51 Group: Libraries/Python
52 Requires: python3-modules
54 %description -n python3-%{module}
55 line_profiler will profile the time individual lines of code take to
56 execute. The profiler is implemented in C via Cython in order to
57 reduce the overhead of profiling
59 %description -n python3-%{module} -l pl.UTF-8
60 line_profile wskazuje czas wykonywania poszczególnych linii kodu. Jest
61 zaimplementowany w C poprzez Cythona tak aby zredukować narzut
65 Summary: %{module} API documentation
66 Summary(pl.UTF-8): Dokumentacja API %{module}
70 API documentation for %{module}.
72 %description apidocs -l pl.UTF-8
73 Dokumentacja API %{module}.
76 %setup -q -n %{module}-%{version}
81 CFLAGS="%{rpmcppflags} %{rpmcflags} -DHAVE_GETTIMEOFDAY" \
82 %py_build %{?with_tests:test}
87 CFLAGS="%{rpmcppflags} %{rpmcflags} -DHAVE_GETTIMEOFDAY" \
88 %py3_build %{?with_tests:test}
94 rm -rf _build/html/_sources
98 rm -rf $RPM_BUILD_ROOT
111 rm -rf $RPM_BUILD_ROOT
115 %defattr(644,root,root,755)
116 %doc LICENSE.txt README.rst
117 %{py_sitedir}/kernprof.py[co]
118 %{py_sitedir}/line_profiler.py[co]
119 %attr(755,root,root) %{py_sitedir}/_line_profiler.so
120 %if "%{py_ver}" > "2.4"
121 %{py_sitedir}/%{module}-%{version}-py*.egg-info
126 %files -n python3-%{module}
127 %defattr(644,root,root,755)
128 %doc LICENSE.txt README.rst
129 %{py3_sitedir}/kernprof.py
130 %{py3_sitedir}/line_profiler.py
131 %{py3_sitedir}/__pycache__
132 %attr(755,root,root) %{py3_sitedir}/_line_profiler.cpython-*.so
133 %attr(755,root,root) %{_bindir}/kernprof
134 %{py3_sitedir}/%{module}-%{version}-py*.egg-info
139 %defattr(644,root,root,755)
140 %doc docs/_build/html/*