]> git.pld-linux.org Git - packages/python-babel.git/blob - python-babel.spec
86f11a441a61219259b56e7076433ff14c7e60de
[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.8.0
14 Release:        4
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:  6fad9772e75421969ddb41975483abdf
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
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 %{__python} -m pytest tests
99 %endif
100 %endif
101
102 %if %{with python3}
103 %py3_build
104
105 %if %{with tests}
106 %{__python3} -m pytest tests
107 %endif
108 %endif
109
110 %if %{with doc}
111 %{__make} -C docs -j1 html
112 %endif
113
114 %install
115 rm -rf $RPM_BUILD_ROOT
116
117 %if %{with python3}
118 %py3_install
119
120 %{__mv} $RPM_BUILD_ROOT%{_bindir}/{pybabel,pybabel3}
121 %endif
122
123 %if %{with python2}
124 %py_install
125
126 %py_postclean
127 %endif
128
129 find $RPM_BUILD_ROOT%{py_sitescriptdir}/babel/locale-data -name '*.dat' | \
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$,&,p' > py2.lang
132
133 find $RPM_BUILD_ROOT%{py3_sitescriptdir}/babel/locale-data -name '*.dat' | \
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,&,p' > py3.lang
136
137 %clean
138 rm -rf $RPM_BUILD_ROOT
139
140 %if %{with python2}
141 %files -f py2.lang
142 %defattr(644,root,root,755)
143 %doc AUTHORS CHANGES LICENSE
144 %attr(755,root,root) %{_bindir}/pybabel
145 %dir %{py_sitescriptdir}/babel
146 %{py_sitescriptdir}/babel/global.dat
147 %{py_sitescriptdir}/babel/*.py[co]
148 %dir %{py_sitescriptdir}/babel/localtime
149 %{py_sitescriptdir}/babel/localtime/*.py[co]
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
153 %dir %{py_sitescriptdir}/babel/messages
154 %{py_sitescriptdir}/babel/messages/*.py[co]
155 %{py_sitescriptdir}/Babel-%{version}-py*.egg-info
156 %endif
157
158 %if %{with python3}
159 %files -n python3-%{module} -f py3.lang
160 %defattr(644,root,root,755)
161 %doc AUTHORS CHANGES LICENSE
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
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
171 %{py3_sitescriptdir}/babel/messages
172 %{py3_sitescriptdir}/Babel-%{version}-py*.egg-info
173 %endif
174
175 %if %{with doc}
176 %files apidocs
177 %defattr(644,root,root,755)
178 %doc docs/_build/html/{_static,api,*.html,*.js}
179 %endif
This page took 0.069164 seconds and 2 git commands to generate.