[python-amqplib] * Tue Jan 31 2011 Fabian Affolter <mail at fabian-affolter.ch> - 1.0.2-3 - Added support for Python 3

Fabian Affolter fab at fedoraproject.org
Tue Jan 31 20:28:07 UTC 2012


commit a67764fef91ca86c1b0217982cf7b13c2e72b406
Author: Fabian Affolter <mail at fabian-affolter.ch>
Date:   Tue Jan 31 21:27:56 2012 +0100

    * Tue Jan 31 2011 Fabian Affolter <mail at fabian-affolter.ch> - 1.0.2-3
    - Added support for Python 3

 python-amqplib.spec |   54 ++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 51 insertions(+), 3 deletions(-)
---
diff --git a/python-amqplib.spec b/python-amqplib.spec
index fab94a6..7b87a43 100644
--- a/python-amqplib.spec
+++ b/python-amqplib.spec
@@ -1,8 +1,14 @@
+%if 0%{?fedora} > 12 || 0%{?rhel} > 6
+%global with_python3 1
+%else
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
+%endif
+
 %global srcname amqplib
 
 Name:           python-%{srcname}
 Version:        1.0.2
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Client library for AMQP
 
 Group:          Development/Languages
@@ -20,21 +26,47 @@ BuildRequires:  python-nose
 Client library for AMQP (Advanced Message Queuing Protocol)
 
 Supports the 0-8 AMQP spec, and has been tested with RabbitMQ
-and Python's 2.4, 2.5, and 2.6
+and Python's 2.4, 2.5, and 2.6.
+
+%if 0%{?with_python3}
+%package -n python3-%{srcname}
+Summary:        Client library for AMQP
+BuildRequires:  python3-devel
+BuildRequires:  python3-setuptools
+BuildRequires:  python3-nose
+
+%description -n python3-%{srcname}
+Client library for AMQP (Advanced Message Queuing Protocol)
+
+Supports the 0-8 AMQP spec, and has been tested with RabbitMQ
+and Python's 2.4 up to 3.2
+%endif
 
 
 %prep
 %setup -q -n %{srcname}-%{version}
+%if 0%{?with_python3}
+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}
 %{__python} setup.py install --skip-build --root %{buildroot}
-
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --root %{buildroot}
+popd
+%endif
  
 %clean
 rm -rf %{buildroot}
@@ -43,6 +75,12 @@ rm -rf %{buildroot}
 %check
 cd tests/client_0_8
 nosetests run_all.py
+%if 0%{?with_python3}
+pushd %{py3dir}
+cd tests/client_0_8
+nosetests-3.2 run_all.py
+popd
+%endif
 
 
 %files
@@ -51,8 +89,18 @@ nosetests run_all.py
 %{python_sitelib}/%{srcname}/
 %{python_sitelib}/%{srcname}*.egg-info
 
+%if 0%{?with_python3}
+%files -n python3-%{srcname}
+%doc CHANGES INSTALL LICENSE README TODO
+%{python3_sitelib}/%{srcname}/
+%{python3_sitelib}/%{srcname}*.egg-info
+%endif
+
 
 %changelog
+* Tue Jan 31 2011 Fabian Affolter <mail at fabian-affolter.ch> - 1.0.2-3
+- Added support for Python 3
+
 * Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.0.2-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list