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