]> git.pld-linux.org Git - packages/python-babel.git/blame - python-babel.spec
- release 2 (by relup.sh)
[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}
cc19c97e 13Version: 2.8.0
eed5b758 14Release: 2
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
cc19c97e 19# Source0-md5: 6fad9772e75421969ddb41975483abdf
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
c33e1e26 49Obsoletes: python-Babel
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}
cc19c97e 98%{__python} -m pytest tests
b623e023 99%endif
4c63ce1f
MK
100%endif
101
102%if %{with python3}
b623e023
JB
103%py3_build
104
105%if %{with tests}
cc19c97e 106%{__python3} -m pytest tests
b623e023 107%endif
4c63ce1f
MK
108%endif
109
110%if %{with doc}
b623e023 111%{__make} -C docs -j1 html
4c63ce1f 112%endif
9b3d2ae3 113
114%install
115rm -rf $RPM_BUILD_ROOT
4c63ce1f 116
73c67f0f 117%if %{with python3}
e8952ced 118%py3_install
9b3d2ae3 119
73c67f0f 120%{__mv} $RPM_BUILD_ROOT%{_bindir}/{pybabel,pybabel3}
4c63ce1f
MK
121%endif
122
73c67f0f 123%if %{with python2}
e8952ced 124%py_install
73c67f0f
JB
125
126%py_postclean
4c63ce1f 127%endif
8a01110b 128
8f729458 129find $RPM_BUILD_ROOT%{py_sitescriptdir}/babel/locale-data -name '*.dat' | \
73c67f0f
JB
130 sed -e "s#^$RPM_BUILD_ROOT##" | \
131 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
132
8f729458 133find $RPM_BUILD_ROOT%{py3_sitescriptdir}/babel/locale-data -name '*.dat' | \
73c67f0f
JB
134 sed -e "s#^$RPM_BUILD_ROOT##" | \
135 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
136
9b3d2ae3 137%clean
138rm -rf $RPM_BUILD_ROOT
139
4c63ce1f 140%if %{with python2}
73c67f0f 141%files -f py2.lang
9b3d2ae3 142%defattr(644,root,root,755)
8f729458 143%doc AUTHORS CHANGES LICENSE
9b3d2ae3 144%attr(755,root,root) %{_bindir}/pybabel
bc10f8db 145%dir %{py_sitescriptdir}/babel
73c67f0f 146%{py_sitescriptdir}/babel/global.dat
bc10f8db 147%{py_sitescriptdir}/babel/*.py[co]
4c63ce1f
MK
148%dir %{py_sitescriptdir}/babel/localtime
149%{py_sitescriptdir}/babel/localtime/*.py[co]
8f729458
JB
150%dir %{py_sitescriptdir}/babel/locale-data
151%{py_sitescriptdir}/babel/locale-data/root.dat
152%lang(ca_ES@valencia) %{py_sitescriptdir}/babel/locale-data/ca_ES_VALENCIA.dat
bc10f8db
ER
153%dir %{py_sitescriptdir}/babel/messages
154%{py_sitescriptdir}/babel/messages/*.py[co]
4c63ce1f
MK
155%{py_sitescriptdir}/Babel-%{version}-py*.egg-info
156%endif
4c63ce1f
MK
157
158%if %{with python3}
73c67f0f 159%files -n python3-%{module} -f py3.lang
4c63ce1f 160%defattr(644,root,root,755)
8f729458 161%doc AUTHORS CHANGES LICENSE
73c67f0f
JB
162%attr(755,root,root) %{_bindir}/pybabel3
163%dir %{py3_sitescriptdir}/babel
164%{py3_sitescriptdir}/babel/__pycache__
165%{py3_sitescriptdir}/babel/global.dat
166%{py3_sitescriptdir}/babel/*.py
167%{py3_sitescriptdir}/babel/localtime
8f729458
JB
168%dir %{py3_sitescriptdir}/babel/locale-data
169%{py3_sitescriptdir}/babel/locale-data/root.dat
170%lang(ca_ES@valencia) %{py3_sitescriptdir}/babel/locale-data/ca_ES_VALENCIA.dat
73c67f0f 171%{py3_sitescriptdir}/babel/messages
4c63ce1f
MK
172%{py3_sitescriptdir}/Babel-%{version}-py*.egg-info
173%endif
174
175%if %{with doc}
8a01110b
ER
176%files apidocs
177%defattr(644,root,root,755)
1b33e715 178%doc docs/_build/html/{_static,api,*.html,*.js}
8a01110b 179%endif
This page took 0.122895 seconds and 4 git commands to generate.