[babel/f17] partial revert of b381ea7bf231acd8c33cb026f016243b3afa8856 so branches are more similar to each othe
Felix Schwarz
fschwarz at fedoraproject.org
Sat Sep 8 20:54:38 UTC 2012
commit 524cb28505d161342d954bcacbcad14c17c3b290
Author: Felix Schwarz <felix.schwarz at oss.schwarz.eu>
Date: Sat Sep 8 22:27:57 2012 +0200
partial revert of b381ea7bf231acd8c33cb026f016243b3afa8856 so branches are more similar to each other (requested by Nils Philippsen).
Please note that the most important part of the previous commit (remove non-functional python3-babel package) was *not* reverted.
babel.spec | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 55 insertions(+), 0 deletions(-)
---
diff --git a/babel.spec b/babel.spec
index a7fd0f3..0a54aa9 100644
--- a/babel.spec
+++ b/babel.spec
@@ -1,3 +1,8 @@
+# Babel < 1.0 does NOT work with Python 3, even if 2to3 is used on the code
+%if 0%{?fedora} > 12 || 0%{?rhel} > 5
+%global with_python3 0
+%endif
+
Name: babel
Version: 0.9.6
Release: 3%{?dist}
@@ -17,6 +22,13 @@ BuildRequires: python-setuptools-devel
Requires: python-babel
Requires: python-setuptools
+%if 0%{?with_python3}
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+# needed for 2to3
+BuildRequires: python-tools
+%endif
+
%description
Babel is composed of two major parts:
@@ -42,16 +54,51 @@ Babel is composed of two major parts:
providing access to various locale display names, localized number
and date formatting, etc.
+%if 0%{?with_python3}
+%package -n python3-babel
+Summary: Library for internationalizing Python applications
+Group: Development/Languages
+
+%description -n python3-babel
+Babel is composed of two major parts:
+
+* tools to build and work with gettext message catalogs
+
+* a Python interface to the CLDR (Common Locale Data Repository),
+ providing access to various locale display names, localized number
+ and date formatting, etc.
+%endif
+
%prep
%setup0 -q -n Babel-%{version}
chmod a-x babel/messages/frontend.py doc/logo.png doc/logo_small.png
%{__sed} -i -e '/^#!/,1d' babel/messages/frontend.py
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -r . %{py3dir}
+2to3 --write --nobackup %{py3dir}
+%endif
+
%build
%{__python} setup.py build
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif
+
%install
rm -rf %{buildroot}
+# install python3 build before python2 build so executables from the former
+# don't overwrite those from the latter
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --no-compile --root %{buildroot}
+popd
+%endif
+
%{__python} setup.py install --skip-build --no-compile --root %{buildroot}
%clean
@@ -68,6 +115,14 @@ rm -rf %{buildroot}
%{python_sitelib}/Babel-%{version}-py*.egg-info
%{python_sitelib}/babel
+%if 0%{?with_python3}
+%files -n python3-babel
+%defattr(-,root,root,-)
+%doc doc
+%{python3_sitelib}/Babel-%{version}-py*.egg-info
+%{python3_sitelib}/babel
+%endif
+
%changelog
* Wed Aug 01 2012 Felix Schwarz <felix.schwarz at oss.schwarz.eu> - 0.9.6-3
- disable building of non-functional python3 subpackage (#761583)
More information about the scm-commits
mailing list