]>
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 ER |
96 | %if "%{_rpmversion}" >= "5" |
97 | BuildArch: noarch | |
98 | %endif | |
7f5657d3 ER |
99 | |
100 | %description apidocs | |
ac90ec63 | 101 | API and internal documentation for Botan library. |
7f5657d3 ER |
102 | |
103 | %description apidocs -l pl.UTF-8 | |
ac90ec63 JB |
104 | Dokumentacja API biblioteki Botan. |
105 | ||
106 | %package -n python-botan | |
107 | Summary: Python 2.x binding for Botan library | |
108 | Summary(pl.UTF-8): Wiązanie Pythona 2.x do biblioteki Botan | |
109 | Group: Libraries/Python | |
110 | Requires: %{name} = %{version}-%{release} | |
111 | ||
112 | %description -n python-botan | |
113 | Python 2.x binding for Botan library. | |
114 | ||
115 | %description -n python-botan -l pl.UTF-8 | |
116 | Wiązanie Pythona 2.x do biblioteki Botan. | |
117 | ||
118 | %package -n python3-botan | |
119 | Summary: Python 3.x binding for Botan library | |
120 | Summary(pl.UTF-8): Wiązanie Pythona 3.x do biblioteki Botan | |
121 | Group: Libraries/Python | |
122 | Requires: %{name} = %{version}-%{release} | |
123 | ||
124 | %description -n python3-botan | |
125 | Python 3.x binding for Botan library. | |
126 | ||
127 | %description -n python3-botan -l pl.UTF-8 | |
128 | Wiązanie Pythona 3.x do biblioteki Botan. | |
7f5657d3 ER |
129 | |
130 | %prep | |
131 | %setup -q -n Botan-%{version} | |
ac90ec63 JB |
132 | %patch0 -p1 |
133 | %patch1 -p1 | |
7f5657d3 ER |
134 | |
135 | %build | |
136 | # we have the necessary prerequisites, so enable optional modules | |
137 | %define enable_modules gnump,bzip2,zlib,openssl | |
138 | ||
139 | # fixme: maybe disable unix_procs, very slow. | |
140 | %define disable_modules %{nil} | |
141 | ||
142 | ./configure.py \ | |
143 | --prefix=%{_prefix} \ | |
144 | --libdir=%{_lib} \ | |
145 | --cc=gcc \ | |
146 | --os=linux \ | |
3bd15bf0 | 147 | --cpu=%{_target_base_arch} \ |
7f5657d3 | 148 | --enable-modules=%{enable_modules} \ |
ac90ec63 JB |
149 | --disable-modules=%{disable_modules} \ |
150 | %if %{with python} | |
151 | --with-boost-python \ | |
152 | --with-python-version=x.y \ | |
153 | %endif | |
154 | %{?with_apidocs:--with-sphinx} | |
7f5657d3 ER |
155 | |
156 | # (ab)using CXX as an easy way to inject our CXXFLAGS | |
157 | %{__make} \ | |
158 | CXX="%{__cxx} %{rpmcxxflags}" | |
159 | ||
ac90ec63 JB |
160 | %if %{with apidocs} |
161 | %{__make} docs | |
162 | %endif | |
163 | ||
7f5657d3 | 164 | %if %{with tests} |
ac90ec63 JB |
165 | %{__make} check \ |
166 | CXX="%{__cxx} %{rpmcxxflags}" | |
7f5657d3 | 167 | |
7f5657d3 ER |
168 | LD_LIBRARY_PATH=. ./check --validate |
169 | %endif | |
170 | ||
ac90ec63 JB |
171 | %if %{with python2} |
172 | install -d build/python%{py_ver} | |
173 | %{__make} -f Makefile.python \ | |
174 | CXX="%{__cxx}" \ | |
175 | CFLAGS="%{rpmcxxflags}" \ | |
176 | LDFLAGS="%{rpmldflags}" \ | |
177 | PY_VER=%{py_ver} \ | |
178 | PYTHON_ROOT=%{py_libdir}/config \ | |
179 | PYTHON_INC=-I%{py_incdir} | |
180 | %endif | |
181 | ||
182 | %if %{with python3} | |
183 | install -d build/python%{py3_ver} | |
184 | %{__make} -f Makefile.python \ | |
185 | CXX="%{__cxx}" \ | |
186 | CFLAGS="%{rpmcxxflags}" \ | |
187 | LDFLAGS="%{rpmldflags}" \ | |
188 | BOOST_PYTHON=boost_python3 \ | |
189 | PY_VER=%{py3_ver} \ | |
190 | PYTHON_ROOT=%{py3_libdir}/config \ | |
191 | PYTHON_INC=-I%{py3_incdir} | |
192 | %endif | |
193 | ||
7f5657d3 ER |
194 | %install |
195 | rm -rf $RPM_BUILD_ROOT | |
ac90ec63 | 196 | |
7f5657d3 ER |
197 | %{__make} install \ |
198 | INSTALL_CMD_EXEC="install -p -m 755" \ | |
199 | INSTALL_CMD_DATA="install -p -m 644" \ | |
200 | DOCDIR=_doc \ | |
201 | DESTDIR=$RPM_BUILD_ROOT%{_prefix} | |
202 | ||
ac90ec63 JB |
203 | %if %{with python2} |
204 | %{__make} -f Makefile.python install \ | |
205 | PY_VER=%{py_ver} \ | |
206 | PYTHON_SITE_PACKAGE_DIR=$RPM_BUILD_ROOT%{py_sitedir} | |
207 | ||
208 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
209 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
210 | %py_postclean | |
211 | %endif | |
212 | ||
213 | %if %{with python3} | |
214 | %{__make} -f Makefile.python install \ | |
215 | PY_VER=%{py3_ver} \ | |
216 | PYTHON_SITE_PACKAGE_DIR=$RPM_BUILD_ROOT%{py3_sitedir} | |
217 | ||
218 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir} | |
219 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir} | |
220 | %endif | |
221 | ||
222 | %if %{with apidocs} | |
223 | install -d $RPM_BUILD_ROOT%{_examplesdir} | |
224 | cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
225 | %endif | |
f7749ed3 | 226 | |
7f5657d3 ER |
227 | %clean |
228 | rm -rf $RPM_BUILD_ROOT | |
229 | ||
ac90ec63 JB |
230 | %post -p /sbin/ldconfig |
231 | %postun -p /sbin/ldconfig | |
7f5657d3 ER |
232 | |
233 | %files | |
234 | %defattr(644,root,root,755) | |
ac90ec63 JB |
235 | %doc readme.txt doc/{algos,credits,faq,index,license,log,support,users}.txt |
236 | %attr(755,root,root) %{_libdir}/libbotan-1.10.so.*.* | |
237 | %attr(755,root,root) %ghost %{_libdir}/libbotan-1.10.so.1 | |
7f5657d3 ER |
238 | |
239 | %files devel | |
240 | %defattr(644,root,root,755) | |
ac90ec63 JB |
241 | %attr(755,root,root) %{_bindir}/botan-config-1.10 |
242 | %attr(755,root,root) %{_libdir}/libbotan-1.10.so | |
243 | %{_includedir}/botan-1.10 | |
244 | %{_pkgconfigdir}/botan-1.10.pc | |
7f5657d3 ER |
245 | |
246 | %if %{with static_libs} | |
247 | %files static | |
248 | %defattr(644,root,root,755) | |
ac90ec63 | 249 | %{_libdir}/libbotan-1.10.a |
7f5657d3 ER |
250 | %endif |
251 | ||
252 | %if %{with apidocs} | |
253 | %files apidocs | |
254 | %defattr(644,root,root,755) | |
ac90ec63 JB |
255 | %doc _doc/manual/{_static,*.html,*.js} |
256 | %{_examplesdir}/%{name}-%{version} | |
257 | %endif | |
258 | ||
259 | %if %{with python2} | |
260 | %files -n python-botan | |
261 | %defattr(644,root,root,755) | |
262 | %dir %{py_sitedir}/botan | |
263 | %attr(755,root,root) %{py_sitedir}/botan/_botan.so | |
264 | %{py_sitedir}/botan/__init__.py[co] | |
265 | %endif | |
266 | ||
267 | %if %{with python3} | |
268 | %files -n python3-botan | |
269 | %defattr(644,root,root,755) | |
270 | %dir %{py3_sitedir}/botan | |
271 | %attr(755,root,root) %{py3_sitedir}/botan/_botan.so | |
272 | %{py3_sitedir}/botan/__init__.py | |
273 | %{py3_sitedir}/botan/__pycache__ | |
7f5657d3 | 274 | %endif |