1 # TODO: check why disabled tests fail and reenable them
4 %bcond_without tests # unit tests
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
7 %bcond_without doc # HTML documentation (sphinx-based)
9 %define module pyOpenSSL
10 Summary: Python 2 interface to the OpenSSL library
11 Summary(pl.UTF-8): Interfejs Pythona 2 do biblioteki OpenSSL
12 Name: python-%{module}
13 # keep 21.x here for python2 support
17 Group: Libraries/Python
18 #Source0Download: https://pypi.org/simple/pyopenssl/
19 Source0: https://files.pythonhosted.org/packages/source/p/pyOpenSSL/%{module}-%{version}.tar.gz
20 # Source0-md5: 2ec707d15b4e92f5ca5e46e5aab2f4ca
21 URL: https://github.com/pyca/pyopenssl
22 %if %(locale -a | grep -q '^C\.utf8$'; echo $?)
23 BuildRequires: glibc-localedb-all
25 BuildRequires: rpm-pythonprov
26 BuildRequires: rpmbuild(macros) >= 1.710
28 BuildRequires: python-devel >= 1:2.7
29 BuildRequires: python-setuptools
31 BuildRequires: python-cryptography >= 2.8
32 BuildRequires: python-flaky
33 BuildRequires: python-pretend
34 BuildRequires: python-pytest >= 3.0.1
35 BuildRequires: python-six >= 1.5.2
39 BuildRequires: python3-devel >= 1:3.4
40 BuildRequires: python3-setuptools
42 BuildRequires: python3-cryptography >= 2.8
43 BuildRequires: python3-flaky
44 BuildRequires: python3-pretend
45 BuildRequires: python3-pytest >= 3.0.1
46 BuildRequires: python3-six >= 1.5.2
50 BuildRequires: python3-sphinx_rtd_theme
51 BuildRequires: sphinx-pdg-3
53 Obsoletes: python-OpenSSL < 0.6
54 Obsoletes: python-pyOpenSSL-examples < 19.1.0
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 High-level wrapper around a subset of the OpenSSL library, includes:
60 - SSL.Connection objects, wrapping the methods of Python's portable
62 - Callbacks written in Python
63 - Extensive error-handling mechanism, mirroring OpenSSL's error codes
66 This package contains Python 2 modules.
68 %description -l pl.UTF-8
69 Wysokopoziomowe obudowanie podzbioru biblioteki OpenSSL, zawierające:
70 - obiekty SSL.Connection, obudowujący metody przenośnych gniazd
72 - wywołania zwrotne napisane w Pythonie
73 - obszerny mechanizm obsługi błędów odzwierciedlający kody błędów
77 Ten pakiet zawiera moduły Pythona 2.
79 %package -n python3-pyOpenSSL
80 Summary: Python 3 interface to the OpenSSL library
81 Summary(pl.UTF-8): Interfejs Pythona 3 do biblioteki OpenSSL
82 Group: Libraries/Python
84 %description -n python3-pyOpenSSL
85 High-level wrapper around a subset of the OpenSSL library, includes:
86 - SSL.Connection objects, wrapping the methods of Python's portable
88 - Callbacks written in Python
89 - Extensive error-handling mechanism, mirroring OpenSSL's error codes
92 This package contains Python 3 modules.
94 %description -n python3-pyOpenSSL -l pl.UTF-8
95 Wysokopoziomowe obudowanie podzbioru biblioteki OpenSSL, zawierające:
96 - obiekty SSL.Connection, obudowujący metody przenośnych gniazd
98 - wywołania zwrotne napisane w Pythonie
99 - obszerny mechanizm obsługi błędów odzwierciedlający kody błędów
103 Ten pakiet zawiera moduły Pythona 3.
106 Summary: %{module} API documentation
107 Summary(pl.UTF-8): Dokumentacja API modułu %{module}
109 Obsoletes: python-pyOpenSSL-doc < 0.6-3
110 Obsoletes: python-pyOpenSSL-doc-html < 0.6-3
113 API documentation for %{module}.
115 %description apidocs -l pl.UTF-8
116 Dokumentacja API modułu %{module}.
119 %setup -q -n %{module}-%{version}
127 PYTHONPATH=$(pwd)/build-2/lib \
128 %{__python} -m pytest -v tests -k 'not test_verify_with_time and not test_alpn_call_failure'
137 PYTHONPATH=$(pwd)/build-3/lib \
138 %{__python3} -m pytest -v tests -k 'not test_verify_with_time not test_alpn_call_failure'
143 %{__make} -C doc html \
144 SPHINXBUILD=sphinx-build-3
148 rm -rf $RPM_BUILD_ROOT
161 rm -rf $RPM_BUILD_ROOT
165 %defattr(644,root,root,755)
166 %doc CHANGELOG.rst README.rst
167 %dir %{py_sitescriptdir}/OpenSSL
168 %{py_sitescriptdir}/OpenSSL/*.py[co]
169 %{py_sitescriptdir}/pyOpenSSL-%{version}-py*.egg-info
173 %files -n python3-pyOpenSSL
174 %defattr(644,root,root,755)
175 %doc CHANGELOG.rst README.rst
176 %dir %{py3_sitescriptdir}/OpenSSL
177 %{py3_sitescriptdir}/OpenSSL/*.py
178 %{py3_sitescriptdir}/OpenSSL/__pycache__
179 %{py3_sitescriptdir}/pyOpenSSL-%{version}-py*.egg-info
184 %defattr(644,root,root,755)
185 %doc doc/_build/html/{*.html,_static,api}