]>
Commit | Line | Data |
---|---|---|
b426a247 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 flask-debugtoolbar | |
9 | Summary: A port of the Django debug toolbar to Flask | |
10 | Summary(pl.UTF-8): Odpowiednik Djangowego debuggera dla Flask | |
11 | Name: python-%{module} | |
12 | Version: 0.9.0 | |
220a8c3a | 13 | Release: 2 |
b426a247 MK |
14 | License: BSD |
15 | Group: Libraries/Python | |
16 | Source0: https://pypi.python.org/packages/source/F/Flask-DebugToolbar/Flask-DebugToolbar-%{version}.tar.gz | |
17 | # Source0-md5: b471c8320d9a04ffea3abda020570563 | |
18 | URL: http://flask-debugtoolbar.rtfd.org/ | |
19 | BuildRequires: rpm-pythonprov | |
20 | # if py_postclean is used | |
21 | BuildRequires: rpmbuild(macros) >= 1.219 | |
22 | %if %{with python2} | |
23 | BuildRequires: python-blinker | |
24 | BuildRequires: python-distribute | |
25 | %endif | |
26 | %if %{with python3} | |
27 | BuildRequires: python3-blinker | |
28 | BuildRequires: python3-distribute | |
29 | BuildRequires: python3-modules | |
30 | %endif | |
31 | # Below Rs only work for main package (python2) | |
32 | #Requires: python-libs | |
33 | Requires: python-modules | |
220a8c3a | 34 | Requires: python-devel-tools |
b426a247 MK |
35 | BuildArch: noarch |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
37 | ||
38 | %description | |
39 | A port of the Django debug toolbar to Flask | |
40 | ||
41 | ## %description -l pl.UTF-8 | |
42 | ||
43 | %package -n python3-%{module} | |
44 | Summary: - | |
45 | Summary(pl.UTF-8): - | |
46 | Group: Libraries/Python | |
47 | Requires: python3-modules | |
220a8c3a | 48 | Requires: python3-devel-tools |
b426a247 MK |
49 | |
50 | %description -n python3-%{module} | |
51 | A port of the Django debug toolbar to Flask | |
52 | ||
53 | ## %description -n python3-%{module} -l pl.UTF-8 | |
54 | ||
55 | %package apidocs | |
56 | Summary: %{module} API documentation | |
57 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
58 | Group: Documentation | |
59 | ||
60 | %description apidocs | |
61 | API documentation for %{module}. | |
62 | ||
63 | %description apidocs -l pl.UTF-8 | |
64 | Dokumentacja API %{module}. | |
65 | ||
66 | %prep | |
67 | %setup -q -n Flask-DebugToolbar-%{version} | |
68 | ||
69 | %build | |
70 | %if %{with python2} | |
71 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} | |
72 | %endif | |
73 | ||
74 | %if %{with python3} | |
75 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
76 | %endif | |
77 | ||
78 | %if %{with doc} | |
79 | cd docs | |
80 | %{__make} -j1 html | |
81 | rm -rf _build/html/_sources | |
82 | %endif | |
83 | ||
84 | %install | |
85 | rm -rf $RPM_BUILD_ROOT | |
86 | ||
87 | %if %{with python2} | |
88 | %{__python} setup.py \ | |
89 | build --build-base build-2 \ | |
90 | install --skip-build \ | |
91 | --optimize=2 \ | |
92 | --root=$RPM_BUILD_ROOT | |
93 | ||
94 | %py_postclean | |
95 | %endif | |
96 | ||
97 | %if %{with python3} | |
98 | %{__python3} setup.py \ | |
99 | build --build-base build-3 \ | |
100 | install --skip-build \ | |
101 | --optimize=2 \ | |
102 | --root=$RPM_BUILD_ROOT | |
103 | %endif | |
104 | ||
105 | %clean | |
106 | rm -rf $RPM_BUILD_ROOT | |
107 | ||
108 | %if %{with python2} | |
109 | %files | |
110 | %defattr(644,root,root,755) | |
111 | %{py_sitescriptdir}/flask_debugtoolbar | |
112 | %if "%{py_ver}" > "2.4" | |
113 | %{py_sitescriptdir}/Flask_DebugToolbar-%{version}-py*.egg-info | |
114 | %endif | |
115 | %endif | |
116 | ||
117 | %if %{with python3} | |
118 | %files -n python3-%{module} | |
119 | %defattr(644,root,root,755) | |
120 | %{py3_sitescriptdir}/flask_debugtoolbar | |
121 | %{py3_sitescriptdir}/Flask_DebugToolbar-%{version}-py*.egg-info | |
122 | %endif | |
123 | ||
124 | %if %{with doc} | |
125 | %files apidocs | |
126 | %defattr(644,root,root,755) | |
127 | %doc docs/_build/html/* | |
128 | %endif |