2 # - bundled external libs? packages/ contains:
6 %define module requests
7 Summary: HTTP library for Python
12 Group: Development/Languages/Python
13 Source0: https://github.com/kennethreitz/requests/tarball/v%{version}-11-g52b55cc/%{name}-%{version}.tgz
14 # Source0-md5: d4e0de0ecfc14128c3a878d9f82328a0
15 URL: https://github.com/kennethreitz/requests
16 BuildRequires: rpm-pythonprov
17 BuildRequires: rpmbuild(macros) >= 1.219
18 BuildRequires: sed >= 4.0
19 Requires: python-modules
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 Requests is an ISC Licensed HTTP library, written in Python, for human
27 Most existing Python modules for sending HTTP requests are extremely
28 verbose and cumbersome. Python's builtin urllib2 module provides most
29 of the HTTP capabilities you should need, but the api is thoroughly
30 broken. It requires an enormous amount of work (even method overrides)
31 to perform the simplest of tasks.
33 Things shouldn't be this way. Not in Python.
35 %package -n python3-requests
36 Summary: HTTP library, written in Python, for human beings
38 Group: Development/Languages/Python
40 %description -n python3-requests
41 Requests is an ISC Licensed HTTP library, written in Python, for human
44 Most existing Python modules for sending HTTP requests are extremely
45 verbose and cumbersome. Python's builtin urllib2 module provides most
46 of the HTTP capabilities you should need, but the api is thoroughly
47 broken. It requires an enormous amount of work (even method overrides)
48 to perform the simplest of tasks.
50 Things shouldn't be this way. Not in Python.
56 # fix version in module
57 # tarball for 0.13.3 contains 0.13.2:
58 #./HISTORY.rst:0.13.2 (2012-06-28)
59 #./requests/__init__.py:__version__ = '0.13.2'
60 #./requests/__init__.py:__build__ = 0x001302
61 %{__sed} -i -e 's/0\.13\.2/0.13.3/; s/0x001302/0x001302/' requests/__init__.py
64 ver=$(%{__python} -c "import requests; print requests.__version__")
65 test "$ver" = %{version}
68 %{__python} setup.py build --build-base py2 egg_info --egg-base py2-egg
69 %{__python3} setup.py build --build-base py3 egg_info --egg-base py3-egg
73 rm -rf $RPM_BUILD_ROOT
74 %{__python} setup.py \
75 build --build-base py2 \
76 egg_info --egg-base py2-egg \
80 --root=$RPM_BUILD_ROOT
82 %{__python3} setup.py \
83 build --build-base py3 \
84 egg_info --egg-base py3-egg \
88 --root=$RPM_BUILD_ROOT
94 rm -rf $RPM_BUILD_ROOT
97 %defattr(644,root,root,755)
98 %doc AUTHORS.rst README.rst LICENSE docs
99 %{py_sitescriptdir}/%{module}
100 %if "%{py_ver}" > "2.4"
101 %{py_sitescriptdir}/%{module}-*.egg-info
104 %files -n python3-requests
105 %defattr(644,root,root,755)
106 %{py3_sitescriptdir}/%{module}
107 %{py3_sitescriptdir}/%{module}-*.egg-info