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
41 BuildRequires: python-modules
44 BuildRequires: python3-devel >= 1:3.4
45 BuildRequires: python3-modules
47 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50 Botan is a BSD-licensed crypto library written in C++. It provides a
51 wide variety of basic cryptographic algorithms, X.509 certificates and
52 CRLs, PKCS#10 certificate requests, a filter/pipe message processing
53 system, and a wide variety of other features, all written in portable
54 C++. The API reference, tutorial, and examples may help impart the
55 flavor of the library.
57 %description -l pl.UTF-8
58 Botan to biblioteka kryptograficzna na licencji BSD, napisana w C++.
59 Zapewnia szeroki zakres algorytmów kryptograficznych, certyfikaty
60 X.509 oraz CRL, żądania certyfikatów PKCS#10, system przetwarzania
61 komunikatów z filtrowaniem/potokami i wiele innych funkcji, wszystko
62 napisane w przenośnym C++. Dodatkowe udogodnienia to dokumentacja API,
63 wprowadzenie oraz przykłady.
66 Summary: Header files for Botan library
67 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Botan
68 Group: Development/Libraries
69 Requires: %{name} = %{version}-%{release}
72 %{?with_openssl:Requires: openssl-devel}
76 This package contains the header files for developing applications
79 %description devel -l pl.UTF-8
80 Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
81 wykorzystujących bibliotekę Botan.
84 Summary: Static Botan library
85 Summary(pl.UTF-8): Statyczna biblioteka Botan
86 Group: Development/Libraries
87 Requires: %{name}-devel = %{version}-%{release}
92 %description static -l pl.UTF-8
93 Statyczna biblioteka Botan.
96 Summary: Botan API documentation
97 Summary(pl.UTF-8): Dokumentacja API biblioteki Botan
102 API and internal documentation for Botan library.
104 %description apidocs -l pl.UTF-8
105 Dokumentacja API biblioteki Botan.
107 %package -n python-botan
108 Summary: Python 2.x binding for Botan library
109 Summary(pl.UTF-8): Wiązanie Pythona 2.x do biblioteki Botan
110 Group: Libraries/Python
111 Requires: %{name} = %{version}-%{release}
113 %description -n python-botan
114 Python 2.x binding for Botan library.
116 %description -n python-botan -l pl.UTF-8
117 Wiązanie Pythona 2.x do biblioteki Botan.
119 %package -n python3-botan
120 Summary: Python 3.x binding for Botan library
121 Summary(pl.UTF-8): Wiązanie Pythona 3.x do biblioteki Botan
122 Group: Libraries/Python
123 Requires: %{name} = %{version}-%{release}
125 %description -n python3-botan
126 Python 3.x binding for Botan library.
128 %description -n python3-botan -l pl.UTF-8
129 Wiązanie Pythona 3.x do biblioteki Botan.
132 %setup -q -n Botan-%{version}
134 # kill shebang, nothing to execute directly
135 %{__sed} -i -e '1d' src/python/botan2.py
138 # we have the necessary prerequisites, so enable optional modules
139 %define enable_modules bzip2,lzma,zlib,%{?with_openssl:openssl},sqlite3,tpm,pkcs11
141 # fixme: maybe disable unix_procs, very slow.
142 %define disable_modules %{nil}
145 --prefix=%{_prefix} \
150 --enable-modules=%{enable_modules} \
151 --disable-modules=%{disable_modules} \
153 --with-python-version=%{py_ver} \
155 %{!?with_apidocs:--without-sphinx}
157 # (ab)using CXX as an easy way to inject our CXXFLAGS
159 CXX="%{__cxx} -pthread" \
160 CXXFLAGS="%{rpmcxxflags}"
167 # certstor_system test is trying tp look up expired certs
168 # os_utils fail on builders
169 LD_LIBRARY_PATH=. ./botan-test --skip-tests=certstor_system,os_utils
173 rm -rf $RPM_BUILD_ROOT
176 INSTALL_CMD_EXEC="install -p -m 755" \
177 INSTALL_CMD_DATA="install -p -m 644" \
178 DESTDIR=$RPM_BUILD_ROOT
181 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
182 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
187 install -d $RPM_BUILD_ROOT%{py3_sitedir}
188 cp -p src/python/botan2.py $RPM_BUILD_ROOT%{py3_sitedir}
189 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
190 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
194 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/botan-%{version}
197 install -d $RPM_BUILD_ROOT%{_examplesdir}
198 cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
202 rm -rf $RPM_BUILD_ROOT
204 %post -p /sbin/ldconfig
205 %postun -p /sbin/ldconfig
208 %defattr(644,root,root,755)
209 %doc license.txt news.rst readme.rst doc/{authors.txt,credits.rst,security.rst}
210 %attr(755,root,root) %{_bindir}/botan
211 %attr(755,root,root) %{_libdir}/libbotan-2.so.*.*
212 %attr(755,root,root) %ghost %{_libdir}/libbotan-2.so.19
213 %{_mandir}/man1/botan.1*
216 %defattr(644,root,root,755)
217 %attr(755,root,root) %{_libdir}/libbotan-2.so
218 %{_includedir}/botan-2
219 %{_pkgconfigdir}/botan-2.pc
221 %if %{with static_libs}
223 %defattr(644,root,root,755)
224 %{_libdir}/libbotan-2.a
229 %defattr(644,root,root,755)
230 # FIXME: update path after fixing sphinx build
231 %doc _doc/manual/{_static,*.html,*.js}
232 %{_examplesdir}/%{name}-%{version}
236 %files -n python-botan
237 %defattr(644,root,root,755)
238 %{py_sitedir}/botan2.py[co]
242 %files -n python3-botan
243 %defattr(644,root,root,755)
244 %{py3_sitedir}/botan2.py
245 %{py3_sitedir}/__pycache__/botan2.cpython-*.py[co]