]>
Commit | Line | Data |
---|---|---|
76ebd225 MK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with doc # don't build doc | |
4 | %bcond_with 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-babel | |
9 | Summary: Extension to Flask that adds i18n and l10n support to any Flask application with the help of babel, pytz and speaklater | |
10 | Summary(pl.UTF-8): Rozszerzenie Flask dodające wsparcie dla i18n i l10n przy użyciu babel, pytz i speklater. | |
11 | # Name must match the python module/package name (as in 'import' statement) | |
12 | Name: python-%{module} | |
13 | Version: 0.9 | |
df52346c | 14 | Release: 3 |
76ebd225 MK |
15 | License: BSD |
16 | Group: Libraries/Python | |
17 | # https://pypi.python.org/packages/source/F/Flask-Babel/Flask-Babel-0.9.tar.gz | |
18 | Source0: https://pypi.python.org/packages/source/F/Flask-Babel/Flask-Babel-%{version}.tar.gz | |
19 | # Source0-md5: 4762e0392303f464d53cbebedfb87ded | |
20 | URL: http://github.com/mitsuhiko/flask-babel | |
21 | BuildRequires: rpm-pythonprov | |
22 | BuildRequires: rpmbuild(macros) >= 1.219 | |
23 | %if %{with python2} | |
24 | BuildRequires: python-distribute | |
25 | BuildRequires: python-speaklater | |
26 | %endif | |
27 | %if %{with python3} | |
28 | BuildRequires: python3-distribute | |
29 | BuildRequires: python3-modules | |
30 | BuildRequires: python3-speaklater | |
31 | %endif | |
32 | Requires: python-jinja2 >= 2.5 | |
33 | Requires: python-modules | |
34 | Requires: python-speaklater | |
35 | BuildArch: noarch | |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
37 | ||
38 | %description | |
39 | Adds i18n/l10n support to Flask applications with the help of the | |
40 | Babel library. | |
41 | ||
42 | # %description -l pl.UTF-8 | |
43 | ||
44 | %package -n python3-%{module} | |
45 | Summary: - | |
46 | Summary(pl.UTF-8): - | |
47 | Group: Libraries/Python | |
48 | Requires: python3-jinja2 >= 2.5 | |
49 | Requires: python3-modules | |
50 | Requires: python3-speaklater | |
51 | ||
52 | %description -n python3-%{module} | |
53 | Adds i18n/l10n support to Flask applications with the help of the | |
54 | Babel library. | |
55 | ||
56 | # %description -n python3-%{module} -l pl.UTF-8 | |
57 | ||
58 | %package apidocs | |
59 | Summary: %{module} API documentation | |
60 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
61 | Group: Documentation | |
62 | ||
63 | %description apidocs | |
64 | API documentation for %{module}. | |
65 | ||
66 | %description apidocs -l pl.UTF-8 | |
67 | Dokumentacja API %{module}. | |
68 | ||
69 | %prep | |
70 | %setup -q -n Flask-Babel-%{version} | |
71 | ||
72 | %build | |
73 | %if %{with python2} | |
74 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} | |
75 | %endif | |
76 | ||
77 | %if %{with python3} | |
78 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
79 | %endif | |
80 | ||
81 | %if %{with doc} | |
82 | cd docs | |
83 | %{__make} -j1 html | |
84 | rm -rf _build/html/_sources | |
85 | %endif | |
86 | ||
87 | %install | |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
90 | %if %{with python2} | |
91 | %{__python} setup.py \ | |
92 | build --build-base build-2 \ | |
93 | install --skip-build \ | |
94 | --optimize=2 \ | |
95 | --root=$RPM_BUILD_ROOT | |
96 | ||
97 | %py_postclean | |
98 | %endif | |
99 | ||
100 | %if %{with python3} | |
101 | %{__python3} setup.py \ | |
102 | build --build-base build-3 \ | |
103 | install --skip-build \ | |
104 | --optimize=2 \ | |
105 | --root=$RPM_BUILD_ROOT | |
106 | %endif | |
107 | ||
108 | %clean | |
109 | rm -rf $RPM_BUILD_ROOT | |
110 | ||
111 | %if %{with python2} | |
112 | %files | |
113 | %defattr(644,root,root,755) | |
114 | %doc LICENSE README | |
115 | %{py_sitescriptdir}/flask_babel | |
116 | %if "%{py_ver}" > "2.4" | |
117 | %{py_sitescriptdir}/Flask_Babel-%{version}-py*.egg-info | |
118 | %endif | |
119 | %endif | |
120 | ||
121 | %if %{with python3} | |
122 | %files -n python3-%{module} | |
123 | %defattr(644,root,root,755) | |
124 | %doc LICENSE README | |
125 | %{py3_sitescriptdir}/flask_babel | |
126 | %{py3_sitescriptdir}/Flask_Babel-%{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 |