]> git.pld-linux.org Git - packages/python-ndg-httpsclient.git/blame - python-ndg-httpsclient.spec
- rebuild with python 3.8
[packages/python-ndg-httpsclient.git] / python-ndg-httpsclient.spec
CommitLineData
7e4c0b75
AM
1#
2# Conditional build:
9624f30f 3%bcond_with tests # tests [require localhost networking]
a480d3fe
AM
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
7e4c0b75
AM
6
7%define module ndg-httpsclient
3b152d9f
JB
8Summary: Enhanced HTTPS support for httplib and urllib2 using PyOpenSSL
9Summary(pl.UTF-8): Rozszerzona obsługa HTTPS dla modułów httplib i urllib2 poprzez PyOpenSSL
7e4c0b75 10Name: python-%{module}
97d009fc 11Version: 0.4.2
ce83a7a3 12Release: 5
7e4c0b75
AM
13License: BSD
14Group: Libraries/Python
97d009fc
AM
15Source0: https://github.com/cedadev/ndg_httpsclient/archive/%{version}.tar.gz
16# Source0-md5: 08236101a72bb18f9f62c123d199420b
9624f30f 17Patch0: %{name}-tests.patch
7e4c0b75 18URL: http://ndg-security.ceda.ac.uk/wiki/ndg_httpsclient
a480d3fe 19%if %{with python2}
9624f30f 20BuildRequires: python-modules >= 1:2.6
7e4c0b75 21BuildRequires: python-pyOpenSSL
9624f30f 22BuildRequires: python-setuptools
a480d3fe
AM
23%endif
24%if %{with python3}
9624f30f 25BuildRequires: python3-modules >= 1:3.2
a480d3fe 26BuildRequires: python3-pyOpenSSL
9624f30f 27BuildRequires: python3-setuptools
a480d3fe 28%endif
7e4c0b75 29BuildRequires: rpm-pythonprov
9624f30f
JB
30BuildRequires: rpmbuild(macros) >= 1.714
31Requires: python-modules >= 1:2.6
7e4c0b75
AM
32Requires: python-pyOpenSSL
33Requires: python-pyasn1
34BuildArch: noarch
35BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37%description
38This is a HTTPS client implementation for httplib and urllib2 based on
39PyOpenSSL. PyOpenSSL provides a more fully featured SSL implementation
40over the default provided with Python and importantly enables full
41verification of the SSL peer.
42
3b152d9f
JB
43%description -l pl.UTF-8
44Ten moduł to implementacja klienta HTTPS dla modułów httplib i urllib2
45oparta na module PyOpenSSL. PyOpenSSL udostępnia pełniejszą
46implementację SSL niż domyślnie dostarczana z Pythonem i umożliwia
47pełną weryfikację drugiej strony połączenia SSL.
48
a480d3fe
AM
49%package -n python3-%{module}
50Summary: Enhanced HTTPS support for httplib and urllib2 using PyOpenSSL
51Summary(pl.UTF-8): Rozszerzona obsługa HTTPS dla modułów httplib i urllib2 poprzez PyOpenSSL
52Group: Libraries/Python
9624f30f 53Requires: python3-modules >= 1:3.2
a480d3fe
AM
54Requires: python3-pyOpenSSL
55Requires: python3-pyasn1
56
57%description -n python3-%{module}
58This is a HTTPS client implementation for httplib and urllib2 based on
59PyOpenSSL. PyOpenSSL provides a more fully featured SSL implementation
60over the default provided with Python and importantly enables full
61verification of the SSL peer.
62
63%description -n python3-%{module} -l pl.UTF-8
64Ten moduł to implementacja klienta HTTPS dla modułów httplib i urllib2
65oparta na module PyOpenSSL. PyOpenSSL udostępnia pełniejszą
66implementację SSL niż domyślnie dostarczana z Pythonem i umożliwia
67pełną weryfikację drugiej strony połączenia SSL.
68
7e4c0b75
AM
69%prep
70%setup -q -n ndg_httpsclient-%{version}
9624f30f 71%patch0 -p1
7e4c0b75
AM
72
73%build
a480d3fe 74%if %{with python2}
9624f30f
JB
75%py_build
76
77%if %{with tests}
78TOPDIR=$(pwd)
79cd ndg/httpsclient/test
80./scripts/openssl_https_server.sh &
81HTTPDPID=$!
82sleep 1
83trap "kill $HTTPDPID" ERR
84for test in test_*.py ; do
85PYTHONPATH=$TOPDIR/build-2/lib %{__python} $test
86done
87kill $HTTPDPID
88trap - ERR
89cd ../../..
90%endif
a480d3fe
AM
91%endif
92
93%if %{with python3}
9624f30f
JB
94%py3_build
95
96%if %{with tests}
97TOPDIR=$(pwd)
98cd ndg/httpsclient/test
99./scripts/openssl_https_server.sh &
100HTTPDPID=$!
101sleep 1
102trap "kill $HTTPDPID" ERR
103for test in test_*.py ; do
104PYTHONPATH=$TOPDIR/build-3/lib %{__python3} $test
105done
106kill $HTTPDPID
107trap - ERR
108cd ../../..
109%endif
a480d3fe 110%endif
7e4c0b75
AM
111
112%install
113rm -rf $RPM_BUILD_ROOT
114
a480d3fe 115%if %{with python2}
d200588e 116%py_install
7e4c0b75
AM
117
118%py_postclean
9624f30f 119%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/ndg/httpsclient/test
a480d3fe
AM
120%endif
121
122%if %{with python3}
123%py3_install
9624f30f
JB
124
125%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/ndg/httpsclient/test
a480d3fe 126%endif
7e4c0b75
AM
127
128%clean
129rm -rf $RPM_BUILD_ROOT
130
a480d3fe 131%if %{with python2}
7e4c0b75
AM
132%files
133%defattr(644,root,root,755)
9624f30f 134%doc README.md ndg/httpsclient/LICENSE
7e4c0b75
AM
135%{py_sitescriptdir}/ndg
136%if "%{py_ver}" > "2.4"
137%{py_sitescriptdir}/ndg_httpsclient-%{version}-py*.egg-info
df64dd2a 138%{py_sitescriptdir}/ndg_httpsclient-%{version}-py*-nspkg.pth
7e4c0b75 139%endif
a480d3fe
AM
140%endif
141
142%if %{with python3}
143%files -n python3-%{module}
144%defattr(644,root,root,755)
9624f30f 145%doc README.md ndg/httpsclient/LICENSE
80b32fe5 146%attr(755,root,root) %{_bindir}/ndg_httpclient
a480d3fe
AM
147%{py3_sitescriptdir}/ndg
148%{py3_sitescriptdir}/ndg_httpsclient-%{version}-py*.egg-info
149%{py3_sitescriptdir}/ndg_httpsclient-%{version}-py*-nspkg.pth
150%endif
This page took 0.093531 seconds and 4 git commands to generate.