%global major_version 2
Name: botan2
Version: 2.4.0
Release: 5%{?dist}
Summary: Crypto and TLS for C++11
License: BSD
URL: https://botan.randombit.net/
Source0: https://botan.randombit.net/releases/Botan-%{version}.tgz
Patch0: 01-remove-rpath-gcc.patch
Patch1: 02-fix-wrong-script-interpreter.patch
ExcludeArch: ppc64le
BuildRequires: gcc-c++
BuildRequires: python2
BuildRequires: python2-sphinx
BuildRequires: python3-devel
BuildRequires: bzip2-devel
BuildRequires: zlib-devel
BuildRequires: openssl-devel
%description
Botan is a BSD-licensed crypto library written in C++. It provides a
wide variety of basic cryptographic algorithms, X.509 certificates and
CRLs, PKCS \#10 certificate requests, a filter/pipe message processing
system, and a wide variety of other features, all written in portable
C++. The API reference, tutorial, and examples may help impart the
flavor of the library. This is the current stable release branch 2.x
of Botan.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package doc
Summary: Documentation for %{name}
BuildArch: noarch
%description doc
%{summary}
This package contains HTML documentation for %{name}.
%package -n python3-%{name}
Summary: Python3 bindings for %{name}
%{?python_provide:%python_provide python3-%{name}}
%description -n python3-%{name}
%{summary}
This package contains the Python3 binding for %{name}.
%prep
%setup -q -n Botan-%{version}
%patch0 -p0
%patch1 -p0
%build
# we have the necessary prerequisites, so enable optional modules
%global enable_modules bzip2,zlib,openssl
./configure.py \
--prefix=%{_prefix} \
--libdir=%{_lib} \
--docdir=%{_docdir} \
--cc=gcc \
--os=linux \
--cpu=%{_arch} \
--enable-modules=%{enable_modules} \
--with-python-version=%{python3_version} \
--with-sphinx \
--distribution-info=$(cat /etc/os-release | grep ^NAME= | sed 's/NAME=//g') \
--with-debug-info
%make_build
%install
make install DESTDIR=%{buildroot}
chmod 755 %{buildroot}%{python3_sitearch}/botan2.py
# doc installation fixups
mv %{buildroot}%{_docdir}/botan-%{version} %{buildroot}%{_pkgdocdir}
rm -r %{buildroot}%{_pkgdocdir}/manual/{.doctrees,.buildinfo}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%license license.txt
%dir %{_pkgdocdir}
%{_pkgdocdir}/*.txt
%{_libdir}/libbotan-%{major_version}.so.*
%{_bindir}/botan
%{_mandir}/man1/botan.1.gz
%files devel
%license license.txt
%{_includedir}/*
%exclude %{_libdir}/libbotan-%{major_version}.a
%{_libdir}/libbotan-%{major_version}.so
%{_libdir}/pkgconfig/botan-%{major_version}.pc
%files doc
%license license.txt
%dir %{_pkgdocdir}
%{_pkgdocdir}/manual
%files -n python3-%{name}
%license license.txt
%{python3_sitearch}/%{name}.py
%{python3_sitearch}/__pycache__/*
%check
LD_LIBRARY_PATH=%{buildroot}%{_libdir} ./botan-test
%changelog
* Tue Mar 13 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.4.0-5
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Tue Mar 06 2018 Benjamin Kircher <benjamin.kircher@gmail.com> - 2.4.0-4
- Exclude ppc64le arch, fix linter warnings
* Tue Mar 06 2018 Benjamin Kircher <benjamin.kircher@gmail.com> - 2.4.0-3
- Fix macro expansion in changelog section
* Sat Jan 13 2018 Benjamin Kircher <benjamin.kircher@gmail.com> - 2.4.0-2
- Remove INSTALL_ variables, not used anymore
* Thu Jan 11 2018 Benjamin Kircher <benjamin.kircher@gmail.com> - 2.4.0-1
- New upstream version; add new man page for botan command line utility
* Fri Dec 15 2017 Benjamin Kircher <benjamin.kircher@gmail.com> - 2.3.0-1
- New upstream version
* Thu Sep 07 2017 Benjamin Kircher <benjamin.kircher@gmail.com> - 2.2.0-4
- Backport upstream fix for broken GOST on i686
* Wed Sep 06 2017 Benjamin Kircher <benjamin.kircher@gmail.com> - 2.2.0-3
- Fix %%check section after rpath removal, generate debug symbols
* Thu Aug 31 2017 Benjamin Kircher <benjamin.kircher@gmail.com> - 2.2.0-2
- Fix issues that came up in review, see RH Bugzilla #1487067
* Sat Aug 12 2017 Benjamin Kircher <benjamin.kircher@gmail.com> - 2.2.0-1
- New package. No need for compat-openssl10-devel anymore with 2.2.0 release