]>
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 | |
d5a69753 | 13 | Release: 7 |
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 | |
5bb99452 | 19 | BuildRequires: rpmbuild(macros) >= 1.710 |
3b3eae2e MK |
20 | BuildRequires: rpm-pythonprov |
21 | %if %{with python2} | |
22 | BuildRequires: python-distribute | |
23 | BuildRequires: python-flask-debugtoolbar | |
24 | BuildRequires: python-line_profiler | |
25 | ||
26 | %endif | |
27 | %if %{with python3} | |
28 | BuildRequires: python3-distribute | |
29 | BuildRequires: python3-flask-debugtoolbar | |
30 | BuildRequires: python3-line_profiler | |
31 | BuildRequires: python3-modules | |
32 | ||
33 | %endif | |
34 | # Below Rs only work for main package (python2) | |
35 | #Requires: python-libs | |
36 | Requires: python-modules | |
37 | BuildArch: noarch | |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
39 | ||
40 | %description | |
41 | Panel for flask_debugtoolbar which enables the ability to view line | |
42 | profiling information from selected functions. The line profile | |
43 | information comes from the line_profiler module. | |
44 | ||
45 | %description -l pl.UTF-8 | |
46 | Panel dla flask_debugtoolbar który pozwala zobaczyć i zanalizować | |
47 | czasy wykonania linii wybranych funkcji. Informacje są pobierane z | |
48 | modułu line_profiler. | |
49 | ||
50 | %package -n python3-%{module} | |
51 | Summary: Panel for the Flask Debug toolbar to capture and view line-by-line profiling stats | |
52 | Summary(pl.UTF-8): Pandel do Flask Debug toolbar do analizy statystyk wykonania kodu linia po linii | |
53 | Group: Libraries/Python | |
54 | Requires: python3-modules | |
55 | ||
56 | %description -n python3-%{module} | |
57 | Panel for flask_debugtoolbar which enables the ability to view line | |
58 | profiling information from selected functions. The line profile | |
59 | information comes from the line_profiler module. | |
60 | ||
61 | %description -n python3-%{module} -l pl.UTF-8 | |
62 | Panel dla flask_debugtoolbar który pozwala zobaczyć i zanalizować | |
63 | czasy wykonania linii wybranych funkcji. Informacje są pobierane z | |
64 | modułu line_profiler. | |
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 Flask-DebugToolbar-LineProfilerPanel-%{version} | |
35b83c75 MK |
79 | # Until fixed upstream: |
80 | sed -i 's/line-profiler>=1.0b3/line_profiler>=1.0/g' setup.py | |
3b3eae2e MK |
81 | |
82 | %build | |
83 | %if %{with python2} | |
fdb515e7 | 84 | %py_build %{?with_tests:test} |
3b3eae2e MK |
85 | %endif |
86 | ||
87 | %if %{with python3} | |
fdb515e7 | 88 | %py3_build %{?with_tests:test} |
3b3eae2e MK |
89 | %endif |
90 | ||
91 | %if %{with doc} | |
92 | cd docs | |
93 | %{__make} -j1 html | |
94 | rm -rf _build/html/_sources | |
95 | %endif | |
96 | ||
97 | %install | |
98 | rm -rf $RPM_BUILD_ROOT | |
99 | ||
100 | %if %{with python2} | |
fdb515e7 | 101 | %py_install |
3b3eae2e MK |
102 | |
103 | %py_postclean | |
104 | %endif | |
105 | ||
106 | %if %{with python3} | |
fdb515e7 | 107 | %py3_install |
3b3eae2e MK |
108 | %endif |
109 | ||
110 | %clean | |
111 | rm -rf $RPM_BUILD_ROOT | |
112 | ||
113 | %if %{with python2} | |
114 | %files | |
115 | %defattr(644,root,root,755) | |
116 | %{py_sitescriptdir}/flask_debugtoolbar_lineprofilerpanel | |
117 | %if "%{py_ver}" > "2.4" | |
118 | %{py_sitescriptdir}/Flask_DebugToolbar_LineProfilerPanel-%{version}-py*.egg-info | |
119 | %endif | |
120 | %endif | |
121 | ||
122 | %if %{with python3} | |
123 | %files -n python3-%{module} | |
124 | %defattr(644,root,root,755) | |
125 | %{py3_sitescriptdir}/flask_debugtoolbar_lineprofilerpanel | |
126 | %{py3_sitescriptdir}/Flask_DebugToolbar_LineProfilerPanel-%{version}-py*.egg-info | |
127 | %endif | |
128 | ||
129 | %if %{with doc} | |
130 | %files apidocs | |
131 | %defattr(644,root,root,755) | |
132 | %doc docs/_build/html/* | |
133 | %endif |