3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
5 %bcond_without doc # HTML documentation (sphinx-based)
7 %define module pyOpenSSL
8 Summary: Python 2 interface to the OpenSSL library
9 Summary(pl.UTF-8): Interfejs Pythona 2 do biblioteki OpenSSL
10 Name: python-%{module}
14 Group: Libraries/Python
15 Source0: https://pypi.python.org/packages/source/p/pyOpenSSL/%{module}-%{version}.tar.gz
16 # Source0-md5: 8579ff3a1d858858acfba5f046a4ddf7
17 URL: https://github.com/pyca/pyopenssl
19 BuildRequires: python-modules >= 1:2.6
22 BuildRequires: python3-modules >= 3.2
24 BuildRequires: rpm-pythonprov
25 BuildRequires: rpmbuild(macros) >= 1.612
26 %{?with_doc:BuildRequires: sphinx-pdg}
27 Requires: python-cryptography >= 0.2.1
28 Requires: python-six >= 1.5.2
29 Obsoletes: python-OpenSSL
30 Obsoletes: python-pyOpenSSL-doc
31 Obsoletes: python-pyOpenSSL-doc-html
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 High-level wrapper around a subset of the OpenSSL library, includes:
36 - SSL.Connection objects, wrapping the methods of Python's portable
38 - Callbacks written in Python
39 - Extensive error-handling mechanism, mirroring OpenSSL's error codes
42 This package contains Python 2 modules.
44 %description -l pl.UTF-8
45 Wysokopoziomowe obudowanie podzbioru biblioteki OpenSSL, zawierające:
46 - obiekty SSL.Connection, obudowujący metody przenośnych gniazd
48 - wywołania zwrotne napisane w Pythonie
49 - obszerny mechanizm obsługi błędów odzwierciedlający kody błędów
53 Ten pakiet zawiera moduły Pythona 2.
55 %package -n python3-pyOpenSSL
56 Summary: Python 2 interface to the OpenSSL library
57 Summary(pl.UTF-8): Interfejs Pythona 2 do biblioteki OpenSSL
58 Group: Libraries/Python
59 Requires: python3-cryptography >= 0.2.1
60 Requires: python3-six >= 1.5.2
62 %description -n python3-pyOpenSSL
63 High-level wrapper around a subset of the OpenSSL library, includes:
64 - SSL.Connection objects, wrapping the methods of Python's portable
66 - Callbacks written in Python
67 - Extensive error-handling mechanism, mirroring OpenSSL's error codes
70 This package contains Python 3 modules.
72 %description -n python3-pyOpenSSL -l pl.UTF-8
73 Wysokopoziomowe obudowanie podzbioru biblioteki OpenSSL, zawierające:
74 - obiekty SSL.Connection, obudowujący metody przenośnych gniazd
76 - wywołania zwrotne napisane w Pythonie
77 - obszerny mechanizm obsługi błędów odzwierciedlający kody błędów
81 Ten pakiet zawiera moduły Pythona 3.
84 Summary: Examples for pyOpenSSL module
85 Summary(pl.UTF-8): Przykłady do modułu pyOpenSSL
86 Group: Libraries/Python
87 Requires: %{name} = %{version}-%{release}
90 This package contains example files for pyOpenSSL Python module.
92 %description examples -l pl.UTF-8
93 Pakiet zawierający przykładowe skrypty dla modułu Pythona pyOpenSSL.
96 %setup -q -n %{module}-%{version}
100 %{__python} setup.py build \
104 %{__python3} setup.py build \
109 %{__make} -C doc html
113 rm -rf $RPM_BUILD_ROOT
114 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
117 %{__python} setup.py \
119 --build-base build-2 \
122 --root=$RPM_BUILD_ROOT
128 %{__python3} setup.py \
130 --build-base build-3 \
133 --root=$RPM_BUILD_ROOT
136 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
139 rm -rf $RPM_BUILD_ROOT
143 %defattr(644,root,root,755)
144 %doc ChangeLog README TODO %{?with_doc:doc/_build/html/{*.html,_static,api}}
145 %dir %{py_sitescriptdir}/OpenSSL
146 %{py_sitescriptdir}/OpenSSL/*.py[co]
147 %dir %{py_sitescriptdir}/OpenSSL/test
148 %{py_sitescriptdir}/OpenSSL/test/*.py[co]
149 %{py_sitescriptdir}/pyOpenSSL-%{version}-py*.egg-info
153 %files -n python3-pyOpenSSL
154 %defattr(644,root,root,755)
155 %doc ChangeLog README TODO %{?with_doc:doc/_build/html/{*.html,_static,api}}
156 %dir %{py3_sitescriptdir}/OpenSSL
157 %{py3_sitescriptdir}/OpenSSL/*.py
158 %{py3_sitescriptdir}/OpenSSL/__pycache__
159 %dir %{py3_sitescriptdir}/OpenSSL/test
160 %{py3_sitescriptdir}/OpenSSL/test/*.py
161 %{py3_sitescriptdir}/OpenSSL/test/__pycache__
162 %{py3_sitescriptdir}/pyOpenSSL-%{version}-py*.egg-info
166 %defattr(644,root,root,755)
167 %{_examplesdir}/%{name}-%{version}