3 %bcond_without tests # unit tests
4 %bcond_without apidocs # Sphinx based HTML documentation
5 %bcond_without static_libs # static library
6 %bcond_without python # Python bindings
7 %bcond_without python2 # CPython 2.x binding
8 %bcond_without python3 # CPython 3.x binding
11 %undefine with_python2
12 %undefine with_python3
14 Summary: Crypto library written in C++
15 Summary(pl.UTF-8): Biblioteka kryptograficzna napisana w C++
21 Source0: https://botan.randombit.net/releases/Botan-%{version}.tgz
22 # Source0-md5: e5ed5dc70edd238c5a2116670b2cb3f3
23 Patch0: %{name}-includes.patch
24 Patch1: %{name}-python.patch
25 URL: https://botan.randombit.net/
26 BuildRequires: bzip2-devel
27 BuildRequires: gmp-devel
28 BuildRequires: libstdc++-devel
29 BuildRequires: openssl-devel
30 BuildRequires: python >= 1:2.6
31 BuildRequires: rpm-pythonprov
32 BuildRequires: rpmbuild(macros) >= 1.714
33 %{?with_apidocs:BuildRequires: sphinx-pdg}
34 BuildRequires: zlib-devel
36 BuildRequires: boost-python-devel
37 BuildRequires: python-devel >= 1:2.6
40 BuildRequires: boost-python3-devel
41 BuildRequires: python3-devel >= 1:3.2
43 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 Botan is a BSD-licensed crypto library written in C++. It provides a
47 wide variety of basic cryptographic algorithms, X.509 certificates and
48 CRLs, PKCS#10 certificate requests, a filter/pipe message processing
49 system, and a wide variety of other features, all written in portable
50 C++. The API reference, tutorial, and examples may help impart the
51 flavor of the library.
53 %description -l pl.UTF-8
54 Botan to biblioteka kryptograficzna na licencji BSD, napisana w C++.
55 Zapewnia szeroki zakres algorytmów kryptograficznych, certyfikaty
56 X.509 oraz CRL, żądania certyfikatów PKCS#10, system przetwarzania
57 komunikatów z filtrowaniem/potokami i wiele innych funkcji, wszystko
58 napisane w przenośnym C++. Dodatkowe udogodnienia to dokumentacja API,
59 wprowadzenie oraz przykłady.
62 Summary: Header files for Botan library
63 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Botan
64 Group: Development/Libraries
65 Requires: %{name} = %{version}-%{release}
68 Requires: openssl-devel
72 This package contains the header files for developing applications
76 Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
77 wykorzystujących bibliotekę Botan.
80 Summary: Static Botan library
81 Summary(pl.UTF-8): Statyczna biblioteka Botan
82 Group: Development/Libraries
83 Requires: %{name}-devel = %{version}-%{release}
88 %description static -l pl.UTF-8
89 Statyczna biblioteka Botan.
92 Summary: Botan API documentation
93 Summary(pl.UTF-8): Dokumentacja API biblioteki Botan
95 %if "%{_rpmversion}" >= "5"
100 API and internal documentation for Botan library.
102 %description apidocs -l pl.UTF-8
103 Dokumentacja API biblioteki Botan.
105 %package -n python-botan
106 Summary: Python 2.x binding for Botan library
107 Summary(pl.UTF-8): Wiązanie Pythona 2.x do biblioteki Botan
108 Group: Libraries/Python
109 Requires: %{name} = %{version}-%{release}
111 %description -n python-botan
112 Python 2.x binding for Botan library.
114 %description -n python-botan -l pl.UTF-8
115 Wiązanie Pythona 2.x do biblioteki Botan.
117 %package -n python3-botan
118 Summary: Python 3.x binding for Botan library
119 Summary(pl.UTF-8): Wiązanie Pythona 3.x do biblioteki Botan
120 Group: Libraries/Python
121 Requires: %{name} = %{version}-%{release}
123 %description -n python3-botan
124 Python 3.x binding for Botan library.
126 %description -n python3-botan -l pl.UTF-8
127 Wiązanie Pythona 3.x do biblioteki Botan.
130 %setup -q -n Botan-%{version}
135 # we have the necessary prerequisites, so enable optional modules
136 %define enable_modules gnump,bzip2,zlib,openssl
138 # fixme: maybe disable unix_procs, very slow.
139 %define disable_modules %{nil}
142 --prefix=%{_prefix} \
147 --enable-modules=%{enable_modules} \
148 --disable-modules=%{disable_modules} \
150 --with-boost-python \
151 --with-python-version=x.y \
153 %{?with_apidocs:--with-sphinx}
155 # (ab)using CXX as an easy way to inject our CXXFLAGS
157 CXX="%{__cxx} %{rpmcxxflags}"
165 CXX="%{__cxx} %{rpmcxxflags}"
167 LD_LIBRARY_PATH=. ./check --validate
171 install -d build/python%{py_ver}
172 %{__make} -f Makefile.python \
174 CFLAGS="%{rpmcxxflags}" \
175 LDFLAGS="%{rpmldflags}" \
177 PYTHON_ROOT=%{py_libdir}/config \
178 PYTHON_INC=-I%{py_incdir}
182 install -d build/python%{py3_ver}
183 %{__make} -f Makefile.python \
185 CFLAGS="%{rpmcxxflags}" \
186 LDFLAGS="%{rpmldflags}" \
187 BOOST_PYTHON=boost_python3 \
189 PYTHON_ROOT=%{py3_libdir}/config \
190 PYTHON_INC=-I%{py3_incdir}
194 rm -rf $RPM_BUILD_ROOT
197 INSTALL_CMD_EXEC="install -p -m 755" \
198 INSTALL_CMD_DATA="install -p -m 644" \
200 DESTDIR=$RPM_BUILD_ROOT%{_prefix}
203 %{__make} -f Makefile.python install \
205 PYTHON_SITE_PACKAGE_DIR=$RPM_BUILD_ROOT%{py_sitedir}
207 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
208 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
213 %{__make} -f Makefile.python install \
215 PYTHON_SITE_PACKAGE_DIR=$RPM_BUILD_ROOT%{py3_sitedir}
217 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
218 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
222 install -d $RPM_BUILD_ROOT%{_examplesdir}
223 cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
227 rm -rf $RPM_BUILD_ROOT
229 %post -p /sbin/ldconfig
230 %postun -p /sbin/ldconfig
233 %defattr(644,root,root,755)
234 %doc readme.txt doc/{algos,credits,faq,index,license,log,support,users}.txt
235 %attr(755,root,root) %{_libdir}/libbotan-1.10.so.*.*
236 %attr(755,root,root) %ghost %{_libdir}/libbotan-1.10.so.1
239 %defattr(644,root,root,755)
240 %attr(755,root,root) %{_bindir}/botan-config-1.10
241 %attr(755,root,root) %{_libdir}/libbotan-1.10.so
242 %{_includedir}/botan-1.10
243 %{_pkgconfigdir}/botan-1.10.pc
245 %if %{with static_libs}
247 %defattr(644,root,root,755)
248 %{_libdir}/libbotan-1.10.a
253 %defattr(644,root,root,755)
254 %doc _doc/manual/{_static,*.html,*.js}
255 %{_examplesdir}/%{name}-%{version}
259 %files -n python-botan
260 %defattr(644,root,root,755)
261 %dir %{py_sitedir}/botan
262 %attr(755,root,root) %{py_sitedir}/botan/_botan.so
263 %{py_sitedir}/botan/__init__.py[co]
267 %files -n python3-botan
268 %defattr(644,root,root,755)
269 %dir %{py3_sitedir}/botan
270 %attr(755,root,root) %{py3_sitedir}/botan/_botan.so
271 %{py3_sitedir}/botan/__init__.py
272 %{py3_sitedir}/botan/__pycache__