Name:     libapmathlib
Version:  2.1.0
Release:  alt1
Summary:  IBM Accurate Portable Mathlib
License:  LGPL-2.0-or-later
Group:    Sciences/Mathematics
Url:      https://github.com/dreal-deps/mathlib
Packager: Alexander Lubyagin <dfpl@altlinux.org>
# http://www-126.ibm.com/pub/mathlib/mathlib12.20.2001.tar.gz
Source:   %name-%version.tar
Patch1:   alt-getenv-workaround.patch

BuildRequires: cmake gcc-c++ gcc-c++-common
BuildRequires: libstdc++-devel

%description
The IBM Accurate Portable Mathematical library (IBM APMathLib)
consists of routines that compute some of the standard common
transcendental functions. The computed results are the exact
theoretical values correctly rounded (nearest or even) to the
closest number representable by the IEEE 754 double format.
The computations are bit-by-bit compatible upon porting among
the supported platforms. Currently the supported platforms/compilers
are: x86/Linux/gcc, x86/NT/[gcc| cl], Sparc/Solaris/gcc,
PowerPC/AIX[32bit | 64bit]/[gcc | xlc].

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

%description devel
APMathlib (IBM Accurate Portable Mathlib) is a set of accurate portable
routines. This package contains development files you can use to develop
applications using precision computations.

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

%description devel-static
APMathlib (IBM Accurate Portable Mathlib) is a set of accurate portable
routines. This package contains development files you can use to develop
statically linked applications using precision computations.

%prep
%setup -q
%patch1 -p0

%build
./configure --prefix=/usr
make -j4

%install
make DESTDIR="%buildroot" install
%if "%_lib" == "lib64"
mkdir -p %buildroot/%_libdir
mv %buildroot/usr/lib/* %buildroot/%_libdir/
%endif

%files
%doc AUTHORS README NEWS COPYING ChangeLog descriptions2.txt
%_libdir/*.so.*

%files devel
%_libdir/*.so
%_includedir/MathLib.h
%_includedir/mathlib_configuration.h
%_includedir/mathlib_config.h

%files devel-static
%_libdir/*.a

%changelog
* Mon Jul 29 2024 Alexander Lubyagin <dfpl@altlinux.org> 2.1.0-alt1
- 2.1.0
* Fri Jul 15 2005  Frederic Goualard <Frederic.Goualard@univ-nantes.fr>
- modified %post and %postun rules
* Tue Aug 13 2002 Frederic Goualard <Frederic.Goualard@irin.univ-nantes.fr>
- initial build
