[python-translationstring] Lay the groundwork for a python3 subpackage.

Ralph Bean ralph at fedoraproject.org
Sat Dec 8 03:51:32 UTC 2012


commit c28be9f02c59e860ae43ae1478089fae385fb2ab
Author: Ralph Bean <rbean at redhat.com>
Date:   Fri Dec 7 22:51:24 2012 -0500

    Lay the groundwork for a python3 subpackage.

 python-translationstring.spec |   88 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 80 insertions(+), 8 deletions(-)
---
diff --git a/python-translationstring.spec b/python-translationstring.spec
index aac02bc..d6f701b 100644
--- a/python-translationstring.spec
+++ b/python-translationstring.spec
@@ -1,8 +1,15 @@
+%if 0%{?fedora} > 12 || 0%{?rhel} > 6
+#%%global with_python3 1
+# Building the python3-translationstring subpackage is explicitly disabled
+# until we can package python3-babel.  We're almost there..
+%global with_python3 0
+%endif
+
 %global modname translationstring
 
 Name:           python-translationstring
 Version:        1.1
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Utility library for i18n relied on by various Repoze packages
 
 Group:          Development/Libraries
@@ -12,10 +19,19 @@ Source0:        http://pypi.python.org/packages/source/t/translationstring/%{mod
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 
-BuildRequires:  python-babel
 BuildRequires:  python2-devel
 BuildRequires:  python-setuptools-devel
 
+BuildRequires:  python-babel
+
+%if 0%{?with_python3}
+BuildRequires:  python3-devel
+BuildRequires:  python3-setuptools
+
+BuildRequires:  python3-babel
+%endif
+
+
 %description
 A library used by various `Repoze <http://repoze.org>`_ packages for
 internationalization (i18n) duties related to translation.
@@ -28,28 +44,84 @@ facilities of this package.  It does not depend on `Babel
 are meant to work best when provided with an instance of the
 ``babel.support.Translations`` class.
 
+%if 0%{?with_python3}
+%package -n python3-translationstring
+Summary:        Utility library for i18n relied on by various Repoze packages
+Group:          Development/Libraries
+
+%description -n python3-translationstring
+A library used by various `Repoze <http://repoze.org>`_ packages for
+internationalization (i18n) duties related to translation.
+
+This package provides a *translation string* class, a *translation string
+factory* class, translation and pluralization primitives, and a utility that
+helps `Chameleon <http://chameleon.repoze.org>`_ templates use translation
+facilities of this package.  It does not depend on `Babel
+<http://babel.edgewall.org>`_, but its translation and pluralization services
+are meant to work best when provided with an instance of the
+``babel.support.Translations`` class.
+%endif
+
 %prep
 %setup -q -n %{modname}-%{version}
 
+# Remove bundled egg info if it exists.
+rm -rf %{modname}.egg-info
+
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+%endif
+
+
 %build
 %{__python} setup.py build
 
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif
+
 %install
-rm -rf %{buildroot}
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
+popd
+%endif
+
 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
 
 %check
-%{__python} setup.py test
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py test
+popd
+%endif
 
-%clean
-rm -rf %{buildroot}
+%{__python} setup.py test
 
 %files
-%defattr(-,root,root,-)
 %doc README.txt LICENSE.txt
-%{python_sitelib}/*
+%{python_sitelib}/%{modname}/
+%{python_sitelib}/%{modname}-%{version}*.egg-info
+
+%if 0%{?with_python3}
+%files -n python3-translationstring
+%doc README.txt LICENSE.txt
+%{python3_sitelib}/%{modname}/
+%{python3_sitelib}/%{modname}-%{version}*.egg-info
+%endif
+
 
 %changelog
+* Fri Dec 07 2012 Ralph Bean <rbean at redhat.com> - 1.1-3
+- Laid groundwork for packaging python3 support.  Waiting on python3-babel.
+- Removed unnecessary defattr.
+- Removed unnecessary removal of the buildroot.
+- Removed unnecessary clean section.
+- Removed bundled egg-info.
+
 * Sat Jul 21 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.1-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 


More information about the scm-commits mailing list