]>
Commit | Line | Data |
---|---|---|
b1135905 MK |
1 | # |
2 | # Conditional build: | |
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 | |
7 | ||
cd7cf9c2 | 8 | %define module line_profiler |
b1135905 MK |
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} | |
b0abd0f6 | 13 | Version: 2.1 |
4100708a | 14 | Release: 7 |
b1135905 MK |
15 | License: BSD |
16 | Group: Libraries/Python | |
b0abd0f6 AM |
17 | Source0: https://github.com/rkern/line_profiler/archive/%{version}.tar.gz |
18 | # Source0-md5: bd1cb2ba21af02339beab7ddc3a69c66 | |
b1135905 | 19 | URL: https://github.com/rkern/line_profiler |
18023865 | 20 | BuildRequires: rpmbuild(macros) >= 1.710 |
b1135905 MK |
21 | BuildRequires: rpm-pythonprov |
22 | %if %{with python2} | |
c3634a62 | 23 | BuildRequires: python-Cython |
b1135905 MK |
24 | BuildRequires: python-devel |
25 | BuildRequires: python-distribute | |
b0abd0f6 | 26 | BuildRequires: python-ipython |
e61696de | 27 | BuildRequires: python-prompt_toolkit |
b1135905 MK |
28 | %endif |
29 | %if %{with python3} | |
c3634a62 | 30 | BuildRequires: python3-Cython |
b1135905 MK |
31 | BuildRequires: python3-devel |
32 | BuildRequires: python3-distribute | |
b0abd0f6 | 33 | BuildRequires: python3-ipython |
b1135905 | 34 | BuildRequires: python3-modules |
e61696de | 35 | BuildRequires: python3-prompt_toolkit |
b1135905 MK |
36 | %endif |
37 | Requires: python-modules | |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
39 | ||
40 | %description | |
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 | |
44 | ||
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 | |
48 | profilowania. | |
49 | ||
50 | %package -n python3-%{module} | |
51 | Summary: - | |
52 | Summary(pl.UTF-8): - | |
53 | Group: Libraries/Python | |
54 | Requires: python3-modules | |
55 | ||
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 | |
60 | ||
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 | |
64 | profilowania. | |
65 | ||
66 | %package apidocs | |
67 | Summary: %{module} API documentation | |
68 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
69 | Group: Documentation | |
70 | ||
71 | %description apidocs | |
72 | API documentation for %{module}. | |
73 | ||
74 | %description apidocs -l pl.UTF-8 | |
75 | Dokumentacja API %{module}. | |
76 | ||
77 | %prep | |
78 | %setup -q -n %{module}-%{version} | |
79 | ||
80 | %build | |
81 | %if %{with python2} | |
82 | CC="%{__cc}" \ | |
cd7cf9c2 | 83 | CFLAGS="%{rpmcppflags} %{rpmcflags} -DHAVE_GETTIMEOFDAY" \ |
8541e604 | 84 | %py_build %{?with_tests:test} |
b1135905 MK |
85 | %endif |
86 | ||
87 | %if %{with python3} | |
88 | CC="%{__cc}" \ | |
cd7cf9c2 | 89 | CFLAGS="%{rpmcppflags} %{rpmcflags} -DHAVE_GETTIMEOFDAY" \ |
8541e604 | 90 | %py3_build %{?with_tests:test} |
b1135905 MK |
91 | %endif |
92 | ||
93 | %if %{with doc} | |
94 | cd docs | |
95 | %{__make} -j1 html | |
96 | rm -rf _build/html/_sources | |
97 | %endif | |
98 | ||
99 | %install | |
100 | rm -rf $RPM_BUILD_ROOT | |
101 | ||
102 | %if %{with python2} | |
8541e604 | 103 | %py_install |
b1135905 MK |
104 | |
105 | %py_postclean | |
106 | %endif | |
107 | ||
108 | %if %{with python3} | |
8541e604 | 109 | %py3_install |
b1135905 MK |
110 | %endif |
111 | ||
112 | %clean | |
113 | rm -rf $RPM_BUILD_ROOT | |
114 | ||
115 | %if %{with python2} | |
116 | %files | |
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 | |
124 | %endif | |
125 | %endif | |
126 | ||
127 | %if %{with python3} | |
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__ | |
60d1c445 | 134 | %attr(755,root,root) %{py3_sitedir}/_line_profiler.cpython-*.so |
b1135905 MK |
135 | %attr(755,root,root) %{_bindir}/kernprof |
136 | %{py3_sitedir}/%{module}-%{version}-py*.egg-info | |
137 | %endif | |
138 | ||
139 | %if %{with doc} | |
140 | %files apidocs | |
141 | %defattr(644,root,root,755) | |
142 | %doc docs/_build/html/* | |
143 | %endif |