]>
Commit | Line | Data |
---|---|---|
e16ab944 ER |
1 | # TODO |
2 | # - bundled external libs? packages/ contains: | |
3 | # chardet/ | |
4 | # chardet2/ | |
5 | # oauthlib/ | |
8ba13116 MM |
6 | %define module requests |
7 | Summary: HTTP library for Python | |
8 | Name: python-%{module} | |
9 | Version: 0.13.3 | |
e16ab944 | 10 | Release: 1 |
8ba13116 MM |
11 | License: ISC |
12 | Group: Development/Languages/Python | |
613e36fa KK |
13 | Source0: https://github.com/kennethreitz/requests/tarball/v%{version}-11-g52b55cc/%{name}-%{version}.tgz |
14 | # Source0-md5: d4e0de0ecfc14128c3a878d9f82328a0 | |
8ba13116 MM |
15 | URL: https://github.com/kennethreitz/requests |
16 | BuildRequires: rpm-pythonprov | |
17 | BuildRequires: rpmbuild(macros) >= 1.219 | |
e16ab944 | 18 | BuildRequires: sed >= 4.0 |
8ba13116 MM |
19 | Requires: python-modules |
20 | BuildArch: noarch | |
21 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
22 | ||
23 | %description | |
24 | Requests is an ISC Licensed HTTP library, written in Python, for human | |
25 | beings. | |
26 | ||
27 | Most existing Python modules for sending HTTP requests are extremely | |
28 | verbose and cumbersome. Python's builtin urllib2 module provides most | |
29 | of the HTTP capabilities you should need, but the api is thoroughly | |
30 | broken. It requires an enormous amount of work (even method overrides) | |
31 | to perform the simplest of tasks. | |
32 | ||
33 | Things shouldn't be this way. Not in Python. | |
34 | ||
35 | %prep | |
36 | %setup -qc | |
37 | mv *-%{module}-*/* . | |
38 | ||
e16ab944 ER |
39 | # fix version in module |
40 | # tarball for 0.13.3 contains 0.13.2: | |
41 | #./HISTORY.rst:0.13.2 (2012-06-28) | |
42 | #./requests/__init__.py:__version__ = '0.13.2' | |
43 | #./requests/__init__.py:__build__ = 0x001302 | |
44 | %{__sed} -i -e 's/0\.13\.2/0.13.3/; s/0x001302/0x001302/' requests/__init__.py | |
45 | ||
8ba13116 | 46 | %build |
e16ab944 ER |
47 | ver=$(%{__python} -c "import requests; print requests.__version__") |
48 | test "$ver" = %{version} | |
8ba13116 MM |
49 | |
50 | %{__python} setup.py build | |
51 | ||
52 | %install | |
53 | rm -rf $RPM_BUILD_ROOT | |
54 | %{__python} setup.py install \ | |
55 | --skip-build \ | |
56 | --optimize=2 \ | |
57 | --root=$RPM_BUILD_ROOT | |
58 | ||
59 | %py_postclean | |
60 | ||
61 | %clean | |
62 | rm -rf $RPM_BUILD_ROOT | |
63 | ||
64 | %files | |
65 | %defattr(644,root,root,755) | |
66 | %doc AUTHORS.rst README.rst LICENSE docs | |
67 | %{py_sitescriptdir}/%{module} | |
68 | %if "%{py_ver}" > "2.4" | |
e16ab944 | 69 | %{py_sitescriptdir}/%{module}-*.egg-info |
8ba13116 | 70 | %endif |