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