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
27 BuildRequires: python-prompt_toolkit
30 BuildRequires: python3-Cython
31 BuildRequires: python3-devel
32 BuildRequires: python3-distribute
33 BuildRequires: python3-ipython
34 BuildRequires: python3-modules
35 BuildRequires: python3-prompt_toolkit
37 Requires: python-modules
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 line_profiler will profile the time individual lines of code take to
42 execute. The profiler is implemented in C via Cython in order to
43 reduce the overhead of profiling
45 %description -l pl.UTF-8
46 line_profile wskazuje czas wykonywania poszczególnych linii kodu. Jest
47 zaimplementowany w C poprzez Cythona tak aby zredukować narzut
50 %package -n python3-%{module}
53 Group: Libraries/Python
54 Requires: python3-modules
56 %description -n python3-%{module}
57 line_profiler will profile the time individual lines of code take to
58 execute. The profiler is implemented in C via Cython in order to
59 reduce the overhead of profiling
61 %description -n python3-%{module} -l pl.UTF-8
62 line_profile wskazuje czas wykonywania poszczególnych linii kodu. Jest
63 zaimplementowany w C poprzez Cythona tak aby zredukować narzut
67 Summary: %{module} API documentation
68 Summary(pl.UTF-8): Dokumentacja API %{module}
72 API documentation for %{module}.
74 %description apidocs -l pl.UTF-8
75 Dokumentacja API %{module}.
78 %setup -q -n %{module}-%{version}
83 CFLAGS="%{rpmcppflags} %{rpmcflags} -DHAVE_GETTIMEOFDAY" \
84 %py_build %{?with_tests:test}
89 CFLAGS="%{rpmcppflags} %{rpmcflags} -DHAVE_GETTIMEOFDAY" \
90 %py3_build %{?with_tests:test}
96 rm -rf _build/html/_sources
100 rm -rf $RPM_BUILD_ROOT
113 rm -rf $RPM_BUILD_ROOT
117 %defattr(644,root,root,755)
118 %doc LICENSE.txt README.rst
119 %{py_sitedir}/kernprof.py[co]
120 %{py_sitedir}/line_profiler.py[co]
121 %attr(755,root,root) %{py_sitedir}/_line_profiler.so
122 %if "%{py_ver}" > "2.4"
123 %{py_sitedir}/%{module}-%{version}-py*.egg-info
128 %files -n python3-%{module}
129 %defattr(644,root,root,755)
130 %doc LICENSE.txt README.rst
131 %{py3_sitedir}/kernprof.py
132 %{py3_sitedir}/line_profiler.py
133 %{py3_sitedir}/__pycache__
134 %attr(755,root,root) %{py3_sitedir}/_line_profiler.cpython-*.so
135 %attr(755,root,root) %{_bindir}/kernprof
136 %{py3_sitedir}/%{module}-%{version}-py*.egg-info
141 %defattr(644,root,root,755)
142 %doc docs/_build/html/*