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