Name:		libaffa
Version:	0.9.6
Release:	alt1
Summary:	Libaffa - C++ Affine Arithmetic Library
Group:		Sciences/Mathematics
License:	LGPL-2.1-or-later
URL:		https://github.com/foolnotion/libaffa
# https://github.com/foolnotion/libaffa/archive/refs/tags/v0.9.6.tar.gz
Source:		%name-%version.tar
Packager:	Alexander Lubyagin <dfpl@altlinux.ru>
Patch1:		alt-atanh.patch
Patch2:		alt-half-plane.patch

BuildRequires(pre): rpm-macros-cmake
BuildRequires: cmake gcc-c++ gcc-c++-common
BuildRequires: libstdc++-devel

%description
Libaffa is a C++ Affine Arithmetic library for GNU/Linux.
Affine Arithmetic is a model proposed by Stolfi and Comba
in the early 90's for numerical calculation. Unlike Interval
Arithmetic, it keeps track of correlations between computed
and input quantities, and is therefore resistant to the explosion
error observed in long interval computations.

%package devel
Summary: Development environment for libaffa
Group: Development/C
Requires: %name = %version-%release
BuildRequires: libstdc++-devel

%description devel
Libaffa is a C++ Affine Arithmetic library for GNU/Linux.
This package contains development files you can use to develop
applications using arbitrary-precision computations.

%package devel-static
Summary: Static libaffa library
Group: Development/C
Requires: %name-devel = %version-%release
BuildRequires: libstdc++-devel-static

%description devel-static
Libaffa is a C++ Affine Arithmetic library for GNU/Linux.
This package contains development files you can use to develop
statically linked applications using arbitrary-precision computations.

%prep
%setup
%patch1 -p1
%patch2 -p1

%build
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
cmake --build .

%install
cd build
make DESTDIR="%buildroot/" install

%files
%_libdir/*.so.*

%files devel
%_libdir/*.so
%_includedir/affa/

%files devel-static
%_libdir/*.a

%changelog
* Mon Jul 29 2024 Alexander Lubyagin <dfpl@altlinux.org> 0.9.6-alt1
- Initial build
