]>
Commit | Line | Data |
---|---|---|
3b3eae2e MK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with doc # don't build doc (not povided 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 | ## TODO: consider rename to flask_debugtoolbar_lineprofilerpanel ? | |
8 | %define module flask-debugtoolbar-lineprofilerpanel | |
9 | Summary: Panel for the Flask Debug toolbar to capture and view line-by-line profiling stats | |
10 | Summary(pl.UTF-8): Pandel do Flask Debug toolbar do analizy statystyk wykonania kodu linia po linii | |
11 | Name: python-%{module} | |
12 | Version: 1.0.2 | |
35b83c75 | 13 | Release: 2 |
3b3eae2e MK |
14 | License: MIT |
15 | Group: Libraries/Python | |
16 | Source0: https://pypi.python.org/packages/source/F/Flask-DebugToolbar-LineProfilerPanel/Flask-DebugToolbar-LineProfilerPanel-%{version}.tar.gz | |
17 | # Source0-md5: 005d47cb98cff464ce9042b9bf66c230 | |
18 | URL: https://github.com/phleet/flask_debugtoolbar_lineprofilerpanel | |
19 | BuildRequires: rpm-pythonprov | |
20 | %if %{with python2} | |
21 | BuildRequires: python-distribute | |
22 | BuildRequires: python-flask-debugtoolbar | |
23 | BuildRequires: python-line_profiler | |
24 | ||
25 | %endif | |
26 | %if %{with python3} | |
27 | BuildRequires: python3-distribute | |
28 | BuildRequires: python3-flask-debugtoolbar | |
29 | BuildRequires: python3-line_profiler | |
30 | BuildRequires: python3-modules | |
31 | ||
32 | %endif | |
33 | # Below Rs only work for main package (python2) | |
34 | #Requires: python-libs | |
35 | Requires: python-modules | |
36 | BuildArch: noarch | |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
38 | ||
39 | %description | |
40 | Panel for flask_debugtoolbar which enables the ability to view line | |
41 | profiling information from selected functions. The line profile | |
42 | information comes from the line_profiler module. | |
43 | ||
44 | %description -l pl.UTF-8 | |
45 | Panel dla flask_debugtoolbar który pozwala zobaczyć i zanalizować | |
46 | czasy wykonania linii wybranych funkcji. Informacje są pobierane z | |
47 | modułu line_profiler. | |
48 | ||
49 | %package -n python3-%{module} | |
50 | Summary: Panel for the Flask Debug toolbar to capture and view line-by-line profiling stats | |
51 | Summary(pl.UTF-8): Pandel do Flask Debug toolbar do analizy statystyk wykonania kodu linia po linii | |
52 | Group: Libraries/Python | |
53 | Requires: python3-modules | |
54 | ||
55 | %description -n python3-%{module} | |
56 | Panel for flask_debugtoolbar which enables the ability to view line | |
57 | profiling information from selected functions. The line profile | |
58 | information comes from the line_profiler module. | |
59 | ||
60 | %description -n python3-%{module} -l pl.UTF-8 | |
61 | Panel dla flask_debugtoolbar który pozwala zobaczyć i zanalizować | |
62 | czasy wykonania linii wybranych funkcji. Informacje są pobierane z | |
63 | modułu line_profiler. | |
64 | ||
65 | %package apidocs | |
66 | Summary: %{module} API documentation | |
67 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
68 | Group: Documentation | |
69 | ||
70 | %description apidocs | |
71 | API documentation for %{module}. | |
72 | ||
73 | %description apidocs -l pl.UTF-8 | |
74 | Dokumentacja API %{module}. | |
75 | ||
76 | %prep | |
77 | %setup -q -n Flask-DebugToolbar-LineProfilerPanel-%{version} | |
35b83c75 MK |
78 | # Until fixed upstream: |
79 | sed -i 's/line-profiler>=1.0b3/line_profiler>=1.0/g' setup.py | |
3b3eae2e MK |
80 | |
81 | %build | |
82 | %if %{with python2} | |
83 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} | |
84 | %endif | |
85 | ||
86 | %if %{with python3} | |
87 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
88 | %endif | |
89 | ||
90 | %if %{with doc} | |
91 | cd docs | |
92 | %{__make} -j1 html | |
93 | rm -rf _build/html/_sources | |
94 | %endif | |
95 | ||
96 | %install | |
97 | rm -rf $RPM_BUILD_ROOT | |
98 | ||
99 | %if %{with python2} | |
100 | %{__python} setup.py \ | |
101 | build --build-base build-2 \ | |
102 | install --skip-build \ | |
103 | --optimize=2 \ | |
104 | --root=$RPM_BUILD_ROOT | |
105 | ||
106 | %py_postclean | |
107 | %endif | |
108 | ||
109 | %if %{with python3} | |
110 | %{__python3} setup.py \ | |
111 | build --build-base build-3 \ | |
112 | install --skip-build \ | |
113 | --optimize=2 \ | |
114 | --root=$RPM_BUILD_ROOT | |
115 | %endif | |
116 | ||
117 | %clean | |
118 | rm -rf $RPM_BUILD_ROOT | |
119 | ||
120 | %if %{with python2} | |
121 | %files | |
122 | %defattr(644,root,root,755) | |
123 | %{py_sitescriptdir}/flask_debugtoolbar_lineprofilerpanel | |
124 | %if "%{py_ver}" > "2.4" | |
125 | %{py_sitescriptdir}/Flask_DebugToolbar_LineProfilerPanel-%{version}-py*.egg-info | |
126 | %endif | |
127 | %endif | |
128 | ||
129 | %if %{with python3} | |
130 | %files -n python3-%{module} | |
131 | %defattr(644,root,root,755) | |
132 | %{py3_sitescriptdir}/flask_debugtoolbar_lineprofilerpanel | |
133 | %{py3_sitescriptdir}/Flask_DebugToolbar_LineProfilerPanel-%{version}-py*.egg-info | |
134 | %endif | |
135 | ||
136 | %if %{with doc} | |
137 | %files apidocs | |
138 | %defattr(644,root,root,755) | |
139 | %doc docs/_build/html/* | |
140 | %endif |