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: 931461f761c70708c46ea65b7889da58
16 URL: http://python-requests.org
17 Patch0: system-charade-and-urllib3.patch
18 Patch1: system-cert.patch
20 BuildRequires: python-charade
21 BuildRequires: python-modules >= 1:2.6
22 BuildRequires: python-urllib3 >= 1.9.1
25 BuildRequires: python3-charade
26 BuildRequires: python3-modules >= 1:3.2
27 BuildRequires: python3-urllib3 >= 1.9.1
29 BuildRequires: rpm-pythonprov
30 BuildRequires: rpmbuild(macros) >= 1.219
31 Requires: ca-certificates
32 Requires: python-charade
33 Requires: python-modules >= 1:2.6
34 Requires: python-urllib3 >= 1.9.1
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 Requests is a HTTP library, written in Python, for human beings.
41 Most existing Python modules for sending HTTP requests are extremely
42 verbose and cumbersome. Python's builtin urllib2 module provides most
43 of the HTTP capabilities you should need, but the API is thoroughly
44 broken. It requires an enormous amount of work (even method overrides)
45 to perform the simplest of tasks. Things shouldn't be this way. Not in
48 This package contains Python 2.x module.
50 %description -l pl.UTF-8
51 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
53 Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
54 zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
55 zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
56 wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
57 najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
59 Ten pakiet zawiera moduł dla Pythona 2.x.
61 %package -n python3-requests
62 Summary: HTTP library for Python 3
63 Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 3
64 Group: Development/Languages/Python
65 Requires: ca-certificates
66 Requires: python3-charade
67 Requires: python3-modules >= 1:3.2
68 Requires: python3-urllib3 >= 1.9.1
70 %description -n python3-requests
71 Requests is a HTTP library, written in Python, for human beings.
73 Most existing Python modules for sending HTTP requests are extremely
74 verbose and cumbersome. Python's builtin urllib2 module provides most
75 of the HTTP capabilities you should need, but the api is thoroughly
76 broken. It requires an enormous amount of work (even method overrides)
77 to perform the simplest of tasks. Things shouldn't be this way. Not in
80 This package contains Python 3.x module.
82 %description -n python3-requests -l pl.UTF-8
83 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
85 Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
86 zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
87 zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
88 wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
89 najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
91 Ten pakiet zawiera moduł dla Pythona 3.x.
94 %setup -q -n %{module}-%{version}
100 %{__python} setup.py build -b py2
104 %{__python3} setup.py build -b py3
108 rm -rf $RPM_BUILD_ROOT
111 %{__python} setup.py \
116 --root=$RPM_BUILD_ROOT
117 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
118 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
123 %{__python3} setup.py \
128 --root=$RPM_BUILD_ROOT
131 %{__rm} -rf $RPM_BUILD_ROOT{%{py_sitescriptdir},%{py3_sitescriptdir}}/%{module}/{cacert.pem,packages}
134 rm -rf $RPM_BUILD_ROOT
138 %defattr(644,root,root,755)
139 %doc HISTORY.rst README.rst
140 %{py_sitescriptdir}/%{module}
141 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
145 %files -n python3-requests
146 %defattr(644,root,root,755)
147 %doc HISTORY.rst README.rst
148 %{py3_sitescriptdir}/%{module}
149 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info