]>
Commit | Line | Data |
---|---|---|
ff65fdf7 | 1 | # NOTE: for botan 2.x see botan2.spec |
7f5657d3 ER |
2 | # |
3 | # Conditional build: | |
ac90ec63 JB |
4 | %bcond_without tests # unit tests |
5 | %bcond_without apidocs # Sphinx based HTML documentation | |
6 | %bcond_without static_libs # static library | |
7 | %bcond_without python # Python bindings | |
8 | %bcond_without python2 # CPython 2.x binding | |
9 | %bcond_without python3 # CPython 3.x binding | |
7f5657d3 | 10 | |
ac90ec63 JB |
11 | %if %{without python} |
12 | %undefine with_python2 | |
13 | %undefine with_python3 | |
14 | %endif | |
7f5657d3 | 15 | Summary: Crypto library written in C++ |
93e6aed8 | 16 | Summary(pl.UTF-8): Biblioteka kryptograficzna napisana w C++ |
7f5657d3 | 17 | Name: botan |
ac90ec63 | 18 | Version: 1.10.17 |
ec76faf7 | 19 | Release: 4 |
7f5657d3 ER |
20 | License: BSD |
21 | Group: Libraries | |
ac90ec63 JB |
22 | Source0: https://botan.randombit.net/releases/Botan-%{version}.tgz |
23 | # Source0-md5: e5ed5dc70edd238c5a2116670b2cb3f3 | |
24 | Patch0: %{name}-includes.patch | |
25 | Patch1: %{name}-python.patch | |
26 | URL: https://botan.randombit.net/ | |
7f5657d3 ER |
27 | BuildRequires: bzip2-devel |
28 | BuildRequires: gmp-devel | |
29 | BuildRequires: libstdc++-devel | |
30 | BuildRequires: openssl-devel | |
ac90ec63 JB |
31 | BuildRequires: python >= 1:2.6 |
32 | BuildRequires: rpm-pythonprov | |
33 | BuildRequires: rpmbuild(macros) >= 1.714 | |
34 | %{?with_apidocs:BuildRequires: sphinx-pdg} | |
7f5657d3 | 35 | BuildRequires: zlib-devel |
ac90ec63 JB |
36 | %if %{with python2} |
37 | BuildRequires: boost-python-devel | |
38 | BuildRequires: python-devel >= 1:2.6 | |
39 | %endif | |
40 | %if %{with python3} | |
41 | BuildRequires: boost-python3-devel | |
42 | BuildRequires: python3-devel >= 1:3.2 | |
43 | %endif | |
7f5657d3 ER |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
45 | ||
46 | %description | |
47 | Botan is a BSD-licensed crypto library written in C++. It provides a | |
48 | wide variety of basic cryptographic algorithms, X.509 certificates and | |
93e6aed8 | 49 | CRLs, PKCS#10 certificate requests, a filter/pipe message processing |
7f5657d3 ER |
50 | system, and a wide variety of other features, all written in portable |
51 | C++. The API reference, tutorial, and examples may help impart the | |
52 | flavor of the library. | |
53 | ||
93e6aed8 JB |
54 | %description -l pl.UTF-8 |
55 | Botan to biblioteka kryptograficzna na licencji BSD, napisana w C++. | |
56 | Zapewnia szeroki zakres algorytmów kryptograficznych, certyfikaty | |
57 | X.509 oraz CRL, żądania certyfikatów PKCS#10, system przetwarzania | |
58 | komunikatów z filtrowaniem/potokami i wiele innych funkcji, wszystko | |
59 | napisane w przenośnym C++. Dodatkowe udogodnienia to dokumentacja API, | |
60 | wprowadzenie oraz przykłady. | |
61 | ||
7f5657d3 | 62 | %package devel |
ac90ec63 JB |
63 | Summary: Header files for Botan library |
64 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Botan | |
7f5657d3 ER |
65 | Group: Development/Libraries |
66 | Requires: %{name} = %{version}-%{release} | |
67 | Requires: bzip2-devel | |
68 | Requires: gmp-devel | |
69 | Requires: openssl-devel | |
7f5657d3 ER |
70 | Requires: zlib-devel |
71 | ||
72 | %description devel | |
93e6aed8 | 73 | This package contains the header files for developing applications |
ac90ec63 | 74 | that use Botan. |
93e6aed8 JB |
75 | |
76 | %description devel | |
77 | Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji | |
ac90ec63 | 78 | wykorzystujących bibliotekę Botan. |
7f5657d3 ER |
79 | |
80 | %package static | |
ac90ec63 JB |
81 | Summary: Static Botan library |
82 | Summary(pl.UTF-8): Statyczna biblioteka Botan | |
7f5657d3 ER |
83 | Group: Development/Libraries |
84 | Requires: %{name}-devel = %{version}-%{release} | |
85 | ||
86 | %description static | |
ac90ec63 | 87 | Static Botan library. |
7f5657d3 ER |
88 | |
89 | %description static -l pl.UTF-8 | |
ac90ec63 | 90 | Statyczna biblioteka Botan. |
7f5657d3 ER |
91 | |
92 | %package apidocs | |
ac90ec63 JB |
93 | Summary: Botan API documentation |
94 | Summary(pl.UTF-8): Dokumentacja API biblioteki Botan | |
7f5657d3 | 95 | Group: Documentation |
fed27784 | 96 | BuildArch: noarch |
7f5657d3 ER |
97 | |
98 | %description apidocs | |
ac90ec63 | 99 | API and internal documentation for Botan library. |
7f5657d3 ER |
100 | |
101 | %description apidocs -l pl.UTF-8 | |
ac90ec63 JB |
102 | Dokumentacja API biblioteki Botan. |
103 | ||
104 | %package -n python-botan | |
105 | Summary: Python 2.x binding for Botan library | |
106 | Summary(pl.UTF-8): Wiązanie Pythona 2.x do biblioteki Botan | |
107 | Group: Libraries/Python | |
108 | Requires: %{name} = %{version}-%{release} | |
109 | ||
110 | %description -n python-botan | |
111 | Python 2.x binding for Botan library. | |
112 | ||
113 | %description -n python-botan -l pl.UTF-8 | |
114 | Wiązanie Pythona 2.x do biblioteki Botan. | |
115 | ||
116 | %package -n python3-botan | |
117 | Summary: Python 3.x binding for Botan library | |
118 | Summary(pl.UTF-8): Wiązanie Pythona 3.x do biblioteki Botan | |
119 | Group: Libraries/Python | |
120 | Requires: %{name} = %{version}-%{release} | |
121 | ||
122 | %description -n python3-botan | |
123 | Python 3.x binding for Botan library. | |
124 | ||
125 | %description -n python3-botan -l pl.UTF-8 | |
126 | Wiązanie Pythona 3.x do biblioteki Botan. | |
7f5657d3 ER |
127 | |
128 | %prep | |
129 | %setup -q -n Botan-%{version} | |
ac90ec63 JB |
130 | %patch0 -p1 |
131 | %patch1 -p1 | |
7f5657d3 ER |
132 | |
133 | %build | |
134 | # we have the necessary prerequisites, so enable optional modules | |
135 | %define enable_modules gnump,bzip2,zlib,openssl | |
136 | ||
137 | # fixme: maybe disable unix_procs, very slow. | |
138 | %define disable_modules %{nil} | |
139 | ||
140 | ./configure.py \ | |
141 | --prefix=%{_prefix} \ | |
142 | --libdir=%{_lib} \ | |
143 | --cc=gcc \ | |
144 | --os=linux \ | |
3bd15bf0 | 145 | --cpu=%{_target_base_arch} \ |
7f5657d3 | 146 | --enable-modules=%{enable_modules} \ |
ac90ec63 JB |
147 | --disable-modules=%{disable_modules} \ |
148 | %if %{with python} | |
149 | --with-boost-python \ | |
150 | --with-python-version=x.y \ | |
151 | %endif | |
152 | %{?with_apidocs:--with-sphinx} | |
7f5657d3 ER |
153 | |
154 | # (ab)using CXX as an easy way to inject our CXXFLAGS | |
155 | %{__make} \ | |
156 | CXX="%{__cxx} %{rpmcxxflags}" | |
157 | ||
ac90ec63 JB |
158 | %if %{with apidocs} |
159 | %{__make} docs | |
160 | %endif | |
161 | ||
7f5657d3 | 162 | %if %{with tests} |
ac90ec63 JB |
163 | %{__make} check \ |
164 | CXX="%{__cxx} %{rpmcxxflags}" | |
7f5657d3 | 165 | |
7f5657d3 ER |
166 | LD_LIBRARY_PATH=. ./check --validate |
167 | %endif | |
168 | ||
ac90ec63 JB |
169 | %if %{with python2} |
170 | install -d build/python%{py_ver} | |
171 | %{__make} -f Makefile.python \ | |
172 | CXX="%{__cxx}" \ | |
173 | CFLAGS="%{rpmcxxflags}" \ | |
174 | LDFLAGS="%{rpmldflags}" \ | |
175 | PY_VER=%{py_ver} \ | |
176 | PYTHON_ROOT=%{py_libdir}/config \ | |
177 | PYTHON_INC=-I%{py_incdir} | |
178 | %endif | |
179 | ||
180 | %if %{with python3} | |
181 | install -d build/python%{py3_ver} | |
182 | %{__make} -f Makefile.python \ | |
183 | CXX="%{__cxx}" \ | |
184 | CFLAGS="%{rpmcxxflags}" \ | |
185 | LDFLAGS="%{rpmldflags}" \ | |
186 | BOOST_PYTHON=boost_python3 \ | |
187 | PY_VER=%{py3_ver} \ | |
188 | PYTHON_ROOT=%{py3_libdir}/config \ | |
189 | PYTHON_INC=-I%{py3_incdir} | |
190 | %endif | |
191 | ||
7f5657d3 ER |
192 | %install |
193 | rm -rf $RPM_BUILD_ROOT | |
ac90ec63 | 194 | |
7f5657d3 ER |
195 | %{__make} install \ |
196 | INSTALL_CMD_EXEC="install -p -m 755" \ | |
197 | INSTALL_CMD_DATA="install -p -m 644" \ | |
198 | DOCDIR=_doc \ | |
199 | DESTDIR=$RPM_BUILD_ROOT%{_prefix} | |
200 | ||
ac90ec63 JB |
201 | %if %{with python2} |
202 | %{__make} -f Makefile.python install \ | |
203 | PY_VER=%{py_ver} \ | |
204 | PYTHON_SITE_PACKAGE_DIR=$RPM_BUILD_ROOT%{py_sitedir} | |
205 | ||
206 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
207 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
208 | %py_postclean | |
209 | %endif | |
210 | ||
211 | %if %{with python3} | |
212 | %{__make} -f Makefile.python install \ | |
213 | PY_VER=%{py3_ver} \ | |
214 | PYTHON_SITE_PACKAGE_DIR=$RPM_BUILD_ROOT%{py3_sitedir} | |
215 | ||
216 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir} | |
217 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir} | |
218 | %endif | |
219 | ||
220 | %if %{with apidocs} | |
221 | install -d $RPM_BUILD_ROOT%{_examplesdir} | |
222 | cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
223 | %endif | |
f7749ed3 | 224 | |
7f5657d3 ER |
225 | %clean |
226 | rm -rf $RPM_BUILD_ROOT | |
227 | ||
ac90ec63 JB |
228 | %post -p /sbin/ldconfig |
229 | %postun -p /sbin/ldconfig | |
7f5657d3 ER |
230 | |
231 | %files | |
232 | %defattr(644,root,root,755) | |
ac90ec63 JB |
233 | %doc readme.txt doc/{algos,credits,faq,index,license,log,support,users}.txt |
234 | %attr(755,root,root) %{_libdir}/libbotan-1.10.so.*.* | |
235 | %attr(755,root,root) %ghost %{_libdir}/libbotan-1.10.so.1 | |
7f5657d3 ER |
236 | |
237 | %files devel | |
238 | %defattr(644,root,root,755) | |
ac90ec63 JB |
239 | %attr(755,root,root) %{_bindir}/botan-config-1.10 |
240 | %attr(755,root,root) %{_libdir}/libbotan-1.10.so | |
241 | %{_includedir}/botan-1.10 | |
242 | %{_pkgconfigdir}/botan-1.10.pc | |
7f5657d3 ER |
243 | |
244 | %if %{with static_libs} | |
245 | %files static | |
246 | %defattr(644,root,root,755) | |
ac90ec63 | 247 | %{_libdir}/libbotan-1.10.a |
7f5657d3 ER |
248 | %endif |
249 | ||
250 | %if %{with apidocs} | |
251 | %files apidocs | |
252 | %defattr(644,root,root,755) | |
ac90ec63 JB |
253 | %doc _doc/manual/{_static,*.html,*.js} |
254 | %{_examplesdir}/%{name}-%{version} | |
255 | %endif | |
256 | ||
257 | %if %{with python2} | |
258 | %files -n python-botan | |
259 | %defattr(644,root,root,755) | |
260 | %dir %{py_sitedir}/botan | |
261 | %attr(755,root,root) %{py_sitedir}/botan/_botan.so | |
262 | %{py_sitedir}/botan/__init__.py[co] | |
263 | %endif | |
264 | ||
265 | %if %{with python3} | |
266 | %files -n python3-botan | |
267 | %defattr(644,root,root,755) | |
268 | %dir %{py3_sitedir}/botan | |
269 | %attr(755,root,root) %{py3_sitedir}/botan/_botan.so | |
270 | %{py3_sitedir}/botan/__init__.py | |
271 | %{py3_sitedir}/botan/__pycache__ | |
7f5657d3 | 272 | %endif |