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