]>
Commit | Line | Data |
---|---|---|
e16ab944 ER |
1 | # TODO |
2 | # - bundled external libs? packages/ contains: | |
a8d01621 ŁK |
3 | # charade/ |
4 | # urllib3/ | |
8d099eee JB |
5 | # |
6 | # Conditional build: | |
a8d01621 ŁK |
7 | %bcond_without python2 # build python 2 module |
8 | %bcond_without python3 # build python 3 module | |
8d099eee | 9 | # |
8ba13116 MM |
10 | %define module requests |
11 | Summary: HTTP library for Python | |
8d099eee | 12 | Summary(pl.UTF-8): Biblioteka HTTP dla Pythona |
8ba13116 | 13 | Name: python-%{module} |
a8d01621 ŁK |
14 | Version: 1.2.3 |
15 | Release: 0.2 | |
16 | License: Apache2 | |
8ba13116 | 17 | Group: Development/Languages/Python |
a8d01621 ŁK |
18 | Source0: https://pypi.python.org/packages/source/r/requests/%{module}-%{version}.tar.gz |
19 | # Source0-md5: adbd3f18445f7fe5e77f65c502e264fb | |
20 | URL: http://python-requests.org | |
21 | %if %{with python2} | |
22 | BuildRequires: python-modules >= 1:2.6 | |
23 | %endif | |
24 | %if %{with python3} | |
25 | BuildRequires: python3-modules >= 3.2 | |
26 | %endif | |
8ba13116 MM |
27 | BuildRequires: rpm-pythonprov |
28 | BuildRequires: rpmbuild(macros) >= 1.219 | |
a8d01621 | 29 | Requires: python-modules >= 1:2.6 |
8ba13116 MM |
30 | BuildArch: noarch |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
a8d01621 | 34 | Requests is a HTTP library, written in Python, for human beings. |
8ba13116 MM |
35 | |
36 | Most existing Python modules for sending HTTP requests are extremely | |
37 | verbose and cumbersome. Python's builtin urllib2 module provides most | |
8d099eee | 38 | of the HTTP capabilities you should need, but the API is thoroughly |
8ba13116 | 39 | broken. It requires an enormous amount of work (even method overrides) |
8d099eee JB |
40 | to perform the simplest of tasks. Things shouldn't be this way. Not in |
41 | Python. | |
42 | ||
43 | %description -l pl.UTF-8 | |
a8d01621 | 44 | Requests to napisana w Pythonie biblioteka HTTP dla ludzi. |
8ba13116 | 45 | |
8d099eee JB |
46 | Większość istniejących modułów Pythona do wysyłania żądań HTTP jest |
47 | zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2 | |
48 | zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie - | |
49 | wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania | |
50 | najprostszych zadań. Nie powinno tak być. Nie w Pythonie. | |
8ba13116 | 51 | |
a0c91a8e KK |
52 | %package -n python3-requests |
53 | Summary: HTTP library, written in Python, for human beings | |
8d099eee | 54 | Summary(pl.UTF-8): Biblioteka HTTP library napisana w Pythonie dla ludzi |
a0c91a8e | 55 | Group: Development/Languages/Python |
a8d01621 | 56 | Requires: python3-modules >= 3.2 |
a0c91a8e KK |
57 | |
58 | %description -n python3-requests | |
a8d01621 | 59 | Requests is a HTTP library, written in Python, for human beings. |
a0c91a8e KK |
60 | |
61 | Most existing Python modules for sending HTTP requests are extremely | |
62 | verbose and cumbersome. Python's builtin urllib2 module provides most | |
63 | of the HTTP capabilities you should need, but the api is thoroughly | |
64 | broken. It requires an enormous amount of work (even method overrides) | |
8d099eee JB |
65 | to perform the simplest of tasks. Things shouldn't be this way. Not in |
66 | Python. | |
67 | ||
68 | %description -n python3-requests -l pl.UTF-8 | |
a8d01621 | 69 | Requests to napisana w Pythonie biblioteka HTTP dla ludzi. |
a0c91a8e | 70 | |
a8d01621 ŁK |
71 | Większość istniejących modułów Pythona do wysyłania żądań HTTP jest |
72 | zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2 | |
73 | zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie - | |
74 | wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania | |
75 | najprostszych zadań. Nie powinno tak być. Nie w Pythonie. | |
a0c91a8e | 76 | |
8ba13116 | 77 | %prep |
a8d01621 | 78 | %setup -q -n %{module}-%{version} |
e16ab944 | 79 | |
8ba13116 | 80 | %build |
a8d01621 ŁK |
81 | %if %{with python2} |
82 | %{__python} setup.py build -b py2 | |
83 | %endif | |
a0c91a8e | 84 | |
a8d01621 ŁK |
85 | %if %{with python3} |
86 | %{__python3} setup.py build -b py3 | |
8d099eee | 87 | %endif |
8ba13116 MM |
88 | |
89 | %install | |
90 | rm -rf $RPM_BUILD_ROOT | |
a8d01621 ŁK |
91 | |
92 | %if %{with python2} | |
a0c91a8e | 93 | %{__python} setup.py \ |
a8d01621 ŁK |
94 | build -b py2 \ |
95 | install \ | |
8ba13116 MM |
96 | --skip-build \ |
97 | --optimize=2 \ | |
98 | --root=$RPM_BUILD_ROOT | |
a8d01621 ŁK |
99 | %py_ocomp $RPM_BUILD_ROOT%%{py_sitescriptdir} |
100 | %py_comp $RPM_BUILD_ROOT%%{py_sitescriptdir} | |
101 | %py_postclean | |
102 | %endif | |
8ba13116 | 103 | |
a8d01621 | 104 | %if %{with python3} |
a0c91a8e | 105 | %{__python3} setup.py \ |
a8d01621 ŁK |
106 | build -b py3 \ |
107 | install \ | |
108 | --skip-build \ | |
109 | --optimize=2 \ | |
110 | --root=$RPM_BUILD_ROOT | |
111 | %endif | |
8ba13116 MM |
112 | |
113 | %clean | |
114 | rm -rf $RPM_BUILD_ROOT | |
115 | ||
a8d01621 | 116 | %if %{with python2} |
8ba13116 MM |
117 | %files |
118 | %defattr(644,root,root,755) | |
a8d01621 | 119 | %doc HISTORY.rst README.rst |
8ba13116 | 120 | %{py_sitescriptdir}/%{module} |
a8d01621 | 121 | %if "%{py_ver}" > "2.4" |
8d099eee | 122 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
a8d01621 ŁK |
123 | %endif |
124 | %endif | |
a0c91a8e | 125 | |
a8d01621 | 126 | %if %{with python3} |
a0c91a8e KK |
127 | %files -n python3-requests |
128 | %defattr(644,root,root,755) | |
a8d01621 | 129 | %doc HISTORY.rst README.rst |
a0c91a8e | 130 | %{py3_sitescriptdir}/%{module} |
8d099eee | 131 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info |
a8d01621 | 132 | %endif |