[packages/python-requests] build python3 module

draenog draenog at pld-linux.org
Fri Jul 27 07:11:10 CEST 2012


commit a0c91a8ec15f8e7d5df15d893ad8aa4d624d2cdc
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Fri Jul 27 06:09:48 2012 +0100

    build python3 module

 python-requests.spec | 43 ++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 40 insertions(+), 3 deletions(-)
---
diff --git a/python-requests.spec b/python-requests.spec
index 3b698ad..f84b3ae 100644
--- a/python-requests.spec
+++ b/python-requests.spec
@@ -7,7 +7,7 @@
 Summary:	HTTP library for Python
 Name:		python-%{module}
 Version:	0.13.3
-Release:	1
+Release:	2
 License:	ISC
 Group:		Development/Languages/Python
 Source0:	https://github.com/kennethreitz/requests/tarball/v%{version}-11-g52b55cc/%{name}-%{version}.tgz
@@ -32,6 +32,23 @@ to perform the simplest of tasks.
 
 Things shouldn't be this way. Not in Python.
 
+%package -n python3-requests
+Summary:	HTTP library, written in Python, for human beings
+License:	ISC
+Group:		Development/Languages/Python
+
+%description -n python3-requests
+Requests is an ISC Licensed HTTP library, written in Python, for human
+beings.
+
+Most existing Python modules for sending HTTP requests are extremely
+verbose and cumbersome. Python's builtin urllib2 module provides most
+of the HTTP capabilities you should need, but the api is thoroughly
+broken. It requires an enormous amount of work (even method overrides)
+to perform the simplest of tasks.
+
+Things shouldn't be this way. Not in Python.
+
 %prep
 %setup -qc
 mv *-%{module}-*/* .
@@ -47,15 +64,30 @@ mv *-%{module}-*/* .
 ver=$(%{__python} -c "import requests; print requests.__version__")
 test "$ver" = %{version}
 
-%{__python} setup.py build
+mkdir py2-egg py3-egg
+%{__python} setup.py build --build-base py2 egg_info --egg-base py2-egg
+%{__python3} setup.py build --build-base py3 egg_info --egg-base py3-egg
+
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install \
+%{__python} setup.py \
+	build --build-base py2 \
+        egg_info --egg-base py2-egg \
+        install \
 	--skip-build \
 	--optimize=2 \
 	--root=$RPM_BUILD_ROOT
 
+%{__python3} setup.py  \
+	build --build-base py3 \
+        egg_info --egg-base py3-egg \
+        install \
+        --skip-build \
+        --optimize=2 \
+        --root=$RPM_BUILD_ROOT
+
+
 %py_postclean
 
 %clean
@@ -68,3 +100,8 @@ rm -rf $RPM_BUILD_ROOT
 %if "%{py_ver}" > "2.4"
 %{py_sitescriptdir}/%{module}-*.egg-info
 %endif
+
+%files -n python3-requests
+%defattr(644,root,root,755)
+%{py3_sitescriptdir}/%{module}
+%{py3_sitescriptdir}/%{module}-*.egg-info


More information about the pld-cvs-commit mailing list