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: 77c558179f276273e0bf39ef941d36c5
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-pythonprov
32 BuildRequires: rpmbuild(macros) >= 1.714
33 %{?with_apidocs:BuildRequires: sphinx-pdg}
34 BuildRequires: zlib-devel
36 BuildRequires: python-devel >= 1:2.7
39 BuildRequires: python3-devel >= 1:3.4
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 Botan is a BSD-licensed crypto library written in C++. It provides a
45 wide variety of basic cryptographic algorithms, X.509 certificates and
46 CRLs, PKCS#10 certificate requests, a filter/pipe message processing
47 system, and a wide variety of other features, all written in portable
48 C++. The API reference, tutorial, and examples may help impart the
49 flavor of the library.
51 %description -l pl.UTF-8
52 Botan to biblioteka kryptograficzna na licencji BSD, napisana w C++.
53 Zapewnia szeroki zakres algorytmów kryptograficznych, certyfikaty
54 X.509 oraz CRL, żądania certyfikatów PKCS#10, system przetwarzania
55 komunikatów z filtrowaniem/potokami i wiele innych funkcji, wszystko
56 napisane w przenośnym C++. Dodatkowe udogodnienia to dokumentacja API,
57 wprowadzenie oraz przykłady.
60 Summary: Header files for Botan library
61 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Botan
62 Group: Development/Libraries
63 Requires: %{name} = %{version}-%{release}
66 %{?with_openssl:Requires: openssl-devel}
70 This package contains the header files for developing applications
73 %description devel -l pl.UTF-8
74 Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
75 wykorzystujących bibliotekę Botan.
78 Summary: Static Botan library
79 Summary(pl.UTF-8): Statyczna biblioteka Botan
80 Group: Development/Libraries
81 Requires: %{name}-devel = %{version}-%{release}
86 %description static -l pl.UTF-8
87 Statyczna biblioteka Botan.
90 Summary: Botan API documentation
91 Summary(pl.UTF-8): Dokumentacja API biblioteki Botan
96 API and internal documentation for Botan library.
98 %description apidocs -l pl.UTF-8
99 Dokumentacja API biblioteki Botan.
101 %package -n python-botan
102 Summary: Python 2.x binding for Botan library
103 Summary(pl.UTF-8): Wiązanie Pythona 2.x do biblioteki Botan
104 Group: Libraries/Python
105 Requires: %{name} = %{version}-%{release}
107 %description -n python-botan
108 Python 2.x binding for Botan library.
110 %description -n python-botan -l pl.UTF-8
111 Wiązanie Pythona 2.x do biblioteki Botan.
113 %package -n python3-botan
114 Summary: Python 3.x binding for Botan library
115 Summary(pl.UTF-8): Wiązanie Pythona 3.x do biblioteki Botan
116 Group: Libraries/Python
117 Requires: %{name} = %{version}-%{release}
119 %description -n python3-botan
120 Python 3.x binding for Botan library.
122 %description -n python3-botan -l pl.UTF-8
123 Wiązanie Pythona 3.x do biblioteki Botan.
126 %setup -q -n Botan-%{version}
128 # kill shebang, nothing to execute directly
129 %{__sed} -i -e '1d' src/python/botan2.py
132 # we have the necessary prerequisites, so enable optional modules
133 %define enable_modules bzip2,lzma,zlib,%{?with_openssl:openssl},sqlite3,tpm,pkcs11
135 # fixme: maybe disable unix_procs, very slow.
136 %define disable_modules %{nil}
139 --prefix=%{_prefix} \
144 --enable-modules=%{enable_modules} \
145 --disable-modules=%{disable_modules} \
147 --with-python-version=%{py_ver} \
149 %{!?with_apidocs:--without-sphinx}
151 # (ab)using CXX as an easy way to inject our CXXFLAGS
153 CXX="%{__cxx} -pthread" \
154 CXXFLAGS="%{rpmcxxflags}"
161 # certstor_system test is trying tp look up expired certs
162 # os_utils fail on builders
163 LD_LIBRARY_PATH=. ./botan-test --skip-tests=certstor_system,os_utils
167 rm -rf $RPM_BUILD_ROOT
170 INSTALL_CMD_EXEC="install -p -m 755" \
171 INSTALL_CMD_DATA="install -p -m 644" \
172 DESTDIR=$RPM_BUILD_ROOT
175 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
176 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
181 install -d $RPM_BUILD_ROOT%{py3_sitedir}
182 cp -p src/python/botan2.py $RPM_BUILD_ROOT%{py3_sitedir}
183 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
184 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
188 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/botan-%{version}
191 install -d $RPM_BUILD_ROOT%{_examplesdir}
192 cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
196 rm -rf $RPM_BUILD_ROOT
198 %post -p /sbin/ldconfig
199 %postun -p /sbin/ldconfig
202 %defattr(644,root,root,755)
203 %doc license.txt news.rst readme.rst doc/{authors.txt,credits.rst,security.rst}
204 %attr(755,root,root) %{_bindir}/botan
205 %attr(755,root,root) %{_libdir}/libbotan-2.so.*.*
206 %attr(755,root,root) %ghost %{_libdir}/libbotan-2.so.18
207 %{_mandir}/man1/botan.1*
210 %defattr(644,root,root,755)
211 %attr(755,root,root) %{_libdir}/libbotan-2.so
212 %{_includedir}/botan-2
213 %{_pkgconfigdir}/botan-2.pc
215 %if %{with static_libs}
217 %defattr(644,root,root,755)
218 %{_libdir}/libbotan-2.a
223 %defattr(644,root,root,755)
224 # FIXME: update path after fixing sphinx build
225 %doc _doc/manual/{_static,*.html,*.js}
226 %{_examplesdir}/%{name}-%{version}
230 %files -n python-botan
231 %defattr(644,root,root,755)
232 %{py_sitedir}/botan2.py[co]
236 %files -n python3-botan
237 %defattr(644,root,root,755)
238 %{py3_sitedir}/botan2.py
239 %{py3_sitedir}/__pycache__/botan2.cpython-*.py[co]