2 %bcond_without python2 # build python 2 module
3 %bcond_without python3 # build python 3 module
5 %define module requests
6 Summary: HTTP library for Python
7 Summary(pl.UTF-8): Biblioteka HTTP dla Pythona
12 Group: Development/Languages/Python
13 Source0: https://pypi.python.org/packages/source/r/requests/%{module}-%{version}.tar.gz
14 # Source0-md5: 7449ffdc8ec9ac37bbcd286003c80f00
15 URL: http://python-requests.org
16 Patch0: system-charade-and-urllib3.patch
17 Patch1: system-cert.patch
19 BuildRequires: python-charade
20 BuildRequires: python-modules >= 1:2.6
21 BuildRequires: python-urllib3
24 BuildRequires: python3-charade
25 BuildRequires: python3-modules >= 3.2
26 BuildRequires: python3-urllib3
28 BuildRequires: rpm-pythonprov
29 BuildRequires: rpmbuild(macros) >= 1.219
30 Requires: ca-certificates
31 Requires: python-charade
32 Requires: python-modules >= 1:2.6
33 Requires: python-urllib3
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 Requests is a HTTP library, written in Python, for human beings.
40 Most existing Python modules for sending HTTP requests are extremely
41 verbose and cumbersome. Python's builtin urllib2 module provides most
42 of the HTTP capabilities you should need, but the API is thoroughly
43 broken. It requires an enormous amount of work (even method overrides)
44 to perform the simplest of tasks. Things shouldn't be this way. Not in
47 %description -l pl.UTF-8
48 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
50 Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
51 zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
52 zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
53 wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
54 najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
56 %package -n python3-requests
57 Summary: HTTP library, written in Python, for human beings
58 Summary(pl.UTF-8): Biblioteka HTTP library napisana w Pythonie dla ludzi
59 Group: Development/Languages/Python
60 Requires: ca-certificates
61 Requires: python3-charade
62 Requires: python3-modules >= 3.2
63 Requires: python3-urllib3
65 %description -n python3-requests
66 Requests is a HTTP library, written in Python, for human beings.
68 Most existing Python modules for sending HTTP requests are extremely
69 verbose and cumbersome. Python's builtin urllib2 module provides most
70 of the HTTP capabilities you should need, but the api is thoroughly
71 broken. It requires an enormous amount of work (even method overrides)
72 to perform the simplest of tasks. Things shouldn't be this way. Not in
75 %description -n python3-requests -l pl.UTF-8
76 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
78 Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
79 zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
80 zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
81 wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
82 najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
85 %setup -q -n %{module}-%{version}
91 %{__python} setup.py build -b py2
95 %{__python3} setup.py build -b py3
99 rm -rf $RPM_BUILD_ROOT
102 %{__python} setup.py \
107 --root=$RPM_BUILD_ROOT
108 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
109 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
114 %{__python3} setup.py \
119 --root=$RPM_BUILD_ROOT
122 %{__rm} -rf $RPM_BUILD_ROOT{%{py_sitescriptdir},%{py3_sitescriptdir}}/%{module}/{cacert.pem,packages}
125 rm -rf $RPM_BUILD_ROOT
129 %defattr(644,root,root,755)
130 %doc HISTORY.rst README.rst
131 %{py_sitescriptdir}/%{module}
132 %if "%{py_ver}" > "2.4"
133 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
138 %files -n python3-requests
139 %defattr(644,root,root,755)
140 %doc HISTORY.rst README.rst
141 %{py3_sitescriptdir}/%{module}
142 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info