]>
Commit | Line | Data |
---|---|---|
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 | # | |
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} | |
11 | Version: 0.14 | |
12 | Release: 4 | |
13 | License: Apache v2.0 | |
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 | |
18 | %if %{with python2} | |
19 | BuildRequires: python-modules >= 1:2.6 | |
20 | %endif | |
21 | %if %{with python3} | |
22 | BuildRequires: python3-modules >= 3.2 | |
23 | %endif | |
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) | |
33 | ||
34 | %description | |
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. | |
43 | ||
44 | %description -l pl.UTF-8 | |
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. | |
82 | ||
83 | %package examples | |
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} | |
88 | ||
89 | %description examples | |
90 | This package contains example files for pyOpenSSL Python module. | |
91 | ||
92 | %description examples -l pl.UTF-8 | |
93 | Pakiet zawierający przykładowe skrypty dla modułu Pythona pyOpenSSL. | |
94 | ||
95 | %prep | |
96 | %setup -q -n %{module}-%{version} | |
97 | ||
98 | %build | |
99 | %if %{with python2} | |
100 | %py_build \ | |
101 | --build-base build-2 | |
102 | %endif | |
103 | %if %{with python3} | |
104 | %py3_build \ | |
105 | --build-base build-3 | |
106 | %endif | |
107 | ||
108 | %if %{with doc} | |
109 | %{__make} -C doc html | |
110 | %endif | |
111 | ||
112 | %install | |
113 | rm -rf $RPM_BUILD_ROOT | |
114 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
115 | ||
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 | |
123 | ||
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 | |
135 | ||
136 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
137 | ||
138 | %clean | |
139 | rm -rf $RPM_BUILD_ROOT | |
140 | ||
141 | %if %{with python2} | |
142 | %files | |
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 | |
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 | |
164 | ||
165 | %files examples | |
166 | %defattr(644,root,root,755) | |
167 | %{_examplesdir}/%{name}-%{version} |