]>
Commit | Line | Data |
---|---|---|
8a01110b | 1 | # |
21523b25 JK |
2 | # TODO: |
3 | # - tests fail on 'local' timezone | |
4 | # | |
8a01110b | 5 | # Conditional build: |
73c67f0f | 6 | %bcond_without doc # don't build doc |
21523b25 | 7 | %bcond_with tests # do not perform "make test" |
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} |
4db81d45 JK |
15 | Version: 2.1.1 |
16 | Release: 1 | |
9b3d2ae3 | 17 | License: BSD-like |
18 | Group: Development/Languages/Python | |
73c67f0f JB |
19 | #Source0Download: https://pypi.python.org/pypi/Babel |
20 | Source0: https://pypi.python.org/packages/source/B/Babel/Babel-%{version}.tar.gz | |
4db81d45 | 21 | # Source0-md5: cab63d158ceed3a809703711cfb8cbd5 |
006ed0f7 | 22 | Patch0: tz.patch |
fd18bd52 | 23 | URL: http://babel.pocoo.org/ |
4c63ce1f | 24 | %if %{with python2} |
9b3d2ae3 | 25 | BuildRequires: python-devel |
4fcdb98b | 26 | BuildRequires: python-devel-tools |
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} | |
33 | BuildRequires: python3-devel | |
4761453f | 34 | BuildRequires: python3-devel-tools |
fd18bd52 | 35 | BuildRequires: python3-setuptools |
4c63ce1f | 36 | BuildRequires: python3-modules |
4761453f | 37 | BuildRequires: python3-pytz |
4c63ce1f | 38 | %endif |
8340e96b | 39 | %{?with_doc:BuildRequires: sphinx-pdg} |
8b5a0641 | 40 | Requires: python-modules |
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 MK |
59 | Group: Libraries/Python |
60 | Requires: python3-modules | |
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 | |
100 | rm -rf _build/html/_sources | |
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 | |
73c67f0f JB |
118 | find $RPM_BUILD_ROOT%{py_sitescriptdir}/babel/localedata -name '*.dat' | \ |
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 | ||
122 | find $RPM_BUILD_ROOT%{py3_sitescriptdir}/babel/localedata -name '*.dat' | \ | |
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) |
4c63ce1f | 132 | %doc AUTHORS CHANGES LICENSE README |
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] | |
bc10f8db | 139 | %dir %{py_sitescriptdir}/babel/localedata |
73c67f0f | 140 | %{py_sitescriptdir}/babel/localedata/root.dat |
bc10f8db ER |
141 | %dir %{py_sitescriptdir}/babel/messages |
142 | %{py_sitescriptdir}/babel/messages/*.py[co] | |
8a01110b | 143 | |
4c63ce1f MK |
144 | %if "%{py_ver}" > "2.4" |
145 | %{py_sitescriptdir}/Babel-%{version}-py*.egg-info | |
146 | %endif | |
147 | %endif | |
148 | ||
149 | %if %{with python3} | |
73c67f0f | 150 | %files -n python3-%{module} -f py3.lang |
4c63ce1f MK |
151 | %defattr(644,root,root,755) |
152 | %doc AUTHORS CHANGES LICENSE README | |
73c67f0f JB |
153 | %attr(755,root,root) %{_bindir}/pybabel3 |
154 | %dir %{py3_sitescriptdir}/babel | |
155 | %{py3_sitescriptdir}/babel/__pycache__ | |
156 | %{py3_sitescriptdir}/babel/global.dat | |
157 | %{py3_sitescriptdir}/babel/*.py | |
158 | %{py3_sitescriptdir}/babel/localtime | |
159 | %dir %{py3_sitescriptdir}/babel/localedata | |
160 | %{py3_sitescriptdir}/babel/localedata/root.dat | |
161 | %{py3_sitescriptdir}/babel/messages | |
4c63ce1f MK |
162 | %{py3_sitescriptdir}/Babel-%{version}-py*.egg-info |
163 | %endif | |
164 | ||
165 | %if %{with doc} | |
8a01110b ER |
166 | %files apidocs |
167 | %defattr(644,root,root,755) | |
4c63ce1f | 168 | %doc docs/_build/html/* |
8a01110b | 169 | %endif |