]>
Commit | Line | Data |
---|---|---|
8a01110b ER |
1 | # TODO |
2 | # - lang tag /usr/share/python*/site-packages/babel/localedata/* | |
3 | # | |
4 | # Conditional build: | |
4c63ce1f MK |
5 | %bcond_without doc # don't build doc |
6 | %bcond_without tests # do not perform "make test" | |
7 | %bcond_without python2 # CPython 2.x module | |
8 | %bcond_without python3 # CPython 3.x module | |
8a01110b | 9 | |
4c63ce1f MK |
10 | |
11 | %define module babel | |
9b3d2ae3 | 12 | Summary: Babel Python library |
13 | Summary(pl.UTF-8): Biblioteka Babel do Pythona | |
4c63ce1f MK |
14 | Name: python-%{module} |
15 | Version: 1.3 | |
fd18bd52 | 16 | Release: 3 |
9b3d2ae3 | 17 | License: BSD-like |
18 | Group: Development/Languages/Python | |
4c63ce1f MK |
19 | Source0: http://pypi.python.org/packages/source/B/Babel/Babel-%{version}.tar.gz |
20 | # Source0-md5: 5264ceb02717843cbc9ffce8e6e06bdb | |
fd18bd52 | 21 | URL: http://babel.pocoo.org/ |
4c63ce1f | 22 | %if %{with python2} |
9b3d2ae3 | 23 | BuildRequires: python-devel |
4fcdb98b | 24 | BuildRequires: python-devel-tools |
4761453f JK |
25 | BuildRequires: python-setuptools |
26 | BuildRequires: python-pytz | |
9b3d2ae3 | 27 | BuildRequires: rpm-pythonprov |
9b3d2ae3 | 28 | BuildRequires: rpmbuild(macros) >= 1.219 |
4c63ce1f MK |
29 | %endif |
30 | %if %{with python3} | |
31 | BuildRequires: python3-devel | |
4761453f | 32 | BuildRequires: python3-devel-tools |
fd18bd52 | 33 | BuildRequires: python3-setuptools |
4c63ce1f | 34 | BuildRequires: python3-modules |
4761453f | 35 | BuildRequires: python3-pytz |
4c63ce1f | 36 | %endif |
8b5a0641 | 37 | Requires: python-modules |
4761453f | 38 | Requires: python-pytz |
c33e1e26 | 39 | Obsoletes: python-Babel |
9b3d2ae3 | 40 | BuildArch: noarch |
41 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
42 | ||
43 | %description | |
44 | Babel is a Python library that provides an integrated collection of | |
45 | utilities that assist with internationalizing and localizing Python | |
0060fa76 | 46 | applications (in particular web-based applications). |
9b3d2ae3 | 47 | |
4c63ce1f MK |
48 | # %description -l pl.UTF-8 |
49 | ||
50 | %package -n python3-%{module} | |
fd18bd52 JK |
51 | Summary: Babel Python library |
52 | Summary(pl.UTF-8): Biblioteka Babel do Pythona | |
4c63ce1f MK |
53 | Group: Libraries/Python |
54 | Requires: python3-modules | |
4761453f | 55 | Requires: python3-pytz |
4c63ce1f MK |
56 | |
57 | %description -n python3-%{module} | |
58 | Babel is a Python library that provides an integrated collection of | |
59 | utilities that assist with internationalizing and localizing Python | |
60 | applications (in particular web-based applications). | |
61 | ||
62 | # %description -n python3-%{module} -l pl.UTF-8 | |
63 | ||
8a01110b ER |
64 | %package apidocs |
65 | Summary: Python Babel API documentation | |
66 | Group: Documentation | |
67 | ||
68 | %description apidocs | |
69 | Python Babel API documentation. | |
70 | ||
9b3d2ae3 | 71 | %prep |
c33e1e26 | 72 | %setup -q -n Babel-%{version} |
9b3d2ae3 | 73 | |
74 | %build | |
4c63ce1f MK |
75 | %if %{with python2} |
76 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} | |
77 | %endif | |
78 | ||
79 | %if %{with python3} | |
80 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
81 | %endif | |
82 | ||
83 | %if %{with doc} | |
84 | cd docs | |
85 | %{__make} -j1 html | |
86 | rm -rf _build/html/_sources | |
87 | %endif | |
9b3d2ae3 | 88 | |
89 | %install | |
90 | rm -rf $RPM_BUILD_ROOT | |
4c63ce1f MK |
91 | |
92 | %if %{with python2} | |
93 | %{__python} setup.py \ | |
94 | build --build-base build-2 \ | |
95 | install --skip-build \ | |
96 | --optimize=2 \ | |
97 | --root=$RPM_BUILD_ROOT | |
9b3d2ae3 | 98 | |
8a01110b | 99 | %py_postclean |
4c63ce1f MK |
100 | %endif |
101 | ||
102 | %if %{with python3} | |
103 | %{__python3} setup.py \ | |
104 | build --build-base build-3 \ | |
105 | install --skip-build \ | |
106 | --optimize=2 \ | |
107 | --root=$RPM_BUILD_ROOT | |
108 | %endif | |
8a01110b | 109 | |
9b3d2ae3 | 110 | %clean |
111 | rm -rf $RPM_BUILD_ROOT | |
112 | ||
4c63ce1f | 113 | %if %{with python2} |
9b3d2ae3 | 114 | %files |
115 | %defattr(644,root,root,755) | |
4c63ce1f | 116 | %doc AUTHORS CHANGES LICENSE README |
9b3d2ae3 | 117 | %attr(755,root,root) %{_bindir}/pybabel |
bc10f8db ER |
118 | %dir %{py_sitescriptdir}/babel |
119 | %{py_sitescriptdir}/babel/*.dat | |
120 | %{py_sitescriptdir}/babel/*.py[co] | |
4c63ce1f MK |
121 | %dir %{py_sitescriptdir}/babel/localtime |
122 | %{py_sitescriptdir}/babel/localtime/*.py[co] | |
123 | ||
bc10f8db ER |
124 | %dir %{py_sitescriptdir}/babel/localedata |
125 | # TODO: %lang tag | |
126 | %{py_sitescriptdir}/babel/localedata/*.dat | |
127 | %dir %{py_sitescriptdir}/babel/messages | |
128 | %{py_sitescriptdir}/babel/messages/*.py[co] | |
8a01110b | 129 | |
4c63ce1f MK |
130 | %if "%{py_ver}" > "2.4" |
131 | %{py_sitescriptdir}/Babel-%{version}-py*.egg-info | |
132 | %endif | |
133 | %endif | |
134 | ||
135 | %if %{with python3} | |
136 | %files -n python3-%{module} | |
137 | %defattr(644,root,root,755) | |
138 | %doc AUTHORS CHANGES LICENSE README | |
139 | %{py3_sitescriptdir}/%{module} | |
140 | %{py3_sitescriptdir}/Babel-%{version}-py*.egg-info | |
141 | %endif | |
142 | ||
143 | %if %{with doc} | |
8a01110b ER |
144 | %files apidocs |
145 | %defattr(644,root,root,755) | |
4c63ce1f | 146 | %doc docs/_build/html/* |
8a01110b | 147 | %endif |
4c63ce1f | 148 |