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