]>
Commit | Line | Data |
---|---|---|
e16ab944 ER |
1 | # TODO |
2 | # - bundled external libs? packages/ contains: | |
3 | # chardet/ | |
4 | # chardet2/ | |
5 | # oauthlib/ | |
8d099eee JB |
6 | # |
7 | # Conditional build: | |
8 | %bcond_without doc # HTML documentation build | |
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} |
e36cf5c1 MK |
14 | Version: 1.1.0 |
15 | Release: 0.1 | |
8ba13116 MM |
16 | License: ISC |
17 | Group: Development/Languages/Python | |
54a43380 | 18 | Source0: https://github.com/kennethreitz/requests/tarball/v%{version}/%{module}-%{version}.tar.gz |
e36cf5c1 | 19 | # Source0-md5: 89b4958831c4c3276ffe5d21ed53dec8 |
8ba13116 | 20 | URL: https://github.com/kennethreitz/requests |
8d099eee JB |
21 | BuildRequires: python >= 1:2.6 |
22 | BuildRequires: python3 >= 3.2 | |
8ba13116 MM |
23 | BuildRequires: rpm-pythonprov |
24 | BuildRequires: rpmbuild(macros) >= 1.219 | |
e16ab944 | 25 | BuildRequires: sed >= 4.0 |
8d099eee | 26 | %{?with_doc:BuildRequires: sphinx-pdg >= 1.0} |
8ba13116 MM |
27 | Requires: python-modules |
28 | BuildArch: noarch | |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | Requests is an ISC Licensed HTTP library, written in Python, for human | |
33 | beings. | |
34 | ||
35 | Most existing Python modules for sending HTTP requests are extremely | |
36 | verbose and cumbersome. Python's builtin urllib2 module provides most | |
8d099eee | 37 | of the HTTP capabilities you should need, but the API is thoroughly |
8ba13116 | 38 | broken. It requires an enormous amount of work (even method overrides) |
8d099eee JB |
39 | to perform the simplest of tasks. Things shouldn't be this way. Not in |
40 | Python. | |
41 | ||
42 | %description -l pl.UTF-8 | |
43 | Requests to napisana w Pythonie biblioteka HTTP dla ludzi, wydana na | |
44 | licencji ISC. | |
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 KK |
55 | Group: Development/Languages/Python |
56 | ||
57 | %description -n python3-requests | |
58 | Requests is an ISC Licensed HTTP library, written in Python, for human | |
59 | beings. | |
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 | |
69 | Requests is an ISC Licensed HTTP library, written in Python, for human | |
70 | beings. | |
a0c91a8e | 71 | |
8d099eee JB |
72 | Most existing Python modules for sending HTTP requests are extremely |
73 | verbose and cumbersome. Python's builtin urllib2 module provides most | |
74 | of the HTTP capabilities you should need, but the API is thoroughly | |
75 | broken. It requires an enormous amount of work (even method overrides) | |
76 | to perform the simplest of tasks. Things shouldn't be this way. Not in | |
77 | Python. | |
a0c91a8e | 78 | |
8ba13116 | 79 | %prep |
e36cf5c1 MK |
80 | # kennethreitz-requests-1a7c91f |
81 | %setup -q -n kennethreitz-%{module}-1a7c91f | |
8ba13116 | 82 | |
8d099eee JB |
83 | # avoid "distutils.errors.DistutilsByteCompileError: byte-compiling is disabled." |
84 | %{__sed} -i -e '/PYTHONDONTWRITEBYTECODE/d' setup.py | |
e16ab944 | 85 | |
8ba13116 | 86 | %build |
e16ab944 ER |
87 | ver=$(%{__python} -c "import requests; print requests.__version__") |
88 | test "$ver" = %{version} | |
8ba13116 | 89 | |
a0c91a8e | 90 | mkdir py2-egg py3-egg |
54a43380 JR |
91 | %{__python} setup.py build --build-base py2 |
92 | %{__python3} setup.py build --build-base py3 | |
a0c91a8e | 93 | |
8d099eee JB |
94 | %if %{with doc} |
95 | %{__make} -C docs html | |
96 | %endif | |
8ba13116 MM |
97 | |
98 | %install | |
99 | rm -rf $RPM_BUILD_ROOT | |
a0c91a8e KK |
100 | %{__python} setup.py \ |
101 | build --build-base py2 \ | |
a0c91a8e | 102 | install \ |
8ba13116 MM |
103 | --skip-build \ |
104 | --optimize=2 \ | |
105 | --root=$RPM_BUILD_ROOT | |
106 | ||
a0c91a8e KK |
107 | %{__python3} setup.py \ |
108 | build --build-base py3 \ | |
a0c91a8e KK |
109 | install \ |
110 | --skip-build \ | |
111 | --optimize=2 \ | |
112 | --root=$RPM_BUILD_ROOT | |
113 | ||
8ba13116 MM |
114 | %py_postclean |
115 | ||
116 | %clean | |
117 | rm -rf $RPM_BUILD_ROOT | |
118 | ||
119 | %files | |
120 | %defattr(644,root,root,755) | |
8d099eee | 121 | %doc AUTHORS.rst LICENSE README.rst %{?with_doc:docs/_build/html} |
8ba13116 | 122 | %{py_sitescriptdir}/%{module} |
8d099eee | 123 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
a0c91a8e KK |
124 | |
125 | %files -n python3-requests | |
126 | %defattr(644,root,root,755) | |
8d099eee | 127 | %doc AUTHORS.rst LICENSE README.rst %{?with_doc:docs/_build/html} |
a0c91a8e | 128 | %{py3_sitescriptdir}/%{module} |
8d099eee | 129 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info |