]>
Commit | Line | Data |
---|---|---|
24e3a41e JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | %bcond_without doc # HTML documentation (sphinx-based) | |
6 | # | |
d6a1b263 | 7 | %define module pyOpenSSL |
24e3a41e JB |
8 | Summary: Python 2 interface to the OpenSSL library |
9 | Summary(pl.UTF-8): Interfejs Pythona 2 do biblioteki OpenSSL | |
d6a1b263 | 10 | Name: python-%{module} |
24e3a41e | 11 | Version: 0.14 |
571565ec | 12 | Release: 4 |
24e3a41e | 13 | License: Apache v2.0 |
d6a1b263 | 14 | Group: Libraries/Python |
24e3a41e JB |
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 | |
18 | %if %{with python2} | |
19 | BuildRequires: python-modules >= 1:2.6 | |
24e3a41e JB |
20 | %endif |
21 | %if %{with python3} | |
22 | BuildRequires: python3-modules >= 3.2 | |
23 | %endif | |
31dc7a1d | 24 | BuildRequires: rpm-pythonprov |
5310dd74 | 25 | BuildRequires: rpmbuild(macros) >= 1.612 |
24e3a41e JB |
26 | %{?with_doc:BuildRequires: sphinx-pdg} |
27 | Requires: python-cryptography >= 0.2.1 | |
28 | Requires: python-six >= 1.5.2 | |
e5d1f0aa | 29 | Obsoletes: python-OpenSSL |
691ea7ee AM |
30 | Obsoletes: python-pyOpenSSL-doc |
31 | Obsoletes: python-pyOpenSSL-doc-html | |
d6a1b263 MG |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
33 | ||
34 | %description | |
24e3a41e JB |
35 | High-level wrapper around a subset of the OpenSSL library, includes: |
36 | - SSL.Connection objects, wrapping the methods of Python's portable | |
37 | sockets | |
38 | - Callbacks written in Python | |
39 | - Extensive error-handling mechanism, mirroring OpenSSL's error codes | |
40 | ...and much more. | |
41 | ||
42 | This package contains Python 2 modules. | |
d6a1b263 | 43 | |
f91aab6a | 44 | %description -l pl.UTF-8 |
24e3a41e JB |
45 | Wysokopoziomowe obudowanie podzbioru biblioteki OpenSSL, zawierające: |
46 | - obiekty SSL.Connection, obudowujący metody przenośnych gniazd | |
47 | Pythona | |
48 | - wywołania zwrotne napisane w Pythonie | |
49 | - obszerny mechanizm obsługi błędów odzwierciedlający kody błędów | |
50 | OpenSSL-a | |
51 | ...i wiele więcej. | |
52 | ||
53 | Ten pakiet zawiera moduły Pythona 2. | |
54 | ||
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 | |
61 | ||
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 | |
65 | sockets | |
66 | - Callbacks written in Python | |
67 | - Extensive error-handling mechanism, mirroring OpenSSL's error codes | |
68 | ...and much more. | |
69 | ||
70 | This package contains Python 3 modules. | |
71 | ||
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 | |
75 | Pythona | |
76 | - wywołania zwrotne napisane w Pythonie | |
77 | - obszerny mechanizm obsługi błędów odzwierciedlający kody błędów | |
78 | OpenSSL-a | |
79 | ...i wiele więcej. | |
80 | ||
81 | Ten pakiet zawiera moduły Pythona 3. | |
d6a1b263 | 82 | |
d6a1b263 MG |
83 | %package examples |
84 | Summary: Examples for pyOpenSSL module | |
def8d3c9 | 85 | Summary(pl.UTF-8): Przykłady do modułu pyOpenSSL |
d6a1b263 MG |
86 | Group: Libraries/Python |
87 | Requires: %{name} = %{version}-%{release} | |
88 | ||
89 | %description examples | |
90 | This package contains example files for pyOpenSSL Python module. | |
91 | ||
f91aab6a JR |
92 | %description examples -l pl.UTF-8 |
93 | Pakiet zawierający przykładowe skrypty dla modułu Pythona pyOpenSSL. | |
d6a1b263 MG |
94 | |
95 | %prep | |
96 | %setup -q -n %{module}-%{version} | |
d6a1b263 | 97 | |
2326286f | 98 | %build |
24e3a41e | 99 | %if %{with python2} |
ab07431a | 100 | %py_build \ |
24e3a41e JB |
101 | --build-base build-2 |
102 | %endif | |
103 | %if %{with python3} | |
ab07431a | 104 | %py3_build \ |
24e3a41e JB |
105 | --build-base build-3 |
106 | %endif | |
107 | ||
108 | %if %{with doc} | |
109 | %{__make} -C doc html | |
110 | %endif | |
2326286f | 111 | |
d6a1b263 MG |
112 | %install |
113 | rm -rf $RPM_BUILD_ROOT | |
24e3a41e | 114 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
d6a1b263 | 115 | |
24e3a41e JB |
116 | %if %{with python2} |
117 | %{__python} setup.py \ | |
118 | build \ | |
119 | --build-base build-2 \ | |
120 | install \ | |
121 | --optimize=2 \ | |
122 | --root=$RPM_BUILD_ROOT | |
d6a1b263 | 123 | |
24e3a41e JB |
124 | %py_postclean |
125 | %endif | |
126 | ||
127 | %if %{with python3} | |
128 | %{__python3} setup.py \ | |
129 | build \ | |
130 | --build-base build-3 \ | |
131 | install \ | |
132 | --optimize=2 \ | |
133 | --root=$RPM_BUILD_ROOT | |
134 | %endif | |
d6a1b263 | 135 | |
2326286f | 136 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
d6a1b263 | 137 | |
d6a1b263 MG |
138 | %clean |
139 | rm -rf $RPM_BUILD_ROOT | |
140 | ||
24e3a41e | 141 | %if %{with python2} |
d6a1b263 MG |
142 | %files |
143 | %defattr(644,root,root,755) | |
24e3a41e JB |
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 | |
150 | %endif | |
151 | ||
152 | %if %{with python3} | |
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 | |
163 | %endif | |
d6a1b263 MG |
164 | |
165 | %files examples | |
166 | %defattr(644,root,root,755) | |
167 | %{_examplesdir}/%{name}-%{version} |