[packages/python-babel] - Up to 1.3
matkor
matkor at pld-linux.org
Fri Oct 3 12:45:37 CEST 2014
commit 4c63ce1f8fe2f47fa4b39d5e6bed78ea31ddbbeb
Author: Mateusz Korniak <matkor at pld-linux.org>
Date: Fri Oct 3 12:38:19 2014 +0200
- Up to 1.3
python-babel.spec | 101 +++++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 84 insertions(+), 17 deletions(-)
---
diff --git a/python-babel.spec b/python-babel.spec
index 7a0c922..86a7231 100644
--- a/python-babel.spec
+++ b/python-babel.spec
@@ -2,23 +2,35 @@
# - lang tag /usr/share/python*/site-packages/babel/localedata/*
#
# Conditional build:
-%bcond_without apidocs # do not build and package API docs
+%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 pkgname babel
+
+%define module babel
Summary: Babel Python library
Summary(pl.UTF-8): Biblioteka Babel do Pythona
-Name: python-%{pkgname}
-Version: 0.9.6
-Release: 2
+Name: python-%{module}
+Version: 1.3
+Release: 0.1
License: BSD-like
Group: Development/Languages/Python
-Source0: ftp://ftp.edgewall.com/pub/babel/Babel-%{version}.tar.gz
-# Source0-md5: f0edcad03dfdb5505f337ef1a7690325
+Source0: http://pypi.python.org/packages/source/B/Babel/Babel-%{version}.tar.gz
+# Source0-md5: 5264ceb02717843cbc9ffce8e6e06bdb
URL: http://babel.edgewall.org/
+%if %{with python2}
BuildRequires: python-devel
BuildRequires: python-devel-tools
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.219
+%endif
+%if %{with python3}
+BuildRequires: python3-devel
+BuildRequires: python3-distribute
+BuildRequires: python3-modules
+%endif
+
Requires: python-modules
Obsoletes: python-Babel
BuildArch: noarch
@@ -29,6 +41,21 @@ 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
+
+%package -n python3-%{module}
+Summary: -
+Summary(pl.UTF-8): -
+Group: Libraries/Python
+Requires: python3-modules
+
+%description -n python3-%{module}
+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
+
%package apidocs
Summary: Python Babel API documentation
Group: Documentation
@@ -39,38 +66,78 @@ Python Babel API documentation.
%prep
%setup -q -n Babel-%{version}
-mv doc/api apidoc
-
%build
-%{__python} setup.py build
+%if %{with python2}
+%{__python} setup.py build --build-base build-2 %{?with_tests:test}
+%endif
+
+%if %{with python3}
+%{__python3} setup.py build --build-base build-3 %{?with_tests:test}
+%endif
+
+%if %{with doc}
+cd docs
+%{__make} -j1 html
+rm -rf _build/html/_sources
+%endif
%install
rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install \
- --optimize=2 \
- --root=$RPM_BUILD_ROOT
+
+%if %{with python2}
+%{__python} setup.py \
+ build --build-base build-2 \
+ install --skip-build \
+ --optimize=2 \
+ --root=$RPM_BUILD_ROOT
%py_postclean
+%endif
+
+%if %{with python3}
+%{__python3} setup.py \
+ build --build-base build-3 \
+ install --skip-build \
+ --optimize=2 \
+ --root=$RPM_BUILD_ROOT
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
+%if %{with python2}
%files
%defattr(644,root,root,755)
-%doc COPYING README.txt doc/*
+%doc AUTHORS CHANGES LICENSE README
%attr(755,root,root) %{_bindir}/pybabel
%dir %{py_sitescriptdir}/babel
%{py_sitescriptdir}/babel/*.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
%dir %{py_sitescriptdir}/babel/messages
%{py_sitescriptdir}/babel/messages/*.py[co]
-%{py_sitescriptdir}/*.egg-info
-%if %{with apidocs}
+%if "%{py_ver}" > "2.4"
+%{py_sitescriptdir}/Babel-%{version}-py*.egg-info
+%endif
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc AUTHORS CHANGES LICENSE README
+%{py3_sitescriptdir}/%{module}
+%{py3_sitescriptdir}/Babel-%{version}-py*.egg-info
+%endif
+
+%if %{with doc}
%files apidocs
%defattr(644,root,root,755)
-%doc apidoc/*
+%doc docs/_build/html/*
%endif
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-babel.git/commitdiff/de41ba69ce0265534b897983d3f79bbe1681ee2a
More information about the pld-cvs-commit
mailing list