Blob Blame History Raw
Name:           e-antic
Version:        1.0.2
Release:        1%{?dist}
Summary:        Real Embedded Algebraic Number Theory In C

License:        LGPLv3+
URL:            https://github.com/flatsurf/%{name}
Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz
# The e-antic sources contain patches to flint and antic, but those patches
# have already been incorporated into the Fedora versions.  Make e-antic skip
# attempts to build the patched files.
Patch0:         %{name}-unpatch.patch
# Work around a comparison bug with negative integers on 32-bit platforms.
# https://github.com/flatsurf/e-antic/issues/194
Patch1:         %{name}-negative-int.patch

BuildRequires:  antic-devel
BuildRequires:  arb-devel
BuildRequires:  boost-devel
BuildRequires:  catch-devel
BuildRequires:  cereal-devel
BuildRequires:  gcc-c++
BuildRequires:  libtool
BuildRequires:  make

# Missing dependencies to build docs:
# - byexample: https://github.com/byexamples/byexample
# - standardese: https://github.com/standardese/standardese

# The python interface, pyeantic, requires cppyy, which is currently not
# available in Fedora.
# This can be removed when Fedora 38 reaches EOL
Obsoletes:      python3-pyeantic < 1.0.1-2

%description
E-ANTIC is a C/C++ library to deal with real embedded number fields,
built on top of ANTIC.  Its aim is to have as fast as possible exact
arithmetic operations and comparisons.

%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       antic-devel%{?_isa}
Requires:       arb-devel%{?_isa}
Requires:       boost-devel%{?_isa}
Requires:       cereal-devel%{?_isa}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%prep
%autosetup -p1

# Update the configure script due to patch 0
autoreconf -fi .

# Make catch2 available for testing
mkdir -p libeantic/test/external/catch2/single_include
ln -s %{_includedir}/catch2 libeantic/test/external/catch2/single_include

# Make cereal available for testing
rmdir libeantic/test/external/cereal
ln -s %{_includedir}/cereal libeantic/test/external/cereal

%build
export CPPFLAGS="-I %{_includedir}/arb"
%configure --disable-silent-rules --disable-static \
  --enable-openmp \
  --without-benchmark \
  --without-byexample \
  --without-doc \
  --without-pyeantic \
  --without-realalg \
  --without-sage

# Get rid of undesirable hardcoded rpaths; workaround libtool reordering
# -Wl,--as-needed after all the libraries.
sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
    -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
    -e 's|CC="\(g..\)"|CC="\1 -Wl,--as-needed"|' \
    -i libeantic/libtool

%make_build

%install
%make_install

# We do not want the libtool archives
rm %{buildroot}%{_libdir}/*.la

# Documentation is installed below
rm -fr %{buildroot}%{_docdir}

%check
LD_LIBRARY_PATH=%{buildroot}%{_libdir} make check

%files
%doc AUTHORS README.md
%license COPYING COPYING.LESSER
%{_libdir}/libeantic.so.1*
%{_libdir}/libeanticxx.so.1*

%files          devel
%{_includedir}/%{name}/
%{_includedir}/libeantic/
%{_libdir}/libeantic.so
%{_libdir}/libeanticxx.so

%changelog
* Wed Aug 11 2021 Jerry James <loganjerry@gmail.com> - 1.0.2-1
- Version 1.0.2

* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Sun Jul 18 2021 Jerry James <loganjerry@gmail.com> - 1.0.1-2
- Drop the python3-pyeantic subpackage due to missing cppyy

* Thu Jul 15 2021 Jerry James <loganjerry@gmail.com> - 1.0.1-1
- Version 1.0.1
- Add the python3-pyeantic subpackage
- Add -unpatch and -negative-int patches

* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Fri Aug  7 2020 Jerry James <loganjerry@gmail.com> - 0.1.8-1
- Initial RPM