]>
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 | ||
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} | |
13 | Version: 1.0 | |
7cb3c9f3 | 14 | Release: 3 |
b1135905 MK |
15 | License: BSD |
16 | Group: Libraries/Python | |
17 | Source0: https://pypi.python.org/packages/source/l/%{module}/%{module}-%{version}.tar.gz | |
18 | # Source0-md5: 2f8352acfedf83f701a564583db5e14d | |
19 | URL: https://github.com/rkern/line_profiler | |
20 | BuildRequires: rpm-pythonprov | |
21 | %if %{with python2} | |
22 | BuildRequires: python-devel | |
23 | BuildRequires: python-distribute | |
24 | %endif | |
25 | %if %{with python3} | |
26 | BuildRequires: python3-devel | |
27 | BuildRequires: python3-distribute | |
28 | BuildRequires: python3-modules | |
29 | %endif | |
30 | Requires: python-modules | |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
34 | line_profiler will profile the time individual lines of code take to | |
35 | execute. The profiler is implemented in C via Cython in order to | |
36 | reduce the overhead of profiling | |
37 | ||
38 | %description -l pl.UTF-8 | |
39 | line_profile wskazuje czas wykonywania poszczególnych linii kodu. Jest | |
40 | zaimplementowany w C poprzez Cythona tak aby zredukować narzut | |
41 | profilowania. | |
42 | ||
43 | %package -n python3-%{module} | |
44 | Summary: - | |
45 | Summary(pl.UTF-8): - | |
46 | Group: Libraries/Python | |
47 | Requires: python3-modules | |
48 | ||
49 | %description -n python3-%{module} | |
50 | line_profiler will profile the time individual lines of code take to | |
51 | execute. The profiler is implemented in C via Cython in order to | |
52 | reduce the overhead of profiling | |
53 | ||
54 | %description -n python3-%{module} -l pl.UTF-8 | |
55 | line_profile wskazuje czas wykonywania poszczególnych linii kodu. Jest | |
56 | zaimplementowany w C poprzez Cythona tak aby zredukować narzut | |
57 | profilowania. | |
58 | ||
59 | %package apidocs | |
60 | Summary: %{module} API documentation | |
61 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
62 | Group: Documentation | |
63 | ||
64 | %description apidocs | |
65 | API documentation for %{module}. | |
66 | ||
67 | %description apidocs -l pl.UTF-8 | |
68 | Dokumentacja API %{module}. | |
69 | ||
70 | %prep | |
71 | %setup -q -n %{module}-%{version} | |
72 | ||
73 | %build | |
74 | %if %{with python2} | |
75 | CC="%{__cc}" \ | |
76 | CFLAGS="%{rpmcppflags} %{rpmcflags}" \ | |
77 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} | |
78 | %endif | |
79 | ||
80 | %if %{with python3} | |
81 | CC="%{__cc}" \ | |
82 | CFLAGS="%{rpmcppflags} %{rpmcflags}" \ | |
83 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
84 | %endif | |
85 | ||
86 | %if %{with doc} | |
87 | cd docs | |
88 | %{__make} -j1 html | |
89 | rm -rf _build/html/_sources | |
90 | %endif | |
91 | ||
92 | %install | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
95 | %if %{with python2} | |
96 | %{__python} setup.py \ | |
97 | build --build-base build-2 \ | |
98 | install --skip-build \ | |
99 | --optimize=2 \ | |
100 | --root=$RPM_BUILD_ROOT | |
101 | ||
102 | %py_postclean | |
103 | %endif | |
104 | ||
105 | %if %{with python3} | |
106 | %{__python3} setup.py \ | |
107 | build --build-base build-3 \ | |
108 | install --skip-build \ | |
109 | --optimize=2 \ | |
110 | --root=$RPM_BUILD_ROOT | |
111 | %endif | |
112 | ||
113 | %clean | |
114 | rm -rf $RPM_BUILD_ROOT | |
115 | ||
116 | %if %{with python2} | |
117 | %files | |
118 | %defattr(644,root,root,755) | |
119 | %doc LICENSE.txt README.rst | |
120 | %{py_sitedir}/kernprof.py[co] | |
121 | %{py_sitedir}/line_profiler.py[co] | |
122 | %attr(755,root,root) %{py_sitedir}/_line_profiler.so | |
123 | %if "%{py_ver}" > "2.4" | |
124 | %{py_sitedir}/%{module}-%{version}-py*.egg-info | |
125 | %endif | |
126 | %endif | |
127 | ||
128 | %if %{with python3} | |
129 | %files -n python3-%{module} | |
130 | %defattr(644,root,root,755) | |
131 | %doc LICENSE.txt README.rst | |
132 | %{py3_sitedir}/kernprof.py | |
133 | %{py3_sitedir}/line_profiler.py | |
134 | %{py3_sitedir}/__pycache__ | |
135 | %attr(755,root,root) %{py3_sitedir}/_line_profiler.cpython-*m.so | |
136 | %attr(755,root,root) %{_bindir}/kernprof | |
137 | %{py3_sitedir}/%{module}-%{version}-py*.egg-info | |
138 | %endif | |
139 | ||
140 | %if %{with doc} | |
141 | %files apidocs | |
142 | %defattr(644,root,root,755) | |
143 | %doc docs/_build/html/* | |
144 | %endif |