]> git.pld-linux.org Git - packages/python-ndg-httpsclient.git/blob - python-ndg-httpsclient.spec
rebuild with tests and docs
[packages/python-ndg-httpsclient.git] / python-ndg-httpsclient.spec
1 #
2 # Conditional build:
3 %bcond_with     tests   # tests [require localhost networking]
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
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}
11 Version:        0.4.2
12 Release:        9
13 License:        BSD
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
19 %if %{with python2}
20 BuildRequires:  python-modules >= 1:2.6
21 BuildRequires:  python-pyOpenSSL
22 BuildRequires:  python-setuptools
23 %endif
24 %if %{with python3}
25 BuildRequires:  python3-modules >= 1:3.2
26 BuildRequires:  python3-pyOpenSSL
27 BuildRequires:  python3-setuptools
28 %endif
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
34 BuildArch:      noarch
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %description
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.
42
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.
48
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
56
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.
62
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.
68
69 %prep
70 %setup -q -n ndg_httpsclient-%{version}
71 %patch0 -p1
72
73 %build
74 %if %{with python2}
75 %py_build
76
77 %if %{with tests}
78 TOPDIR=$(pwd)
79 cd ndg/httpsclient/test
80 ./scripts/openssl_https_server.sh &
81 HTTPDPID=$!
82 sleep 1
83 trap "kill $HTTPDPID" ERR
84 for test in test_*.py ; do
85 PYTHONPATH=$TOPDIR/build-2/lib %{__python} $test
86 done
87 kill $HTTPDPID
88 trap - ERR
89 cd ../../..
90 %endif
91 %endif
92
93 %if %{with python3}
94 %py3_build
95
96 %if %{with tests}
97 TOPDIR=$(pwd)
98 cd ndg/httpsclient/test
99 ./scripts/openssl_https_server.sh &
100 HTTPDPID=$!
101 sleep 1
102 trap "kill $HTTPDPID" ERR
103 for test in test_*.py ; do
104 PYTHONPATH=$TOPDIR/build-3/lib %{__python3} $test
105 done
106 kill $HTTPDPID
107 trap - ERR
108 cd ../../..
109 %endif
110 %endif
111
112 %install
113 rm -rf $RPM_BUILD_ROOT
114
115 %if %{with python2}
116 %py_install
117
118 %py_postclean
119 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/ndg/httpsclient/test
120 %endif
121
122 %if %{with python3}
123 %py3_install
124
125 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/ndg/httpsclient/test
126 %endif
127
128 %clean
129 rm -rf $RPM_BUILD_ROOT
130
131 %if %{with python2}
132 %files
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
139 %endif
140 %endif
141
142 %if %{with python3}
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
150 %endif
This page took 0.03853 seconds and 3 git commands to generate.