]> git.pld-linux.org Git - packages/python-babel.git/blobdiff - python-babel.spec
- release 6 (by relup.sh)
[packages/python-babel.git] / python-babel.spec
index 4db87f76de375853065a3a7557659f5104298a0a..3917282aed50b19652305b3f458eca2ad285d824 100644 (file)
@@ -1,22 +1,20 @@
-# TODO
-# - lang tag /usr/share/python*/site-packages/babel/localedata/*
 #
 # Conditional build:
-%bcond_without  doc             # don't build doc
-%bcond_without  tests   # do not perform "make test"
-%bcond_without  python2 # CPython 2.x module
-%bcond_without  python3 # CPython 3.x module
-
+%bcond_without doc     # don't build doc
+%bcond_without tests   # do not perform "make test"
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
 
 %define                module  babel
-Summary:       Babel Python library
-Summary(pl.UTF-8):     Biblioteka Babel do Pythona
+Summary:       Babel - internationalization library for Python 2
+Summary(pl.UTF-8):     Babel - biblioteka umiędzynaradawiająca dla Pythona 2
 Name:          python-%{module}
 Version:       1.3
-Release:       3
+Release:       6
 License:       BSD-like
 Group:         Development/Languages/Python
-Source0:       http://pypi.python.org/packages/source/B/Babel/Babel-%{version}.tar.gz
+#Source0Download: https://pypi.python.org/pypi/Babel
+Source0:       https://pypi.python.org/packages/source/B/Babel/Babel-%{version}.tar.gz
 # Source0-md5: 5264ceb02717843cbc9ffce8e6e06bdb
 URL:           http://babel.pocoo.org/
 %if %{with python2}
@@ -34,6 +32,7 @@ BuildRequires:        python3-setuptools
 BuildRequires: python3-modules
 BuildRequires: python3-pytz
 %endif
+%{?with_doc:BuildRequires: sphinx-pdg}
 Requires:      python-modules
 Requires:      python-pytz
 Obsoletes:     python-Babel
@@ -45,11 +44,14 @@ Babel is a Python library that provides an integrated collection of
 utilities that assist with internationalizing and localizing Python
 applications (in particular web-based applications).
 
-# %description -l pl.UTF-8
+%description -l pl.UTF-8
+Babel to biblioteka Pythona zawierająca zintegrowany zbiór narzędzi
+pomagających przy umiędzynaradawianiu i lokalizowaniu aplikacji w
+Pythonie (w szczególności aplikacji WWW).
 
 %package -n python3-%{module}
-Summary:       Babel Python library
-Summary(pl.UTF-8):     Biblioteka Babel do Pythona
+Summary:       Babel - internationalization library for Python 3
+Summary(pl.UTF-8):     Babel - biblioteka umiędzynaradawiająca dla Pythona 3
 Group:         Libraries/Python
 Requires:      python3-modules
 Requires:      python3-pytz
@@ -59,25 +61,32 @@ Babel is a Python library that provides an integrated collection of
 utilities that assist with internationalizing and localizing Python
 applications (in particular web-based applications).
 
-# %description -n python3-%{module} -l pl.UTF-8
+%description -n python3-%{module} -l pl.UTF-8
+Babel to biblioteka Pythona zawierająca zintegrowany zbiór narzędzi
+pomagających przy umiędzynaradawianiu i lokalizowaniu aplikacji w
+Pythonie (w szczególności aplikacji WWW).
 
 %package apidocs
 Summary:       Python Babel API documentation
+Summary(pl.UTF-8):     Dokumentacja API biblioteki Pythona Babel
 Group:         Documentation
 
 %description apidocs
 Python Babel API documentation.
 
+%description apidocs -l pl.UTF-8
+Dokumentacja API biblioteki Pythona Babel.
+
 %prep
 %setup -q -n Babel-%{version}
 
 %build
 %if %{with python2}
-%{__python} setup.py build --build-base build-2 %{?with_tests:test}
+%py_build %{?with_tests:test}
 %endif
 
 %if %{with python3}
-%{__python3} setup.py build --build-base build-3 %{?with_tests:test}
+%py3_build %{?with_tests:test}
 %endif
 
 %if %{with doc}
@@ -89,41 +98,41 @@ rm -rf _build/html/_sources
 %install
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python3}
+%py3_install
+
+%{__mv} $RPM_BUILD_ROOT%{_bindir}/{pybabel,pybabel3}
+%endif
+
 %if %{with python2}
-%{__python} setup.py \
-        build --build-base build-2 \
-        install --skip-build \
-        --optimize=2 \
-        --root=$RPM_BUILD_ROOT
+%py_install
 
 %py_postclean
 %endif
 
-%if %{with python3}
-%{__python3} setup.py \
-        build --build-base build-3 \
-        install --skip-build \
-        --optimize=2 \
-        --root=$RPM_BUILD_ROOT
-%endif
+find $RPM_BUILD_ROOT%{py_sitescriptdir}/babel/localedata -name '*.dat' | \
+       sed -e "s#^$RPM_BUILD_ROOT##" | \
+       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
+
+find $RPM_BUILD_ROOT%{py3_sitescriptdir}/babel/localedata -name '*.dat' | \
+       sed -e "s#^$RPM_BUILD_ROOT##" | \
+       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
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %if %{with python2}
-%files
+%files -f py2.lang
 %defattr(644,root,root,755)
 %doc AUTHORS CHANGES LICENSE README
 %attr(755,root,root) %{_bindir}/pybabel
 %dir %{py_sitescriptdir}/babel
-%{py_sitescriptdir}/babel/*.dat
+%{py_sitescriptdir}/babel/global.dat
 %{py_sitescriptdir}/babel/*.py[co]
 %dir %{py_sitescriptdir}/babel/localtime
 %{py_sitescriptdir}/babel/localtime/*.py[co]
-
 %dir %{py_sitescriptdir}/babel/localedata
-# TODO: %lang tag
-%{py_sitescriptdir}/babel/localedata/*.dat
+%{py_sitescriptdir}/babel/localedata/root.dat
 %dir %{py_sitescriptdir}/babel/messages
 %{py_sitescriptdir}/babel/messages/*.py[co]
 
@@ -133,10 +142,18 @@ rm -rf $RPM_BUILD_ROOT
 %endif
 
 %if %{with python3}
-%files -n python3-%{module}
+%files -n python3-%{module} -f py3.lang
 %defattr(644,root,root,755)
 %doc AUTHORS CHANGES LICENSE README
-%{py3_sitescriptdir}/%{module}
+%attr(755,root,root) %{_bindir}/pybabel3
+%dir %{py3_sitescriptdir}/babel
+%{py3_sitescriptdir}/babel/__pycache__
+%{py3_sitescriptdir}/babel/global.dat
+%{py3_sitescriptdir}/babel/*.py
+%{py3_sitescriptdir}/babel/localtime
+%dir %{py3_sitescriptdir}/babel/localedata
+%{py3_sitescriptdir}/babel/localedata/root.dat
+%{py3_sitescriptdir}/babel/messages
 %{py3_sitescriptdir}/Babel-%{version}-py*.egg-info
 %endif
 
@@ -145,4 +162,3 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %doc docs/_build/html/*
 %endif
-
This page took 0.082763 seconds and 4 git commands to generate.