1 # NOTE: for botan 2.x see botan2.spec
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
12 %undefine with_python2
13 %undefine with_python3
15 Summary: Crypto library written in C++
16 Summary(pl.UTF-8): Biblioteka kryptograficzna napisana w C++
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/
27 BuildRequires: bzip2-devel
28 BuildRequires: gmp-devel
29 BuildRequires: libstdc++-devel
30 BuildRequires: openssl-devel
31 BuildRequires: python >= 1:2.6
32 BuildRequires: rpm-pythonprov
33 BuildRequires: rpmbuild(macros) >= 1.714
34 %{?with_apidocs:BuildRequires: sphinx-pdg}
35 BuildRequires: zlib-devel
37 BuildRequires: boost-python-devel
38 BuildRequires: python-devel >= 1:2.6
41 BuildRequires: boost-python3-devel
42 BuildRequires: python3-devel >= 1:3.2
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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
49 CRLs, PKCS#10 certificate requests, a filter/pipe message processing
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.
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.
63 Summary: Header files for Botan library
64 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Botan
65 Group: Development/Libraries
66 Requires: %{name} = %{version}-%{release}
69 Requires: openssl-devel
73 This package contains the header files for developing applications
77 Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
78 wykorzystujących bibliotekę Botan.
81 Summary: Static Botan library
82 Summary(pl.UTF-8): Statyczna biblioteka Botan
83 Group: Development/Libraries
84 Requires: %{name}-devel = %{version}-%{release}
89 %description static -l pl.UTF-8
90 Statyczna biblioteka Botan.
93 Summary: Botan API documentation
94 Summary(pl.UTF-8): Dokumentacja API biblioteki Botan
96 %if "%{_rpmversion}" >= "5"
101 API and internal documentation for Botan library.
103 %description apidocs -l pl.UTF-8
104 Dokumentacja API biblioteki Botan.
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}
112 %description -n python-botan
113 Python 2.x binding for Botan library.
115 %description -n python-botan -l pl.UTF-8
116 Wiązanie Pythona 2.x do biblioteki Botan.
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}
124 %description -n python3-botan
125 Python 3.x binding for Botan library.
127 %description -n python3-botan -l pl.UTF-8
128 Wiązanie Pythona 3.x do biblioteki Botan.
131 %setup -q -n Botan-%{version}
136 # we have the necessary prerequisites, so enable optional modules
137 %define enable_modules gnump,bzip2,zlib,openssl
139 # fixme: maybe disable unix_procs, very slow.
140 %define disable_modules %{nil}
143 --prefix=%{_prefix} \
147 --cpu=%{_target_base_arch} \
148 --enable-modules=%{enable_modules} \
149 --disable-modules=%{disable_modules} \
151 --with-boost-python \
152 --with-python-version=x.y \
154 %{?with_apidocs:--with-sphinx}
156 # (ab)using CXX as an easy way to inject our CXXFLAGS
158 CXX="%{__cxx} %{rpmcxxflags}"
166 CXX="%{__cxx} %{rpmcxxflags}"
168 LD_LIBRARY_PATH=. ./check --validate
172 install -d build/python%{py_ver}
173 %{__make} -f Makefile.python \
175 CFLAGS="%{rpmcxxflags}" \
176 LDFLAGS="%{rpmldflags}" \
178 PYTHON_ROOT=%{py_libdir}/config \
179 PYTHON_INC=-I%{py_incdir}
183 install -d build/python%{py3_ver}
184 %{__make} -f Makefile.python \
186 CFLAGS="%{rpmcxxflags}" \
187 LDFLAGS="%{rpmldflags}" \
188 BOOST_PYTHON=boost_python3 \
190 PYTHON_ROOT=%{py3_libdir}/config \
191 PYTHON_INC=-I%{py3_incdir}
195 rm -rf $RPM_BUILD_ROOT
198 INSTALL_CMD_EXEC="install -p -m 755" \
199 INSTALL_CMD_DATA="install -p -m 644" \
201 DESTDIR=$RPM_BUILD_ROOT%{_prefix}
204 %{__make} -f Makefile.python install \
206 PYTHON_SITE_PACKAGE_DIR=$RPM_BUILD_ROOT%{py_sitedir}
208 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
209 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
214 %{__make} -f Makefile.python install \
216 PYTHON_SITE_PACKAGE_DIR=$RPM_BUILD_ROOT%{py3_sitedir}
218 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
219 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
223 install -d $RPM_BUILD_ROOT%{_examplesdir}
224 cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
228 rm -rf $RPM_BUILD_ROOT
230 %post -p /sbin/ldconfig
231 %postun -p /sbin/ldconfig
234 %defattr(644,root,root,755)
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
240 %defattr(644,root,root,755)
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
246 %if %{with static_libs}
248 %defattr(644,root,root,755)
249 %{_libdir}/libbotan-1.10.a
254 %defattr(644,root,root,755)
255 %doc _doc/manual/{_static,*.html,*.js}
256 %{_examplesdir}/%{name}-%{version}
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]
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__