3 %bcond_with tests # tests [require localhost networking]
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 %define module ndg-httpsclient
8 Summary: Enhanced HTTPS support for httplib and urllib2 using PyOpenSSL
9 Summary(pl.UTF-8): Rozszerzona obsługa HTTPS dla modułów httplib i urllib2 poprzez PyOpenSSL
10 Name: python-%{module}
14 Group: Libraries/Python
15 Source0: https://github.com/cedadev/ndg_httpsclient/archive/%{version}.tar.gz
16 # Source0-md5: 08236101a72bb18f9f62c123d199420b
17 Patch0: %{name}-tests.patch
18 URL: http://ndg-security.ceda.ac.uk/wiki/ndg_httpsclient
20 BuildRequires: python-modules >= 1:2.6
21 BuildRequires: python-pyOpenSSL
22 BuildRequires: python-setuptools
25 BuildRequires: python3-modules >= 1:3.2
26 BuildRequires: python3-pyOpenSSL
27 BuildRequires: python3-setuptools
29 BuildRequires: rpm-pythonprov
30 BuildRequires: rpmbuild(macros) >= 1.714
31 Requires: python-modules >= 1:2.6
32 Requires: python-pyOpenSSL
33 Requires: python-pyasn1
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 This is a HTTPS client implementation for httplib and urllib2 based on
39 PyOpenSSL. PyOpenSSL provides a more fully featured SSL implementation
40 over the default provided with Python and importantly enables full
41 verification of the SSL peer.
43 %description -l pl.UTF-8
44 Ten moduł to implementacja klienta HTTPS dla modułów httplib i urllib2
45 oparta na module PyOpenSSL. PyOpenSSL udostępnia pełniejszą
46 implementację SSL niż domyślnie dostarczana z Pythonem i umożliwia
47 pełną weryfikację drugiej strony połączenia SSL.
49 %package -n python3-%{module}
50 Summary: Enhanced HTTPS support for httplib and urllib2 using PyOpenSSL
51 Summary(pl.UTF-8): Rozszerzona obsługa HTTPS dla modułów httplib i urllib2 poprzez PyOpenSSL
52 Group: Libraries/Python
53 Requires: python3-modules >= 1:3.2
54 Requires: python3-pyOpenSSL
55 Requires: python3-pyasn1
57 %description -n python3-%{module}
58 This is a HTTPS client implementation for httplib and urllib2 based on
59 PyOpenSSL. PyOpenSSL provides a more fully featured SSL implementation
60 over the default provided with Python and importantly enables full
61 verification of the SSL peer.
63 %description -n python3-%{module} -l pl.UTF-8
64 Ten moduł to implementacja klienta HTTPS dla modułów httplib i urllib2
65 oparta na module PyOpenSSL. PyOpenSSL udostępnia pełniejszą
66 implementację SSL niż domyślnie dostarczana z Pythonem i umożliwia
67 pełną weryfikację drugiej strony połączenia SSL.
70 %setup -q -n ndg_httpsclient-%{version}
79 cd ndg/httpsclient/test
80 ./scripts/openssl_https_server.sh &
83 trap "kill $HTTPDPID" ERR
84 for test in test_*.py ; do
85 PYTHONPATH=$TOPDIR/build-2/lib %{__python} $test
98 cd ndg/httpsclient/test
99 ./scripts/openssl_https_server.sh &
102 trap "kill $HTTPDPID" ERR
103 for test in test_*.py ; do
104 PYTHONPATH=$TOPDIR/build-3/lib %{__python3} $test
113 rm -rf $RPM_BUILD_ROOT
119 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/ndg/httpsclient/test
125 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/ndg/httpsclient/test
129 rm -rf $RPM_BUILD_ROOT
133 %defattr(644,root,root,755)
134 %doc README.md ndg/httpsclient/LICENSE
135 %{py_sitescriptdir}/ndg
136 %if "%{py_ver}" > "2.4"
137 %{py_sitescriptdir}/ndg_httpsclient-%{version}-py*.egg-info
138 %{py_sitescriptdir}/ndg_httpsclient-%{version}-py*-nspkg.pth
143 %files -n python3-%{module}
144 %defattr(644,root,root,755)
145 %doc README.md ndg/httpsclient/LICENSE
146 %attr(755,root,root) %{_bindir}/ndg_httpclient
147 %{py3_sitescriptdir}/ndg
148 %{py3_sitescriptdir}/ndg_httpsclient-%{version}-py*.egg-info
149 %{py3_sitescriptdir}/ndg_httpsclient-%{version}-py*-nspkg.pth