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