From b073cd0309754517716bc5e81ce583e848adddac Mon Sep 17 00:00:00 2001 From: Felix Schwarz Date: Sep 08 2012 20:42:24 +0000 Subject: partial revert of c5d9d8c5ed0ce8fa97dc904d756f43d6dda6fc4c 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. --- diff --git a/babel.spec b/babel.spec index dd0fee7..c6fae8e 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: 2%{?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: @@ -39,16 +51,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 @@ -65,6 +112,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 - 0.9.6-2 - disable building of non-functional python3 subpackage (#761583)