]> git.pld-linux.org Git - packages/python3-requests.git/blame - python-requests.spec
build python3 module
[packages/python3-requests.git] / python-requests.spec
CommitLineData
e16ab944
ER
1# TODO
2# - bundled external libs? packages/ contains:
3# chardet/
4# chardet2/
5# oauthlib/
8ba13116
MM
6%define module requests
7Summary: HTTP library for Python
8Name: python-%{module}
9Version: 0.13.3
a0c91a8e 10Release: 2
8ba13116
MM
11License: ISC
12Group: Development/Languages/Python
613e36fa
KK
13Source0: https://github.com/kennethreitz/requests/tarball/v%{version}-11-g52b55cc/%{name}-%{version}.tgz
14# Source0-md5: d4e0de0ecfc14128c3a878d9f82328a0
8ba13116
MM
15URL: https://github.com/kennethreitz/requests
16BuildRequires: rpm-pythonprov
17BuildRequires: rpmbuild(macros) >= 1.219
e16ab944 18BuildRequires: sed >= 4.0
8ba13116
MM
19Requires: python-modules
20BuildArch: noarch
21BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22
23%description
24Requests is an ISC Licensed HTTP library, written in Python, for human
25beings.
26
27Most existing Python modules for sending HTTP requests are extremely
28verbose and cumbersome. Python's builtin urllib2 module provides most
29of the HTTP capabilities you should need, but the api is thoroughly
30broken. It requires an enormous amount of work (even method overrides)
31to perform the simplest of tasks.
32
33Things shouldn't be this way. Not in Python.
34
a0c91a8e
KK
35%package -n python3-requests
36Summary: HTTP library, written in Python, for human beings
37License: ISC
38Group: Development/Languages/Python
39
40%description -n python3-requests
41Requests is an ISC Licensed HTTP library, written in Python, for human
42beings.
43
44Most existing Python modules for sending HTTP requests are extremely
45verbose and cumbersome. Python's builtin urllib2 module provides most
46of the HTTP capabilities you should need, but the api is thoroughly
47broken. It requires an enormous amount of work (even method overrides)
48to perform the simplest of tasks.
49
50Things shouldn't be this way. Not in Python.
51
8ba13116
MM
52%prep
53%setup -qc
54mv *-%{module}-*/* .
55
e16ab944
ER
56# fix version in module
57# tarball for 0.13.3 contains 0.13.2:
58#./HISTORY.rst:0.13.2 (2012-06-28)
59#./requests/__init__.py:__version__ = '0.13.2'
60#./requests/__init__.py:__build__ = 0x001302
61%{__sed} -i -e 's/0\.13\.2/0.13.3/; s/0x001302/0x001302/' requests/__init__.py
62
8ba13116 63%build
e16ab944
ER
64ver=$(%{__python} -c "import requests; print requests.__version__")
65test "$ver" = %{version}
8ba13116 66
a0c91a8e
KK
67mkdir py2-egg py3-egg
68%{__python} setup.py build --build-base py2 egg_info --egg-base py2-egg
69%{__python3} setup.py build --build-base py3 egg_info --egg-base py3-egg
70
8ba13116
MM
71
72%install
73rm -rf $RPM_BUILD_ROOT
a0c91a8e
KK
74%{__python} setup.py \
75 build --build-base py2 \
76 egg_info --egg-base py2-egg \
77 install \
8ba13116
MM
78 --skip-build \
79 --optimize=2 \
80 --root=$RPM_BUILD_ROOT
81
a0c91a8e
KK
82%{__python3} setup.py \
83 build --build-base py3 \
84 egg_info --egg-base py3-egg \
85 install \
86 --skip-build \
87 --optimize=2 \
88 --root=$RPM_BUILD_ROOT
89
90
8ba13116
MM
91%py_postclean
92
93%clean
94rm -rf $RPM_BUILD_ROOT
95
96%files
97%defattr(644,root,root,755)
98%doc AUTHORS.rst README.rst LICENSE docs
99%{py_sitescriptdir}/%{module}
100%if "%{py_ver}" > "2.4"
e16ab944 101%{py_sitescriptdir}/%{module}-*.egg-info
8ba13116 102%endif
a0c91a8e
KK
103
104%files -n python3-requests
105%defattr(644,root,root,755)
106%{py3_sitescriptdir}/%{module}
107%{py3_sitescriptdir}/%{module}-*.egg-info
This page took 0.044797 seconds and 4 git commands to generate.