3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
6 %define module requests
7 Summary: HTTP library for Python 2
8 Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 2
13 Group: Development/Languages/Python
14 Source0: https://pypi.python.org/packages/source/r/requests/%{module}-%{version}.tar.gz
15 # Source0-md5: 02214b3a179e445545de4b7a98d3dd17
16 URL: http://python-requests.org
17 # find . -name '*.py' -exec sed -i -e 's#\.packages\.urllib3#urllib3#g' "{}" ";"
18 # find . -name '*.py' -exec sed -i -e 's#from \.packages import chardet#import charade as chardet#g' "{}" ";"
19 # + manual removal from setup.py
20 Patch0: system-charade-and-urllib3.patch
21 Patch1: system-cert.patch
23 BuildRequires: python-charade
24 BuildRequires: python-modules >= 1:2.6
25 BuildRequires: python-urllib3 >= 1.9.1
28 BuildRequires: python3-charade
29 BuildRequires: python3-modules >= 1:3.2
30 BuildRequires: python3-urllib3 >= 1.9.1
32 BuildRequires: rpm-pythonprov
33 BuildRequires: rpmbuild(macros) >= 1.219
34 Requires: ca-certificates
35 Requires: python-charade
36 Requires: python-modules >= 1:2.6
37 Requires: python-urllib3 >= 1.9.1
38 # for python2 only to get SNI working. python3 doesn't need this
39 Requires: python-ndg-httpsclient
40 Requires: python-pyasn1
41 Requires: python-pyOpenSSL
43 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 Requests is a HTTP library, written in Python, for human beings.
48 Most existing Python modules for sending HTTP requests are extremely
49 verbose and cumbersome. Python's builtin urllib2 module provides most
50 of the HTTP capabilities you should need, but the API is thoroughly
51 broken. It requires an enormous amount of work (even method overrides)
52 to perform the simplest of tasks. Things shouldn't be this way. Not in
55 This package contains Python 2.x module.
57 %description -l pl.UTF-8
58 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
60 Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
61 zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
62 zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
63 wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
64 najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
66 Ten pakiet zawiera moduł dla Pythona 2.x.
68 %package -n python3-requests
69 Summary: HTTP library for Python 3
70 Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 3
71 Group: Development/Languages/Python
72 Requires: ca-certificates
73 Requires: python3-charade
74 Requires: python3-modules >= 1:3.2
75 Requires: python3-urllib3 >= 1.9.1
77 %description -n python3-requests
78 Requests is a HTTP library, written in Python, for human beings.
80 Most existing Python modules for sending HTTP requests are extremely
81 verbose and cumbersome. Python's builtin urllib2 module provides most
82 of the HTTP capabilities you should need, but the api is thoroughly
83 broken. It requires an enormous amount of work (even method overrides)
84 to perform the simplest of tasks. Things shouldn't be this way. Not in
87 This package contains Python 3.x module.
89 %description -n python3-requests -l pl.UTF-8
90 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
92 Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
93 zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
94 zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
95 wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
96 najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
98 Ten pakiet zawiera moduł dla Pythona 3.x.
101 %setup -q -n %{module}-%{version}
107 %{__python} setup.py build -b py2
111 %{__python3} setup.py build -b py3
115 rm -rf $RPM_BUILD_ROOT
118 %{__python} setup.py \
123 --root=$RPM_BUILD_ROOT
124 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
125 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
130 %{__python3} setup.py \
135 --root=$RPM_BUILD_ROOT
138 %{__rm} -rf $RPM_BUILD_ROOT{%{py_sitescriptdir},%{py3_sitescriptdir}}/%{module}/{cacert.pem,packages}
141 rm -rf $RPM_BUILD_ROOT
145 %defattr(644,root,root,755)
146 %doc HISTORY.rst README.rst
147 %{py_sitescriptdir}/%{module}
148 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
152 %files -n python3-requests
153 %defattr(644,root,root,755)
154 %doc HISTORY.rst README.rst
155 %{py3_sitescriptdir}/%{module}
156 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info