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: 30a71dd700d69561483fb1599a13ea3b
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: zlib-devel
39 BuildRequires: python-devel >= 1:2.7
42 BuildRequires: python3-devel >= 1:3.4
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 %{?with_openssl:Requires: openssl-devel}
73 This package contains the header files for developing applications
76 %description devel -l pl.UTF-8
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
99 API and internal documentation for Botan library.
101 %description apidocs -l pl.UTF-8
102 Dokumentacja API biblioteki Botan.
104 %package -n python-botan
105 Summary: Python 2.x binding for Botan library
106 Summary(pl.UTF-8): Wiązanie Pythona 2.x do biblioteki Botan
107 Group: Libraries/Python
108 Requires: %{name} = %{version}-%{release}
110 %description -n python-botan
111 Python 2.x binding for Botan library.
113 %description -n python-botan -l pl.UTF-8
114 Wiązanie Pythona 2.x do biblioteki Botan.
116 %package -n python3-botan
117 Summary: Python 3.x binding for Botan library
118 Summary(pl.UTF-8): Wiązanie Pythona 3.x do biblioteki Botan
119 Group: Libraries/Python
120 Requires: %{name} = %{version}-%{release}
122 %description -n python3-botan
123 Python 3.x binding for Botan library.
125 %description -n python3-botan -l pl.UTF-8
126 Wiązanie Pythona 3.x do biblioteki Botan.
129 %setup -q -n Botan-%{version}
131 # kill shebang, nothing to execute directly
132 %{__sed} -i -e '1d' src/python/botan2.py
135 # we have the necessary prerequisites, so enable optional modules
136 %define enable_modules bzip2,lzma,zlib,%{?with_openssl:openssl},sqlite3,tpm,pkcs11
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-python-version=%{py_ver} \
152 %{!?with_apidocs:--without-sphinx}
154 # (ab)using CXX as an easy way to inject our CXXFLAGS
156 CXX="%{__cxx} -pthread" \
157 CXXFLAGS="%{rpmcxxflags}"
164 # certstor_system test is trying tp look up expired certs
165 # os_utils fail on builders
166 LD_LIBRARY_PATH=. ./botan-test --skip-tests=certstor_system,os_utils
170 rm -rf $RPM_BUILD_ROOT
173 INSTALL_CMD_EXEC="install -p -m 755" \
174 INSTALL_CMD_DATA="install -p -m 644" \
175 DESTDIR=$RPM_BUILD_ROOT
178 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
179 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
184 install -d $RPM_BUILD_ROOT%{py3_sitedir}
185 cp -p src/python/botan2.py $RPM_BUILD_ROOT%{py3_sitedir}
186 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
187 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
191 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/botan-%{version}
194 install -d $RPM_BUILD_ROOT%{_examplesdir}
195 cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
199 rm -rf $RPM_BUILD_ROOT
201 %post -p /sbin/ldconfig
202 %postun -p /sbin/ldconfig
205 %defattr(644,root,root,755)
206 %doc license.txt news.rst readme.rst doc/{authors.txt,credits.rst,security.rst}
207 %attr(755,root,root) %{_bindir}/botan
208 %attr(755,root,root) %{_libdir}/libbotan-2.so.*.*
209 %attr(755,root,root) %ghost %{_libdir}/libbotan-2.so.19
210 %{_mandir}/man1/botan.1*
213 %defattr(644,root,root,755)
214 %attr(755,root,root) %{_libdir}/libbotan-2.so
215 %{_includedir}/botan-2
216 %{_pkgconfigdir}/botan-2.pc
218 %if %{with static_libs}
220 %defattr(644,root,root,755)
221 %{_libdir}/libbotan-2.a
226 %defattr(644,root,root,755)
227 # FIXME: update path after fixing sphinx build
228 %doc _doc/manual/{_static,*.html,*.js}
229 %{_examplesdir}/%{name}-%{version}
233 %files -n python-botan
234 %defattr(644,root,root,755)
235 %{py_sitedir}/botan2.py[co]
239 %files -n python3-botan
240 %defattr(644,root,root,755)
241 %{py3_sitedir}/botan2.py
242 %{py3_sitedir}/__pycache__/botan2.cpython-*.py[co]