]> git.pld-linux.org Git - packages/python-httplib2.git/blob - python-httplib2.spec
- updated to 0.18.1 (CRLF injection fix)
[packages/python-httplib2.git] / python-httplib2.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # Python 2.x module
4 %bcond_without  python3 # Python 3.x module
5 %bcond_without  doc     # Sphinx documentation
6 %bcond_without  tests   # unit tests
7
8 Summary:        A comprehensive HTTP client library
9 Summary(pl.UTF-8):      Obszerna biblioteka klienta HTTP
10 Name:           python-httplib2
11 Version:        0.18.1
12 Release:        1
13 License:        MIT
14 Group:          Development/Languages/Python
15 #Source0Download: https://github.com/httplib2/httplib2/releases
16 Source0:        https://github.com/httplib2/httplib2/archive/v%{version}/httplib2-%{version}.tar.gz
17 # Source0-md5:  883f17828619757836ff510c42a7cca8
18 Patch0:         %{name}.certfile.patch
19 Patch1:         %{name}-0.9-proxy-http.patch
20 Patch2:         %{name}-mock.patch
21 URL:            https://github.com/httplib2/httplib2
22 %if %{with python2}
23 BuildRequires:  python-modules >= 1:2.7
24 BuildRequires:  python-setuptools
25 %if %{with tests}
26 BuildRequires:  python-future >= 0.16.0
27 BuildRequires:  python-mock >= 2.0.0
28 BuildRequires:  python-pytest >= 3.2.1
29 BuildRequires:  python-pytest-cov >= 2.5.1
30 BuildRequires:  python-pytest-timeout >= 1.2.0
31 BuildRequires:  python-six >= 1.10.0
32 %endif
33 %endif
34 %if %{with python3}
35 BuildRequires:  python3-modules >= 1:3.4
36 BuildRequires:  python3-setuptools
37 %if %{with tests}
38 BuildRequires:  python3-pytest >= 3.2.1
39 BuildRequires:  python3-pytest-cov >= 2.5.1
40 BuildRequires:  python3-pytest-timeout >= 1.2.0
41 BuildRequires:  python3-six >= 1.10.0
42 %endif
43 %endif
44 BuildRequires:  rpm-pythonprov
45 BuildRequires:  rpmbuild(macros) >= 1.710
46 %if %{with doc}
47 BuildRequires:  sphinx-pdg
48 %endif
49 Requires:       ca-certificates
50 BuildArch:      noarch
51 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53 %description
54 A comprehensive HTTP client library, httplib2.py supports many
55 features left out of other HTTP libraries. Supports:
56 - HTTP and HTTPS
57 - Keep-Alive
58 - Authentication
59 - Caching
60 - All Methods
61 - Redirects
62 - Compression
63 - Lost update support
64 - Unit Tested
65
66 %description -l pl.UTF-8
67 httplib2.py to obszerna biblioteka klienta HTTP, obsługująca wiele
68 cech pomijanych przez inne biblioteki. Obsługuje:
69 - HTTP i HTTPS
70 - Keep-Alive
71 - uwierzytelnianie
72 - buforowanie
73 - wszystkie metody
74 - przekierowania
75 - kompresję
76 - Lost update
77 - podlega testom jednostkowym.
78
79 %package -n python3-httplib2
80 Summary:        A comprehensive HTTP client library
81 Summary(pl.UTF-8):      Obszerna biblioteka klienta HTTP
82 Group:          Development/Languages/Python
83 Requires:       ca-certificates
84
85 %description -n python3-httplib2
86 A comprehensive HTTP client library, httplib2.py supports many
87 features left out of other HTTP libraries. Supports:
88 - HTTP and HTTPS
89 - Keep-Alive
90 - Authentication
91 - Caching
92 - All Methods
93 - Redirects
94 - Compression
95 - Lost update support
96 - Unit Tested
97
98 %description -n python3-httplib2 -l pl.UTF-8
99 httplib2.py to obszerna biblioteka klienta HTTP, obsługująca wiele
100 cech pomijanych przez inne biblioteki. Obsługuje:
101 - HTTP i HTTPS
102 - Keep-Alive
103 - uwierzytelnianie
104 - buforowanie
105 - wszystkie metody
106 - przekierowania
107 - kompresję
108 - Lost update
109 - podlega testom jednostkowym.
110
111 %prep
112 %setup -q -n httplib2-%{version}
113 %patch0 -p1
114 %patch1 -p1
115 %patch2 -p1
116
117 %build
118 %if %{with python2}
119 %py_build
120
121 %if %{with tests}
122 PYTHONPATH=$(pwd)/build-2/lib \
123 %{__python} -m pytest tests -k 'not test_certs_file_from_builtin and not test_certs_file_from_environment and not test_with_certifi_removed_from_modules and not test_noproxy_star'
124 %endif
125 %endif
126
127 %if %{with python3}
128 %py3_build
129
130 %if %{with tests}
131 # in python3 implementation system socks module is preferred over httplib2.socks, and the first is incompatible with test_socks5_auth
132 PYTHONPATH=$(pwd)/build-3/lib \
133 %{__python3} -m pytest tests -k 'not test_certs_file_from_builtin and not test_certs_file_from_environment and not test_with_certifi_removed_from_modules and not test_noproxy_star and not test_server_not_found_error_is_raised_for_invalid_hostname and not test_socks5_auth'
134 %endif
135 %endif
136
137 %if %{with doc}
138 %{__make} -C doc html
139 %endif
140
141 %install
142 rm -rf $RPM_BUILD_ROOT
143
144 %if %{with python2}
145 %py_install
146
147 %py_postclean
148 %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/httplib2/cacerts.txt
149 %endif
150
151 %if %{with python3}
152 %py3_install
153
154 %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/httplib2/cacerts.txt
155 %endif
156
157 %clean
158 rm -rf $RPM_BUILD_ROOT
159
160 %if %{with python2}
161 %files
162 %defattr(644,root,root,755)
163 %doc CHANGELOG LICENSE README.md
164 %{py_sitescriptdir}/httplib2
165 %{py_sitescriptdir}/httplib2-%{version}-py*.egg-info
166 %endif
167
168 %if %{with python3}
169 %files -n python3-httplib2
170 %defattr(644,root,root,755)
171 %doc CHANGELOG LICENSE README.md python3/README
172 %{py3_sitescriptdir}/httplib2
173 %{py3_sitescriptdir}/httplib2-%{version}-py*.egg-info
174 %endif
This page took 1.026824 seconds and 3 git commands to generate.