[python-pycurl/private-kdudka-python3: 2/3] add python3 subpackage (#985288)

Kamil Dudka kdudka at fedoraproject.org
Mon Sep 30 11:46:29 UTC 2013


commit a3e17f497db2461592eebb07c9abd24dd0ad25a4
Author: Kamil Dudka <kdudka at redhat.com>
Date:   Thu Aug 8 14:09:15 2013 +0200

    add python3 subpackage (#985288)

 python-pycurl.spec |   35 +++++++++++++++++++++++++++++++++--
 1 files changed, 33 insertions(+), 2 deletions(-)
---
diff --git a/python-pycurl.spec b/python-pycurl.spec
index 5200c9e..6b93206 100644
--- a/python-pycurl.spec
+++ b/python-pycurl.spec
@@ -2,7 +2,7 @@
 
 Name:           python-pycurl
 Version:        7.19.0.1
-Release:        1%{?dist}
+Release:        1.1%{?dist}
 Summary:        A Python interface to libcurl
 
 Group:          Development/Languages
@@ -12,6 +12,7 @@ Source0:        http://pycurl.sourceforge.net/download/pycurl-%{version}.tar.gz
 
 Requires:       keyutils-libs
 BuildRequires:  python-devel
+BuildRequires:  python3-devel
 BuildRequires:  curl-devel >= 7.19.0
 BuildRequires:  openssl-devel
 BuildRequires:  python-bottle
@@ -37,6 +38,15 @@ objects identified by a URL from a Python program, similar to the
 urllib Python module. PycURL is mature, very fast, and supports a lot
 of features.
 
+%package -n python3-pycurl
+Summary:        A Python interface to libcurl for Python 3
+
+%description -n python3-pycurl
+PycURL is a Python interface to libcurl. PycURL can be used to fetch
+objects identified by a URL from a Python program, similar to the
+urllib Python module. PycURL is mature, very fast, and supports a lot
+of features.
+
 %prep
 %setup0 -q -n pycurl-%{version}
 
@@ -46,22 +56,43 @@ rm -f tests/certinfo_test.py
 # temporarily disable intermittently failing test-case
 rm -f tests/multi_socket_select_test.py
 
+# copy the whole directory for the python3 build
+cp -a . %{py3dir}
+
 %build
-CFLAGS="$RPM_OPT_FLAGS -DHAVE_CURL_OPENSSL" %{__python} setup.py build
+export CFLAGS="$RPM_OPT_FLAGS -DHAVE_CURL_OPENSSL"
+%{__python} setup.py build
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
 
 %check
 export PYTHONPATH=$RPM_BUILD_ROOT%{python_sitearch}
 make test PYTHON=%{__python}
+pushd %{py3dir}
+export PYTHONPATH=$RPM_BUILD_ROOT%{python3_sitearch}
+make test PYTHON=%{__python3}
+popd
 
 %install
 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
+popd
 rm -rf %{buildroot}%{_datadir}/doc/pycurl
 
 %files
 %doc COPYING COPYING2 ChangeLog README.rst TODO examples doc tests
 %{python_sitearch}/*
 
+%files -n python3-pycurl
+%doc COPYING COPYING2 ChangeLog README.rst TODO examples doc tests
+%{python3_sitearch}/*
+
 %changelog
+* Mon Sep 30 2013 Kamil Dudka <kdudka at redhat.com> - 7.19.0.1-1.1
+- add python3 subpackage (#985288)
+
 * Wed Sep 25 2013 Kamil Dudka <kdudka at redhat.com> - 7.19.0.1-1
 - update to 7.19.0.1
 


More information about the scm-commits mailing list