]>
Commit | Line | Data |
---|---|---|
8a01110b ER |
1 | # |
2 | # Conditional build: | |
8f729458 | 3 | %bcond_without doc # Sphinx documentation |
b623e023 | 4 | %bcond_without tests # unit tests |
73c67f0f JB |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
4c63ce1f | 7 | |
b2f828a2 ER |
8 | %define module babel |
9 | %define pypi_name Babel | |
73c67f0f JB |
10 | Summary: Babel - internationalization library for Python 2 |
11 | Summary(pl.UTF-8): Babel - biblioteka umiędzynaradawiająca dla Pythona 2 | |
4c63ce1f | 12 | Name: python-%{module} |
1b33e715 | 13 | Version: 2.6.0 |
1155dfd4 | 14 | Release: 2 |
9b3d2ae3 | 15 | License: BSD-like |
16 | Group: Development/Languages/Python | |
b623e023 JB |
17 | #Source0Download: https://pypi.org/simple/Babel/ |
18 | Source0: https://files.pythonhosted.org/packages/source/B/Babel/%{pypi_name}-%{version}.tar.gz | |
1b33e715 | 19 | # Source0-md5: c384ac03026e8fe6f9b90f55201f1bff |
fd18bd52 | 20 | URL: http://babel.pocoo.org/ |
b623e023 JB |
21 | BuildRequires: rpm-pythonprov |
22 | BuildRequires: rpmbuild(macros) >= 1.714 | |
4c63ce1f | 23 | %if %{with python2} |
1b33e715 JB |
24 | BuildRequires: python-devel >= 1:2.7 |
25 | BuildRequires: python-devel-tools >= 1:2.7 | |
26 | BuildRequires: python-modules >= 1:2.7 | |
4761453f | 27 | BuildRequires: python-setuptools |
b623e023 JB |
28 | BuildRequires: python-pytz >= 0a |
29 | %if %{with tests} | |
325e9c87 | 30 | BuildRequires: python-freezegun |
b623e023 | 31 | BuildRequires: python-pytest |
1b33e715 | 32 | BuildRequires: python-pytest-cov |
b623e023 | 33 | %endif |
4c63ce1f MK |
34 | %endif |
35 | %if %{with python3} | |
1b33e715 JB |
36 | BuildRequires: python3-devel >= 1:3.4 |
37 | BuildRequires: python3-devel-tools >= 1:3.4 | |
38 | BuildRequires: python3-modules >= 1:3.4 | |
b623e023 JB |
39 | BuildRequires: python3-setuptools |
40 | BuildRequires: python3-pytz >= 0a | |
41 | %if %{with tests} | |
325e9c87 | 42 | BuildRequires: python3-freezegun |
b623e023 | 43 | BuildRequires: python3-pytest |
1b33e715 | 44 | BuildRequires: python3-pytest-cov |
b623e023 | 45 | %endif |
4c63ce1f | 46 | %endif |
8340e96b | 47 | %{?with_doc:BuildRequires: sphinx-pdg} |
1b33e715 | 48 | Requires: python-modules >= 1:2.7 |
b623e023 | 49 | Requires: python-pytz >= 0a |
c33e1e26 | 50 | Obsoletes: python-Babel |
9b3d2ae3 | 51 | BuildArch: noarch |
52 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
53 | ||
54 | %description | |
55 | Babel is a Python library that provides an integrated collection of | |
56 | utilities that assist with internationalizing and localizing Python | |
0060fa76 | 57 | applications (in particular web-based applications). |
9b3d2ae3 | 58 | |
73c67f0f JB |
59 | %description -l pl.UTF-8 |
60 | Babel to biblioteka Pythona zawierająca zintegrowany zbiór narzędzi | |
61 | pomagających przy umiędzynaradawianiu i lokalizowaniu aplikacji w | |
62 | Pythonie (w szczególności aplikacji WWW). | |
4c63ce1f MK |
63 | |
64 | %package -n python3-%{module} | |
73c67f0f JB |
65 | Summary: Babel - internationalization library for Python 3 |
66 | Summary(pl.UTF-8): Babel - biblioteka umiędzynaradawiająca dla Pythona 3 | |
4c63ce1f | 67 | Group: Libraries/Python |
1b33e715 | 68 | Requires: python3-modules >= 1:3.4 |
b623e023 | 69 | Requires: python3-pytz >= 0a |
4c63ce1f MK |
70 | |
71 | %description -n python3-%{module} | |
72 | Babel is a Python library that provides an integrated collection of | |
73 | utilities that assist with internationalizing and localizing Python | |
74 | applications (in particular web-based applications). | |
75 | ||
73c67f0f JB |
76 | %description -n python3-%{module} -l pl.UTF-8 |
77 | Babel to biblioteka Pythona zawierająca zintegrowany zbiór narzędzi | |
78 | pomagających przy umiędzynaradawianiu i lokalizowaniu aplikacji w | |
79 | Pythonie (w szczególności aplikacji WWW). | |
4c63ce1f | 80 | |
8a01110b ER |
81 | %package apidocs |
82 | Summary: Python Babel API documentation | |
73c67f0f | 83 | Summary(pl.UTF-8): Dokumentacja API biblioteki Pythona Babel |
8a01110b ER |
84 | Group: Documentation |
85 | ||
86 | %description apidocs | |
87 | Python Babel API documentation. | |
88 | ||
73c67f0f JB |
89 | %description apidocs -l pl.UTF-8 |
90 | Dokumentacja API biblioteki Pythona Babel. | |
91 | ||
9b3d2ae3 | 92 | %prep |
c33e1e26 | 93 | %setup -q -n Babel-%{version} |
9b3d2ae3 | 94 | |
95 | %build | |
4c63ce1f | 96 | %if %{with python2} |
b623e023 JB |
97 | %py_build |
98 | ||
99 | %if %{with tests} | |
100 | py.test-2 tests | |
101 | %endif | |
4c63ce1f MK |
102 | %endif |
103 | ||
104 | %if %{with python3} | |
b623e023 JB |
105 | %py3_build |
106 | ||
107 | %if %{with tests} | |
108 | py.test-3 tests | |
109 | %endif | |
4c63ce1f MK |
110 | %endif |
111 | ||
112 | %if %{with doc} | |
b623e023 | 113 | %{__make} -C docs -j1 html |
4c63ce1f | 114 | %endif |
9b3d2ae3 | 115 | |
116 | %install | |
117 | rm -rf $RPM_BUILD_ROOT | |
4c63ce1f | 118 | |
73c67f0f | 119 | %if %{with python3} |
e8952ced | 120 | %py3_install |
9b3d2ae3 | 121 | |
73c67f0f | 122 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/{pybabel,pybabel3} |
4c63ce1f MK |
123 | %endif |
124 | ||
73c67f0f | 125 | %if %{with python2} |
e8952ced | 126 | %py_install |
73c67f0f JB |
127 | |
128 | %py_postclean | |
4c63ce1f | 129 | %endif |
8a01110b | 130 | |
8f729458 | 131 | find $RPM_BUILD_ROOT%{py_sitescriptdir}/babel/locale-data -name '*.dat' | \ |
73c67f0f JB |
132 | sed -e "s#^$RPM_BUILD_ROOT##" | \ |
133 | sed -ne 's,.*/\([a-z][a-z][a-z]\?\)\(_[0-9][0-9][0-9]\|_[A-Z][a-z][a-z][a-z]\)\?\(_[A-Z][A-Z]\)\?\(_POSIX\)\?\.dat$,%lang(\1\3) &,p' > py2.lang | |
134 | ||
8f729458 | 135 | find $RPM_BUILD_ROOT%{py3_sitescriptdir}/babel/locale-data -name '*.dat' | \ |
73c67f0f JB |
136 | sed -e "s#^$RPM_BUILD_ROOT##" | \ |
137 | sed -ne 's,.*/\([a-z][a-z][a-z]\?\)\(_[0-9][0-9][0-9]\|_[A-Z][a-z][a-z][a-z]\)\?\(_[A-Z][A-Z]\)\?\(_POSIX\)\?\.dat,%lang(\1\3) &,p' > py3.lang | |
138 | ||
9b3d2ae3 | 139 | %clean |
140 | rm -rf $RPM_BUILD_ROOT | |
141 | ||
4c63ce1f | 142 | %if %{with python2} |
73c67f0f | 143 | %files -f py2.lang |
9b3d2ae3 | 144 | %defattr(644,root,root,755) |
8f729458 | 145 | %doc AUTHORS CHANGES LICENSE |
9b3d2ae3 | 146 | %attr(755,root,root) %{_bindir}/pybabel |
bc10f8db | 147 | %dir %{py_sitescriptdir}/babel |
73c67f0f | 148 | %{py_sitescriptdir}/babel/global.dat |
bc10f8db | 149 | %{py_sitescriptdir}/babel/*.py[co] |
4c63ce1f MK |
150 | %dir %{py_sitescriptdir}/babel/localtime |
151 | %{py_sitescriptdir}/babel/localtime/*.py[co] | |
8f729458 JB |
152 | %dir %{py_sitescriptdir}/babel/locale-data |
153 | %{py_sitescriptdir}/babel/locale-data/root.dat | |
154 | %lang(ca_ES@valencia) %{py_sitescriptdir}/babel/locale-data/ca_ES_VALENCIA.dat | |
bc10f8db ER |
155 | %dir %{py_sitescriptdir}/babel/messages |
156 | %{py_sitescriptdir}/babel/messages/*.py[co] | |
4c63ce1f MK |
157 | %{py_sitescriptdir}/Babel-%{version}-py*.egg-info |
158 | %endif | |
4c63ce1f MK |
159 | |
160 | %if %{with python3} | |
73c67f0f | 161 | %files -n python3-%{module} -f py3.lang |
4c63ce1f | 162 | %defattr(644,root,root,755) |
8f729458 | 163 | %doc AUTHORS CHANGES LICENSE |
73c67f0f JB |
164 | %attr(755,root,root) %{_bindir}/pybabel3 |
165 | %dir %{py3_sitescriptdir}/babel | |
166 | %{py3_sitescriptdir}/babel/__pycache__ | |
167 | %{py3_sitescriptdir}/babel/global.dat | |
168 | %{py3_sitescriptdir}/babel/*.py | |
169 | %{py3_sitescriptdir}/babel/localtime | |
8f729458 JB |
170 | %dir %{py3_sitescriptdir}/babel/locale-data |
171 | %{py3_sitescriptdir}/babel/locale-data/root.dat | |
172 | %lang(ca_ES@valencia) %{py3_sitescriptdir}/babel/locale-data/ca_ES_VALENCIA.dat | |
73c67f0f | 173 | %{py3_sitescriptdir}/babel/messages |
4c63ce1f MK |
174 | %{py3_sitescriptdir}/Babel-%{version}-py*.egg-info |
175 | %endif | |
176 | ||
177 | %if %{with doc} | |
8a01110b ER |
178 | %files apidocs |
179 | %defattr(644,root,root,755) | |
1b33e715 | 180 | %doc docs/_build/html/{_static,api,*.html,*.js} |
8a01110b | 181 | %endif |