[packages/python-grequests] - started python3 support

arekm arekm at pld-linux.org
Fri Aug 14 15:23:46 CEST 2015


commit cbf6c95703d9e6f3c981243ff7c62985236611c9
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Fri Aug 14 15:23:42 2015 +0200

    - started python3 support

 python-grequests.spec | 62 ++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 56 insertions(+), 6 deletions(-)
---
diff --git a/python-grequests.spec b/python-grequests.spec
index b01b51d..e68211f 100644
--- a/python-grequests.spec
+++ b/python-grequests.spec
@@ -1,3 +1,10 @@
+#
+# Conditional build:
+%bcond_without  doc             # don't build doc
+%bcond_without  tests   # do not perform "make test"
+%bcond_without  python2 # CPython 2.x module
+%bcond_with  python3 # CPython 3.x module
+
 %define 	module	grequests
 Summary:	gevent support for python-requests
 Name:		python-%{module}
@@ -8,11 +15,18 @@ Group:		Libraries/Python
 Source0:	https://pypi.python.org/packages/source/g/grequests/grequests-%{version}.tar.gz
 # Source0-md5:	23186795cf69d127f5e90df665d25387
 URL:		https://github.com/kennethreitz/grequests
+%if %{with python2}
 BuildRequires:	python-distribute
-BuildRequires:	rpm-pythonprov
-BuildRequires:	rpmbuild(macros) >= 1.219
+BuildRequires:	python-gevent
 Requires:	python-libs
 Requires:	python-requests
+%endif
+%if %{with python3}
+BuildRequires:	python3-distribute
+BuildRequires:	python3-gevent
+%endif
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.219
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -20,26 +34,53 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 GRequests allows you to use Requests with Gevent to make asyncronous
 HTTP Requests easily.
 
+%package -n python3-%{module}
+Summary:	gevent support for python-requests
+Group:		Libraries/Python
+Requires:	python3-libs
+Requires:	python3-requests
+
+%description -n python3-%{module}
+GRequests allows you to use Requests with Gevent to make asyncronous
+HTTP Requests easily.
+
 %prep
 %setup -q -n %{module}-%{version}
 
 %build
+%if %{with python2}
 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
+%endif
+
+%if %{with python3}
+%{__python3} setup.py build --build-base build-3 %{?with_tests:test}
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %{__python} setup.py \
-	build --build-base build-2 \
-	install --skip-build \
-	--optimize=2 \
-	--root=$RPM_BUILD_ROOT
+		build --build-base build-2 \
+		install --skip-build \
+		--optimize=2 \
+		--root=$RPM_BUILD_ROOT
 
 %py_postclean
+%endif
+
+%if %{with python3}
+%{__python3} setup.py \
+		build --build-base build-3 \
+		install --skip-build \
+		--optimize=2 \
+		--root=$RPM_BUILD_ROOT
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %files
 %defattr(644,root,root,755)
 %doc README.rst
@@ -47,3 +88,12 @@ rm -rf $RPM_BUILD_ROOT
 %if "%{py_ver}" > "2.4"
 %{py_sitescriptdir}/*.egg-info
 %endif
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc README.rst
+#%{py3_sitescriptdir}/%{module}
+#%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-grequests.git/commitdiff/cbf6c95703d9e6f3c981243ff7c62985236611c9



More information about the pld-cvs-commit mailing list