%global major_version 3 %global so_major_version 5 Name: botan3 Version: 3.5.0 Release: %autorelease Summary: C++ cryptography library License: BSD-2-Clause URL: https://botan.randombit.net/ Source0: https://botan.randombit.net/releases/Botan-%{version}.tar.xz # Pass $CXXFLAGS to linker as well, can be dropped with the next rebase # See: https://github.com/randombit/botan/issues/4196 Patch0: c91cd4bf43218f66c15435f240fe28fc7771d13f.patch BuildRequires: boost-devel BuildRequires: bzip2-devel BuildRequires: gcc-c++ BuildRequires: make BuildRequires: python3 BuildRequires: python3-devel BuildRequires: python3dist(sphinx) BuildRequires: sqlite-devel BuildRequires: xz-devel BuildRequires: zlib-devel Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description Botan is a C++ cryptography library offering the tools necessary to implement a range of practical systems, such as TLS protocol, X.509 certificates, modern AEAD ciphers, PKCS#11 and TPM hardware support, password hashing, and post quantum crypto schemes. The library is accompanied by a command line interface. This package contains the stable 3.x release of Botan. %package libs Summary: Botan 3.x libraries %description libs %{summary} %package devel Summary: Botan 3.x development files and headers Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description devel %{summary} %package doc Summary: Botan 3.x HTML documentation BuildArch: noarch %description doc %{summary} %package -n python3-%{name} Summary: Botan 3.x Python 3 bindings %{?python_provide:%python_provide python3-%{name}} Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description -n python3-%{name} %{summary} %prep %autosetup -n Botan-%{version} -p1 %build %{__python3} ./configure.py \ --cpu=%{_arch} \ --disable-static-library \ --distribution-info="$(source /etc/os-release ; echo "$NAME")" \ --docdir=%{_docdir} \ --libdir=%{_lib} \ --os=linux \ --prefix=%{_prefix} \ --with-boost \ --with-bzip2 \ --with-debug-info \ --with-lzma \ --with-python-version=%{python3_version} \ --with-rst2man \ --with-sphinx \ --with-sqlite3 \ --with-zlib %make_build %install %make_install DESTDIR=%{buildroot} # Rename the main binary (and the respective man page) to botan3, so it doesn't conflict with botan2 package mv %{buildroot}%{_bindir}/botan %{buildroot}%{_bindir}/botan%{major_version} mv %{buildroot}%{_mandir}/man1/botan.1 %{buildroot}%{_mandir}/man1/botan%{major_version}.1 # Similarly, move the documentation into a botan3 subdirectory mv %{buildroot}%{_docdir}/botan-%{version} %{buildroot}%{_pkgdocdir} # Drop Python shebang from the Python bindings file, as it's not meant to be executed directly anyway sed -e '1{/^#!/d}' -i %{buildroot}%{python3_sitearch}/botan%{major_version}.py # Drop unneeded files rm -r %{buildroot}%{_pkgdocdir}/handbook/{.doctrees,.buildinfo} %check LD_LIBRARY_PATH=%{buildroot}%{_libdir} ./botan-test %files %license license.txt %dir %{_pkgdocdir} %{_pkgdocdir}/*.txt %{_bindir}/botan%{major_version} %{_mandir}/man1/botan%{major_version}.1.gz %files libs %license license.txt %{_libdir}/libbotan-%{major_version}.so.%{so_major_version}{,.*} %files devel %license license.txt %{_includedir}/* %{_libdir}/libbotan-%{major_version}.so %{_libdir}/pkgconfig/botan-%{major_version}.pc %dir %{_libdir}/cmake/Botan-%{version}/ %{_libdir}/cmake/Botan-%{version}/*.cmake %files doc %license license.txt %dir %{_pkgdocdir} %{_pkgdocdir}/handbook %files -n python3-%{name} %license license.txt %{python3_sitearch}/%{name}.py %{python3_sitearch}/__pycache__/* %changelog %autochangelog