]> git.pld-linux.org Git - packages/python-requests.git/blame - python-requests.spec
- rel 2; python2 module requires some externals to get better SSL support (SNI for...
[packages/python-requests.git] / python-requests.spec
CommitLineData
ef9212ce 1#
8d099eee 2# Conditional build:
ef9212ce
JB
3%bcond_without python2 # CPython 2.x module
4%bcond_without python3 # CPython 3.x module
8d099eee 5#
8ba13116 6%define module requests
ef9212ce
JB
7Summary: HTTP library for Python 2
8Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 2
8ba13116 9Name: python-%{module}
6b8cdf9f 10Version: 2.4.3
e7d50ac0 11Release: 2
a8d01621 12License: Apache2
8ba13116 13Group: Development/Languages/Python
a8d01621 14Source0: https://pypi.python.org/packages/source/r/requests/%{module}-%{version}.tar.gz
6b8cdf9f 15# Source0-md5: 02214b3a179e445545de4b7a98d3dd17
a8d01621 16URL: http://python-requests.org
6b8cdf9f
AM
17# find . -name '*.py' -exec sed -i -e 's#\.packages\.urllib3#urllib3#g' "{}" ";"
18# find . -name '*.py' -exec sed -i -e 's#from \.packages import chardet#import charade as chardet#g' "{}" ";"
19# + manual removal from setup.py
4a7ef446
ŁK
20Patch0: system-charade-and-urllib3.patch
21Patch1: system-cert.patch
a8d01621 22%if %{with python2}
4a7ef446 23BuildRequires: python-charade
a8d01621 24BuildRequires: python-modules >= 1:2.6
9e57f9c2 25BuildRequires: python-urllib3 >= 1.9.1
a8d01621
ŁK
26%endif
27%if %{with python3}
4a7ef446 28BuildRequires: python3-charade
ef9212ce 29BuildRequires: python3-modules >= 1:3.2
9e57f9c2 30BuildRequires: python3-urllib3 >= 1.9.1
a8d01621 31%endif
8ba13116
MM
32BuildRequires: rpm-pythonprov
33BuildRequires: rpmbuild(macros) >= 1.219
4a7ef446
ŁK
34Requires: ca-certificates
35Requires: python-charade
a8d01621 36Requires: python-modules >= 1:2.6
9e57f9c2 37Requires: python-urllib3 >= 1.9.1
e7d50ac0
AM
38# for python2 only to get SNI working. python3 doesn't need this
39Requires: python-ndg-httpsclient
40Requires: python-pyasn1
41Requires: python-pyOpenSSL
8ba13116
MM
42BuildArch: noarch
43BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45%description
a8d01621 46Requests is a HTTP library, written in Python, for human beings.
8ba13116
MM
47
48Most existing Python modules for sending HTTP requests are extremely
49verbose and cumbersome. Python's builtin urllib2 module provides most
8d099eee 50of the HTTP capabilities you should need, but the API is thoroughly
8ba13116 51broken. It requires an enormous amount of work (even method overrides)
8d099eee
JB
52to perform the simplest of tasks. Things shouldn't be this way. Not in
53Python.
54
ef9212ce
JB
55This package contains Python 2.x module.
56
8d099eee 57%description -l pl.UTF-8
a8d01621 58Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
8ba13116 59
8d099eee
JB
60Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
61zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
62zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
63wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
64najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
8ba13116 65
ef9212ce
JB
66Ten pakiet zawiera moduł dla Pythona 2.x.
67
a0c91a8e 68%package -n python3-requests
ef9212ce
JB
69Summary: HTTP library for Python 3
70Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 3
a0c91a8e 71Group: Development/Languages/Python
4a7ef446
ŁK
72Requires: ca-certificates
73Requires: python3-charade
ef9212ce 74Requires: python3-modules >= 1:3.2
9e57f9c2 75Requires: python3-urllib3 >= 1.9.1
a0c91a8e
KK
76
77%description -n python3-requests
a8d01621 78Requests is a HTTP library, written in Python, for human beings.
a0c91a8e
KK
79
80Most existing Python modules for sending HTTP requests are extremely
81verbose and cumbersome. Python's builtin urllib2 module provides most
82of the HTTP capabilities you should need, but the api is thoroughly
83broken. It requires an enormous amount of work (even method overrides)
8d099eee
JB
84to perform the simplest of tasks. Things shouldn't be this way. Not in
85Python.
86
ef9212ce
JB
87This package contains Python 3.x module.
88
8d099eee 89%description -n python3-requests -l pl.UTF-8
a8d01621 90Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
a0c91a8e 91
a8d01621
ŁK
92Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
93zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
94zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
95wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
96najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
a0c91a8e 97
ef9212ce
JB
98Ten pakiet zawiera moduł dla Pythona 3.x.
99
8ba13116 100%prep
a8d01621 101%setup -q -n %{module}-%{version}
23ad999c 102%patch0 -p1
4a7ef446 103%patch1 -p1
e16ab944 104
8ba13116 105%build
a8d01621
ŁK
106%if %{with python2}
107%{__python} setup.py build -b py2
108%endif
a0c91a8e 109
a8d01621
ŁK
110%if %{with python3}
111%{__python3} setup.py build -b py3
8d099eee 112%endif
8ba13116
MM
113
114%install
115rm -rf $RPM_BUILD_ROOT
a8d01621
ŁK
116
117%if %{with python2}
a0c91a8e 118%{__python} setup.py \
a8d01621
ŁK
119 build -b py2 \
120 install \
8ba13116
MM
121 --skip-build \
122 --optimize=2 \
123 --root=$RPM_BUILD_ROOT
4a7ef446
ŁK
124%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
125%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
a8d01621
ŁK
126%py_postclean
127%endif
8ba13116 128
a8d01621 129%if %{with python3}
a0c91a8e 130%{__python3} setup.py \
a8d01621
ŁK
131 build -b py3 \
132 install \
133 --skip-build \
134 --optimize=2 \
135 --root=$RPM_BUILD_ROOT
136%endif
8ba13116 137
4a7ef446
ŁK
138%{__rm} -rf $RPM_BUILD_ROOT{%{py_sitescriptdir},%{py3_sitescriptdir}}/%{module}/{cacert.pem,packages}
139
8ba13116
MM
140%clean
141rm -rf $RPM_BUILD_ROOT
142
a8d01621 143%if %{with python2}
8ba13116
MM
144%files
145%defattr(644,root,root,755)
a8d01621 146%doc HISTORY.rst README.rst
8ba13116 147%{py_sitescriptdir}/%{module}
8d099eee 148%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
a8d01621 149%endif
a0c91a8e 150
a8d01621 151%if %{with python3}
a0c91a8e
KK
152%files -n python3-requests
153%defattr(644,root,root,755)
a8d01621 154%doc HISTORY.rst README.rst
a0c91a8e 155%{py3_sitescriptdir}/%{module}
8d099eee 156%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
a8d01621 157%endif
This page took 1.387965 seconds and 4 git commands to generate.