]>
Commit | Line | Data |
---|---|---|
8d099eee | 1 | # Conditional build: |
a8d01621 ŁK |
2 | %bcond_without python2 # build python 2 module |
3 | %bcond_without python3 # build python 3 module | |
8d099eee | 4 | # |
8ba13116 MM |
5 | %define module requests |
6 | Summary: HTTP library for Python | |
8d099eee | 7 | Summary(pl.UTF-8): Biblioteka HTTP dla Pythona |
8ba13116 | 8 | Name: python-%{module} |
9e57f9c2 | 9 | Version: 2.4.1 |
4a7ef446 | 10 | Release: 1 |
a8d01621 | 11 | License: Apache2 |
8ba13116 | 12 | Group: Development/Languages/Python |
a8d01621 | 13 | Source0: https://pypi.python.org/packages/source/r/requests/%{module}-%{version}.tar.gz |
9e57f9c2 | 14 | # Source0-md5: 931461f761c70708c46ea65b7889da58 |
a8d01621 | 15 | URL: http://python-requests.org |
4a7ef446 ŁK |
16 | Patch0: system-charade-and-urllib3.patch |
17 | Patch1: system-cert.patch | |
a8d01621 | 18 | %if %{with python2} |
4a7ef446 | 19 | BuildRequires: python-charade |
a8d01621 | 20 | BuildRequires: python-modules >= 1:2.6 |
9e57f9c2 | 21 | BuildRequires: python-urllib3 >= 1.9.1 |
a8d01621 ŁK |
22 | %endif |
23 | %if %{with python3} | |
4a7ef446 | 24 | BuildRequires: python3-charade |
a8d01621 | 25 | BuildRequires: python3-modules >= 3.2 |
9e57f9c2 | 26 | BuildRequires: python3-urllib3 >= 1.9.1 |
a8d01621 | 27 | %endif |
8ba13116 MM |
28 | BuildRequires: rpm-pythonprov |
29 | BuildRequires: rpmbuild(macros) >= 1.219 | |
4a7ef446 ŁK |
30 | Requires: ca-certificates |
31 | Requires: python-charade | |
a8d01621 | 32 | Requires: python-modules >= 1:2.6 |
9e57f9c2 | 33 | Requires: python-urllib3 >= 1.9.1 |
8ba13116 MM |
34 | BuildArch: noarch |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
37 | %description | |
a8d01621 | 38 | Requests is a HTTP library, written in Python, for human beings. |
8ba13116 MM |
39 | |
40 | Most existing Python modules for sending HTTP requests are extremely | |
41 | verbose and cumbersome. Python's builtin urllib2 module provides most | |
8d099eee | 42 | of the HTTP capabilities you should need, but the API is thoroughly |
8ba13116 | 43 | broken. It requires an enormous amount of work (even method overrides) |
8d099eee JB |
44 | to perform the simplest of tasks. Things shouldn't be this way. Not in |
45 | Python. | |
46 | ||
47 | %description -l pl.UTF-8 | |
a8d01621 | 48 | Requests to napisana w Pythonie biblioteka HTTP dla ludzi. |
8ba13116 | 49 | |
8d099eee JB |
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. | |
8ba13116 | 55 | |
a0c91a8e KK |
56 | %package -n python3-requests |
57 | Summary: HTTP library, written in Python, for human beings | |
8d099eee | 58 | Summary(pl.UTF-8): Biblioteka HTTP library napisana w Pythonie dla ludzi |
a0c91a8e | 59 | Group: Development/Languages/Python |
4a7ef446 ŁK |
60 | Requires: ca-certificates |
61 | Requires: python3-charade | |
a8d01621 | 62 | Requires: python3-modules >= 3.2 |
9e57f9c2 | 63 | Requires: python3-urllib3 >= 1.9.1 |
a0c91a8e KK |
64 | |
65 | %description -n python3-requests | |
a8d01621 | 66 | Requests is a HTTP library, written in Python, for human beings. |
a0c91a8e KK |
67 | |
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) | |
8d099eee JB |
72 | to perform the simplest of tasks. Things shouldn't be this way. Not in |
73 | Python. | |
74 | ||
75 | %description -n python3-requests -l pl.UTF-8 | |
a8d01621 | 76 | Requests to napisana w Pythonie biblioteka HTTP dla ludzi. |
a0c91a8e | 77 | |
a8d01621 ŁK |
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. | |
a0c91a8e | 83 | |
8ba13116 | 84 | %prep |
a8d01621 | 85 | %setup -q -n %{module}-%{version} |
23ad999c | 86 | %patch0 -p1 |
4a7ef446 | 87 | %patch1 -p1 |
e16ab944 | 88 | |
8ba13116 | 89 | %build |
a8d01621 ŁK |
90 | %if %{with python2} |
91 | %{__python} setup.py build -b py2 | |
92 | %endif | |
a0c91a8e | 93 | |
a8d01621 ŁK |
94 | %if %{with python3} |
95 | %{__python3} setup.py build -b py3 | |
8d099eee | 96 | %endif |
8ba13116 MM |
97 | |
98 | %install | |
99 | rm -rf $RPM_BUILD_ROOT | |
a8d01621 ŁK |
100 | |
101 | %if %{with python2} | |
a0c91a8e | 102 | %{__python} setup.py \ |
a8d01621 ŁK |
103 | build -b py2 \ |
104 | install \ | |
8ba13116 MM |
105 | --skip-build \ |
106 | --optimize=2 \ | |
107 | --root=$RPM_BUILD_ROOT | |
4a7ef446 ŁK |
108 | %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir} |
109 | %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
a8d01621 ŁK |
110 | %py_postclean |
111 | %endif | |
8ba13116 | 112 | |
a8d01621 | 113 | %if %{with python3} |
a0c91a8e | 114 | %{__python3} setup.py \ |
a8d01621 ŁK |
115 | build -b py3 \ |
116 | install \ | |
117 | --skip-build \ | |
118 | --optimize=2 \ | |
119 | --root=$RPM_BUILD_ROOT | |
120 | %endif | |
8ba13116 | 121 | |
4a7ef446 ŁK |
122 | %{__rm} -rf $RPM_BUILD_ROOT{%{py_sitescriptdir},%{py3_sitescriptdir}}/%{module}/{cacert.pem,packages} |
123 | ||
8ba13116 MM |
124 | %clean |
125 | rm -rf $RPM_BUILD_ROOT | |
126 | ||
a8d01621 | 127 | %if %{with python2} |
8ba13116 MM |
128 | %files |
129 | %defattr(644,root,root,755) | |
a8d01621 | 130 | %doc HISTORY.rst README.rst |
8ba13116 | 131 | %{py_sitescriptdir}/%{module} |
a8d01621 | 132 | %if "%{py_ver}" > "2.4" |
8d099eee | 133 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
a8d01621 ŁK |
134 | %endif |
135 | %endif | |
a0c91a8e | 136 | |
a8d01621 | 137 | %if %{with python3} |
a0c91a8e KK |
138 | %files -n python3-requests |
139 | %defattr(644,root,root,755) | |
a8d01621 | 140 | %doc HISTORY.rst README.rst |
a0c91a8e | 141 | %{py3_sitescriptdir}/%{module} |
8d099eee | 142 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info |
a8d01621 | 143 | %endif |