33b912d
Name:           libpoly
fd5693f
Version:        0.1.13
cbed27b
Release:        %autorelease
33b912d
Summary:        C library for manipulating polynomials
33b912d
cca884f
License:        LGPL-3.0-or-later
6e8b730
URL:            https://sri-csl.github.io/libpoly/
0393f62
VCS:            https://github.com/SRI-CSL/libpoly
0393f62
Source0:        %{vcs}/archive/v%{version}/%{name}-%{version}.tar.gz
418d8fd
# Fix incompatible pointer type, an error with GCC 14
418d8fd
# See https://github.com/SRI-CSL/libpoly/pull/76
418d8fd
Patch0:         %{name}-gcc14.patch
33b912d
0393f62
# See https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
0393f62
ExcludeArch:    %{ix86}
0393f62
33b912d
BuildRequires:  cmake
7bc5f25
BuildRequires:  gcc-c++
33b912d
BuildRequires:  gmp-devel
cd82573
BuildRequires:  make
1455581
BuildRequires:  python3-devel
5fc289e
BuildRequires:  %{py3_dist sympy}
d50f68e
33b912d
%description
33b912d
LibPoly is a C library for manipulating polynomials.  The target
33b912d
applications are symbolic reasoning engines, such as SMT solvers, that
33b912d
need to reason about polynomial constraints.
33b912d
33b912d
%package        devel
33b912d
Summary:        Development files for %{name}
33b912d
Requires:       %{name}%{?_isa} = %{version}-%{release}
33b912d
33b912d
%description    devel
33b912d
The %{name}-devel package contains libraries and header files for
33b912d
developing applications that use %{name}.
33b912d
1455581
%package     -n python3-%{name}
1455581
Summary:        Python 3 interface to %{name}
1455581
Requires:       %{name}%{?_isa} = %{version}-%{release}
1455581
1455581
%description -n python3-%{name}
1455581
This package contains a python 3 interface to %{name}.
1455581
33b912d
%prep
78cd07f
%autosetup -p1
33b912d
33b912d
# Install in the right place
33b912d
if [ "%{_lib}" != "lib" ]; then
33b912d
  sed -i 's/\(DESTINATION \)lib/\1%{_lib}/' src/CMakeLists.txt
33b912d
fi
33b912d
33b912d
# Clean up hidden files before they get installed
340c030
find . -name .gitignore -delete
33b912d
6c90861
%generate_buildrequires
6c90861
cd python
6c90861
sed 's/\${LIBPOLY_VERSION}/%{version}/' setup.py.in > setup.py
6c90861
%pyproject_buildrequires
6c90861
rm setup.py
6c90861
33b912d
%build
1455581
%cmake %{_cmake_skip_rpath} \
0393f62
  -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
33b912d
  -DLIBPOLY_BUILD_STATIC:BOOL=OFF \
cae2413
  -DLIBPOLY_BUILD_STATIC_PIC:BOOL=OFF
cae2413
%cmake_build
33b912d
6c90861
# Build the python interface the Fedora way
6c90861
sed -i "s|library_dirs = \[|&'$PWD/%{_vpath_builddir}/src', |" python/setup.py
6c90861
cd python
6c90861
%pyproject_wheel
6c90861
cd -
6c90861
33b912d
%install
cae2413
%cmake_install
33b912d
6c90861
# Install the python interface the Fedora way
6c90861
cd python
6c90861
%pyproject_install
6c90861
%pyproject_save_files polypy
6c90861
cd -
1455581
1455581
%check
cd82573
export LD_LIBRARY_PATH=$PWD/%{_vpath_builddir}/src
cae2413
%ctest
1455581
33b912d
%files
33b912d
%license LICENCE
33b912d
%doc README.md
7bc5f25
%{_libdir}/libpoly.so.0*
7bc5f25
%{_libdir}/libpolyxx.so.0*
33b912d
33b912d
%files devel
33b912d
%{_includedir}/poly/
7bc5f25
%{_libdir}/libpoly.so
7bc5f25
%{_libdir}/libpolyxx.so
33b912d
6c90861
%files -n python3-%{name} -f %{pyproject_files}
1455581
33b912d
%changelog
cbed27b
%autochangelog