]>
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 | |
e8fc5292 | 16 | Release: 2 |
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 | |
9b3d2ae3 | 21 | URL: http://babel.edgewall.org/ |
4c63ce1f | 22 | %if %{with python2} |
9b3d2ae3 | 23 | BuildRequires: python-devel |
4fcdb98b | 24 | BuildRequires: python-devel-tools |
9b3d2ae3 | 25 | BuildRequires: rpm-pythonprov |
9b3d2ae3 | 26 | BuildRequires: rpmbuild(macros) >= 1.219 |
4c63ce1f MK |
27 | %endif |
28 | %if %{with python3} | |
29 | BuildRequires: python3-devel | |
30 | BuildRequires: python3-distribute | |
31 | BuildRequires: python3-modules | |
32 | %endif | |
33 | ||
8b5a0641 | 34 | Requires: python-modules |
c33e1e26 | 35 | Obsoletes: python-Babel |
9b3d2ae3 | 36 | BuildArch: noarch |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
38 | ||
39 | %description | |
40 | Babel is a Python library that provides an integrated collection of | |
41 | utilities that assist with internationalizing and localizing Python | |
0060fa76 | 42 | applications (in particular web-based applications). |
9b3d2ae3 | 43 | |
4c63ce1f MK |
44 | # %description -l pl.UTF-8 |
45 | ||
46 | %package -n python3-%{module} | |
47 | Summary: - | |
48 | Summary(pl.UTF-8): - | |
49 | Group: Libraries/Python | |
50 | Requires: python3-modules | |
51 | ||
52 | %description -n python3-%{module} | |
53 | Babel is a Python library that provides an integrated collection of | |
54 | utilities that assist with internationalizing and localizing Python | |
55 | applications (in particular web-based applications). | |
56 | ||
57 | # %description -n python3-%{module} -l pl.UTF-8 | |
58 | ||
8a01110b ER |
59 | %package apidocs |
60 | Summary: Python Babel API documentation | |
61 | Group: Documentation | |
62 | ||
63 | %description apidocs | |
64 | Python Babel API documentation. | |
65 | ||
9b3d2ae3 | 66 | %prep |
c33e1e26 | 67 | %setup -q -n Babel-%{version} |
9b3d2ae3 | 68 | |
69 | %build | |
4c63ce1f MK |
70 | %if %{with python2} |
71 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} | |
72 | %endif | |
73 | ||
74 | %if %{with python3} | |
75 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
76 | %endif | |
77 | ||
78 | %if %{with doc} | |
79 | cd docs | |
80 | %{__make} -j1 html | |
81 | rm -rf _build/html/_sources | |
82 | %endif | |
9b3d2ae3 | 83 | |
84 | %install | |
85 | rm -rf $RPM_BUILD_ROOT | |
4c63ce1f MK |
86 | |
87 | %if %{with python2} | |
88 | %{__python} setup.py \ | |
89 | build --build-base build-2 \ | |
90 | install --skip-build \ | |
91 | --optimize=2 \ | |
92 | --root=$RPM_BUILD_ROOT | |
9b3d2ae3 | 93 | |
8a01110b | 94 | %py_postclean |
4c63ce1f MK |
95 | %endif |
96 | ||
97 | %if %{with python3} | |
98 | %{__python3} setup.py \ | |
99 | build --build-base build-3 \ | |
100 | install --skip-build \ | |
101 | --optimize=2 \ | |
102 | --root=$RPM_BUILD_ROOT | |
103 | %endif | |
8a01110b | 104 | |
9b3d2ae3 | 105 | %clean |
106 | rm -rf $RPM_BUILD_ROOT | |
107 | ||
4c63ce1f | 108 | %if %{with python2} |
9b3d2ae3 | 109 | %files |
110 | %defattr(644,root,root,755) | |
4c63ce1f | 111 | %doc AUTHORS CHANGES LICENSE README |
9b3d2ae3 | 112 | %attr(755,root,root) %{_bindir}/pybabel |
bc10f8db ER |
113 | %dir %{py_sitescriptdir}/babel |
114 | %{py_sitescriptdir}/babel/*.dat | |
115 | %{py_sitescriptdir}/babel/*.py[co] | |
4c63ce1f MK |
116 | %dir %{py_sitescriptdir}/babel/localtime |
117 | %{py_sitescriptdir}/babel/localtime/*.py[co] | |
118 | ||
bc10f8db ER |
119 | %dir %{py_sitescriptdir}/babel/localedata |
120 | # TODO: %lang tag | |
121 | %{py_sitescriptdir}/babel/localedata/*.dat | |
122 | %dir %{py_sitescriptdir}/babel/messages | |
123 | %{py_sitescriptdir}/babel/messages/*.py[co] | |
8a01110b | 124 | |
4c63ce1f MK |
125 | %if "%{py_ver}" > "2.4" |
126 | %{py_sitescriptdir}/Babel-%{version}-py*.egg-info | |
127 | %endif | |
128 | %endif | |
129 | ||
130 | %if %{with python3} | |
131 | %files -n python3-%{module} | |
132 | %defattr(644,root,root,755) | |
133 | %doc AUTHORS CHANGES LICENSE README | |
134 | %{py3_sitescriptdir}/%{module} | |
135 | %{py3_sitescriptdir}/Babel-%{version}-py*.egg-info | |
136 | %endif | |
137 | ||
138 | %if %{with doc} | |
8a01110b ER |
139 | %files apidocs |
140 | %defattr(644,root,root,755) | |
4c63ce1f | 141 | %doc docs/_build/html/* |
8a01110b | 142 | %endif |
4c63ce1f | 143 |