%def_enable static

Name:		libarpra
Version:	0.0.1
Release:	alt1
Summary:	C library for analyzing the propagation of numerical error in arbitrary precision computations
Group:		Sciences/Mathematics
License:	GPLv3
URL:		https://github.com/arpra-project/arpra
Source0:	%name-%version.tar
Packager:	Alexander Lubyagin <dfpl@altlinux.ru>
BuildRequires:	makeinfo
BuildRequires:	libgmp-devel libmpfr-devel libmpfi-devel

%description
Arpra is a C library for (Ar)bitrary-(p)recision (r)ange (a)nalysis of IEEE-754
floating-point computations, based on GNU MPFR. The main use-case of Arpra
is to maintain computed upper and lower bounds of numerical error for
all variables, at all times, throughout a computation. Arpra uses mixed trimmed
interval/affine arithmetic with deviation term reduction to accomplish this.
Affine arithmetic is a variant of interval arithmetic which accounts
for variable correlations. As such, it does not suffer from the so-called
'dependency problem', where intervals grow overly large due to lack
of consideration for variable correlations.
By combining the results of interval arithmetic and affine arithmetic,
one avoids both the dependency problem of interval arithmetic, and
the nonlinear function overshoot/undershoot problem of affine arithmetic.
Arpra implements affine arithmetic using a GNU MPFR backend.

%package devel
Summary: Development environment for arpra
Group: Development/C
Requires: %name = %version-%release

%description devel
Arpra is a C library for arbitrary-precision range analysis of IEEE-754
floating-point computations, based on GNU MPFR.
This package contains development files you can use to develop
applications using arbitrary-precision computations.

%package devel-static
Summary: Static arpra library
Group: Development/C
Requires: %name-devel = %version-%release
Requires: glibc-devel-static

%description devel-static
Arpra is a C library for arbitrary-precision range analysis of IEEE-754
floating-point computations, based on GNU MPFR.
This package contains development files you can use to develop
statically linked applications using arbitrary-precision computations.

%prep
%setup

%build
autoreconf -i -Wall
./configure --prefix=/usr
make

%install
%make_install DESTDIR=%buildroot install
%if "%_lib" == "lib64"
mkdir -p %buildroot/%_libdir
mv %buildroot/usr/lib/* %buildroot/%_libdir/
%endif
mkdir -p %buildroot%_defaultdocdir/libarpra
install -p -m644 README %buildroot%_defaultdocdir/libarpra/

%check
make check-TESTS

%files
%_libdir/*.so.*
%_defaultdocdir/libarpra/
%_infodir/*

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

%if_enabled static
%files devel-static
%_libdir/*.a
%endif #static

%changelog
* Tue Jul 23 2024 Alexander Lubyagin <dfpl@altlinux.org> 0.0.1-alt1
- First release

