]>
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 | |
9aec2f71 | 8 | %define module babel |
b2f828a2 | 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} |
af9886cf | 13 | # keep 2.9.x here for python2 support |
8a78de7e | 14 | Version: 2.9.1 |
bd75c884 | 15 | Release: 4 |
9b3d2ae3 | 16 | License: BSD-like |
17 | Group: Development/Languages/Python | |
903c51b1 | 18 | #Source0Download: https://pypi.org/simple/babel/ |
b623e023 | 19 | Source0: https://files.pythonhosted.org/packages/source/B/Babel/%{pypi_name}-%{version}.tar.gz |
8a78de7e | 20 | # Source0-md5: 7166099733d78aa857d74fa50d8ff58c |
fd18bd52 | 21 | URL: http://babel.pocoo.org/ |
b623e023 JB |
22 | BuildRequires: rpm-pythonprov |
23 | BuildRequires: rpmbuild(macros) >= 1.714 | |
4c63ce1f | 24 | %if %{with python2} |
1b33e715 JB |
25 | BuildRequires: python-devel >= 1:2.7 |
26 | BuildRequires: python-devel-tools >= 1:2.7 | |
27 | BuildRequires: python-modules >= 1:2.7 | |
4761453f | 28 | BuildRequires: python-setuptools |
903c51b1 | 29 | BuildRequires: python-pytz >= 2015.7 |
b623e023 | 30 | %if %{with tests} |
325e9c87 | 31 | BuildRequires: python-freezegun |
b623e023 | 32 | BuildRequires: python-pytest |
1b33e715 | 33 | BuildRequires: python-pytest-cov |
b623e023 | 34 | %endif |
4c63ce1f MK |
35 | %endif |
36 | %if %{with python3} | |
1b33e715 JB |
37 | BuildRequires: python3-devel >= 1:3.4 |
38 | BuildRequires: python3-devel-tools >= 1:3.4 | |
39 | BuildRequires: python3-modules >= 1:3.4 | |
b623e023 | 40 | BuildRequires: python3-setuptools |
903c51b1 | 41 | BuildRequires: python3-pytz >= 2015.7 |
b623e023 | 42 | %if %{with tests} |
325e9c87 | 43 | BuildRequires: python3-freezegun |
b623e023 | 44 | BuildRequires: python3-pytest |
1b33e715 | 45 | BuildRequires: python3-pytest-cov |
b623e023 | 46 | %endif |
4c63ce1f | 47 | %endif |
cc19c97e | 48 | %{?with_doc:BuildRequires: sphinx-pdg} |
1b33e715 | 49 | Requires: python-modules >= 1:2.7 |
14b5b172 | 50 | Obsoletes: python-Babel < 0.9.5-2 |
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 |
4c63ce1f MK |
69 | |
70 | %description -n python3-%{module} | |
71 | Babel is a Python library that provides an integrated collection of | |
72 | utilities that assist with internationalizing and localizing Python | |
73 | applications (in particular web-based applications). | |
74 | ||
73c67f0f JB |
75 | %description -n python3-%{module} -l pl.UTF-8 |
76 | Babel to biblioteka Pythona zawierająca zintegrowany zbiór narzędzi | |
77 | pomagających przy umiędzynaradawianiu i lokalizowaniu aplikacji w | |
78 | Pythonie (w szczególności aplikacji WWW). | |
4c63ce1f | 79 | |
8a01110b ER |
80 | %package apidocs |
81 | Summary: Python Babel API documentation | |
73c67f0f | 82 | Summary(pl.UTF-8): Dokumentacja API biblioteki Pythona Babel |
8a01110b ER |
83 | Group: Documentation |
84 | ||
85 | %description apidocs | |
86 | Python Babel API documentation. | |
87 | ||
73c67f0f JB |
88 | %description apidocs -l pl.UTF-8 |
89 | Dokumentacja API biblioteki Pythona Babel. | |
90 | ||
9b3d2ae3 | 91 | %prep |
c33e1e26 | 92 | %setup -q -n Babel-%{version} |
9b3d2ae3 | 93 | |
94 | %build | |
4c63ce1f | 95 | %if %{with python2} |
b623e023 JB |
96 | %py_build |
97 | ||
98 | %if %{with tests} | |
14b5b172 | 99 | # few frontend tests have some (DST-related?) issues with local timezones |
af9886cf | 100 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
14b5b172 | 101 | TZ=UTC \ |
cc19c97e | 102 | %{__python} -m pytest tests |
b623e023 | 103 | %endif |
4c63ce1f MK |
104 | %endif |
105 | ||
106 | %if %{with python3} | |
b623e023 JB |
107 | %py3_build |
108 | ||
109 | %if %{with tests} | |
af9886cf | 110 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
14b5b172 | 111 | TZ=UTC \ |
cc19c97e | 112 | %{__python3} -m pytest tests |
b623e023 | 113 | %endif |
4c63ce1f MK |
114 | %endif |
115 | ||
116 | %if %{with doc} | |
b623e023 | 117 | %{__make} -C docs -j1 html |
4c63ce1f | 118 | %endif |
9b3d2ae3 | 119 | |
120 | %install | |
121 | rm -rf $RPM_BUILD_ROOT | |
4c63ce1f | 122 | |
73c67f0f | 123 | %if %{with python3} |
e8952ced | 124 | %py3_install |
9b3d2ae3 | 125 | |
73c67f0f | 126 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/{pybabel,pybabel3} |
4c63ce1f MK |
127 | %endif |
128 | ||
73c67f0f | 129 | %if %{with python2} |
e8952ced | 130 | %py_install |
73c67f0f JB |
131 | |
132 | %py_postclean | |
4c63ce1f | 133 | %endif |
8a01110b | 134 | |
8f729458 | 135 | find $RPM_BUILD_ROOT%{py_sitescriptdir}/babel/locale-data -name '*.dat' | \ |
73c67f0f | 136 | sed -e "s#^$RPM_BUILD_ROOT##" | \ |
fd7d64cc | 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$,&,p' > py2.lang |
73c67f0f | 138 | |
8f729458 | 139 | find $RPM_BUILD_ROOT%{py3_sitescriptdir}/babel/locale-data -name '*.dat' | \ |
73c67f0f | 140 | sed -e "s#^$RPM_BUILD_ROOT##" | \ |
fd7d64cc | 141 | 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,&,p' > py3.lang |
73c67f0f | 142 | |
9b3d2ae3 | 143 | %clean |
144 | rm -rf $RPM_BUILD_ROOT | |
145 | ||
4c63ce1f | 146 | %if %{with python2} |
73c67f0f | 147 | %files -f py2.lang |
9b3d2ae3 | 148 | %defattr(644,root,root,755) |
8f729458 | 149 | %doc AUTHORS CHANGES LICENSE |
9b3d2ae3 | 150 | %attr(755,root,root) %{_bindir}/pybabel |
bc10f8db | 151 | %dir %{py_sitescriptdir}/babel |
73c67f0f | 152 | %{py_sitescriptdir}/babel/global.dat |
bc10f8db | 153 | %{py_sitescriptdir}/babel/*.py[co] |
4c63ce1f MK |
154 | %dir %{py_sitescriptdir}/babel/localtime |
155 | %{py_sitescriptdir}/babel/localtime/*.py[co] | |
8f729458 JB |
156 | %dir %{py_sitescriptdir}/babel/locale-data |
157 | %{py_sitescriptdir}/babel/locale-data/root.dat | |
158 | %lang(ca_ES@valencia) %{py_sitescriptdir}/babel/locale-data/ca_ES_VALENCIA.dat | |
bc10f8db ER |
159 | %dir %{py_sitescriptdir}/babel/messages |
160 | %{py_sitescriptdir}/babel/messages/*.py[co] | |
4c63ce1f MK |
161 | %{py_sitescriptdir}/Babel-%{version}-py*.egg-info |
162 | %endif | |
4c63ce1f MK |
163 | |
164 | %if %{with python3} | |
73c67f0f | 165 | %files -n python3-%{module} -f py3.lang |
4c63ce1f | 166 | %defattr(644,root,root,755) |
8f729458 | 167 | %doc AUTHORS CHANGES LICENSE |
73c67f0f JB |
168 | %attr(755,root,root) %{_bindir}/pybabel3 |
169 | %dir %{py3_sitescriptdir}/babel | |
170 | %{py3_sitescriptdir}/babel/__pycache__ | |
171 | %{py3_sitescriptdir}/babel/global.dat | |
172 | %{py3_sitescriptdir}/babel/*.py | |
173 | %{py3_sitescriptdir}/babel/localtime | |
8f729458 JB |
174 | %dir %{py3_sitescriptdir}/babel/locale-data |
175 | %{py3_sitescriptdir}/babel/locale-data/root.dat | |
176 | %lang(ca_ES@valencia) %{py3_sitescriptdir}/babel/locale-data/ca_ES_VALENCIA.dat | |
73c67f0f | 177 | %{py3_sitescriptdir}/babel/messages |
4c63ce1f MK |
178 | %{py3_sitescriptdir}/Babel-%{version}-py*.egg-info |
179 | %endif | |
180 | ||
181 | %if %{with doc} | |
8a01110b ER |
182 | %files apidocs |
183 | %defattr(644,root,root,755) | |
1b33e715 | 184 | %doc docs/_build/html/{_static,api,*.html,*.js} |
8a01110b | 185 | %endif |