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