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