1 # TODO: fix sphinx docs build (sphinx-build hangs?)
4 %bcond_without tests # unit tests
5 %bcond_with apidocs # Sphinx based HTML documentation [hangs, FIXME]
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
10 %bcond_with openssl # OpenSSL provider
13 %undefine with_python2
14 %undefine with_python3
16 Summary: Crypto library written in C++
17 Summary(pl.UTF-8): Biblioteka kryptograficzna napisana w C++
23 Source0: https://botan.randombit.net/releases/Botan-%{version}.tar.xz
24 # Source0-md5: 6875d4a802db81646d80ed43ebcf9b27
25 URL: https://botan.randombit.net/
26 BuildRequires: bzip2-devel
27 BuildRequires: docutils
28 BuildRequires: libstdc++-devel
29 %{?with_openssl:BuildRequires: openssl-devel}
30 BuildRequires: python >= 1:2.7
31 BuildRequires: rpm-build >= 4.6
32 BuildRequires: rpm-pythonprov
33 BuildRequires: rpmbuild(macros) >= 1.714
34 %{?with_apidocs:BuildRequires: sphinx-pdg}
35 BuildRequires: tar >= 1:1.22
37 BuildRequires: xz-devel
38 BuildRequires: zlib-devel
40 BuildRequires: python-devel >= 1:2.7
43 BuildRequires: python3-devel >= 1:3.4
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 Botan is a BSD-licensed crypto library written in C++. It provides a
49 wide variety of basic cryptographic algorithms, X.509 certificates and
50 CRLs, PKCS#10 certificate requests, a filter/pipe message processing
51 system, and a wide variety of other features, all written in portable
52 C++. The API reference, tutorial, and examples may help impart the
53 flavor of the library.
55 %description -l pl.UTF-8
56 Botan to biblioteka kryptograficzna na licencji BSD, napisana w C++.
57 Zapewnia szeroki zakres algorytmów kryptograficznych, certyfikaty
58 X.509 oraz CRL, żądania certyfikatów PKCS#10, system przetwarzania
59 komunikatów z filtrowaniem/potokami i wiele innych funkcji, wszystko
60 napisane w przenośnym C++. Dodatkowe udogodnienia to dokumentacja API,
61 wprowadzenie oraz przykłady.
64 Summary: Header files for Botan library
65 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Botan
66 Group: Development/Libraries
67 Requires: %{name} = %{version}-%{release}
70 %{?with_openssl:Requires: openssl-devel}
74 This package contains the header files for developing applications
77 %description devel -l pl.UTF-8
78 Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
79 wykorzystujących bibliotekę Botan.
82 Summary: Static Botan library
83 Summary(pl.UTF-8): Statyczna biblioteka Botan
84 Group: Development/Libraries
85 Requires: %{name}-devel = %{version}-%{release}
90 %description static -l pl.UTF-8
91 Statyczna biblioteka Botan.
94 Summary: Botan API documentation
95 Summary(pl.UTF-8): Dokumentacja API biblioteki Botan
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}
132 # kill shebang, nothing to execute directly
133 %{__sed} -i -e '1d' src/python/botan2.py
136 # we have the necessary prerequisites, so enable optional modules
137 %define enable_modules bzip2,lzma,zlib,%{?with_openssl:openssl},sqlite3,tpm,pkcs11
139 # fixme: maybe disable unix_procs, very slow.
140 %define disable_modules %{nil}
143 --prefix=%{_prefix} \
148 --enable-modules=%{enable_modules} \
149 --disable-modules=%{disable_modules} \
151 --with-python-version=%{py_ver} \
153 %{!?with_apidocs:--without-sphinx}
155 # (ab)using CXX as an easy way to inject our CXXFLAGS
157 CXX="%{__cxx} -pthread" \
158 CXXFLAGS="%{rpmcxxflags}"
165 # certstor_system test is trying tp look up expired certs
166 # os_utils fail on builders
167 LD_LIBRARY_PATH=. ./botan-test --skip-tests=certstor_system,os_utils
171 rm -rf $RPM_BUILD_ROOT
174 INSTALL_CMD_EXEC="install -p -m 755" \
175 INSTALL_CMD_DATA="install -p -m 644" \
176 DESTDIR=$RPM_BUILD_ROOT
179 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
180 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
185 install -d $RPM_BUILD_ROOT%{py3_sitedir}
186 cp -p src/python/botan2.py $RPM_BUILD_ROOT%{py3_sitedir}
187 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
188 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
192 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/botan-%{version}
195 install -d $RPM_BUILD_ROOT%{_examplesdir}
196 cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
200 rm -rf $RPM_BUILD_ROOT
202 %post -p /sbin/ldconfig
203 %postun -p /sbin/ldconfig
206 %defattr(644,root,root,755)
207 %doc license.txt news.rst readme.rst doc/{authors.txt,credits.rst,security.rst}
208 %attr(755,root,root) %{_bindir}/botan
209 %attr(755,root,root) %{_libdir}/libbotan-2.so.*.*
210 %attr(755,root,root) %ghost %{_libdir}/libbotan-2.so.19
211 %{_mandir}/man1/botan.1*
214 %defattr(644,root,root,755)
215 %attr(755,root,root) %{_libdir}/libbotan-2.so
216 %{_includedir}/botan-2
217 %{_pkgconfigdir}/botan-2.pc
219 %if %{with static_libs}
221 %defattr(644,root,root,755)
222 %{_libdir}/libbotan-2.a
227 %defattr(644,root,root,755)
228 # FIXME: update path after fixing sphinx build
229 %doc _doc/manual/{_static,*.html,*.js}
230 %{_examplesdir}/%{name}-%{version}
234 %files -n python-botan
235 %defattr(644,root,root,755)
236 %{py_sitedir}/botan2.py[co]
240 %files -n python3-botan
241 %defattr(644,root,root,755)
242 %{py3_sitedir}/botan2.py
243 %{py3_sitedir}/__pycache__/botan2.cpython-*.py[co]