Blob Blame Raw
Name:           cadical
Epoch:          1
Version:        1.0.3
Release:        3%{?dist}
Summary:        Simplified SAT solver

License:        MIT
# Fedora-only patch: build a shared library instead of a static library
Patch0:         %{name}-shared.patch

BuildRequires:  drat-trim-tools
BuildRequires:  gcc-c++
BuildRequires:  glibc-langpack-en
BuildRequires:  help2man
BuildRequires:  zlib-devel
Requires:       %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}

CaDiCaL is a simplified Satisfiability solver.  The goal of the
development of CaDiCaL is to obtain a CDCL solver, which is easy to
understand and change, while at the same time not being much slower
than other state-of-the-art CDCL solvers.

%package libs
Summary:        Simplified SAT solver library

%description libs
This package contains the CaDiCaL simplified Satisfiability solver as a
library, for use in applications that need a SAT solver.

%package devel
Summary:        Development files for %{name}
Requires:       %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}

%description devel
Library links and header files for developing applications that use

%autosetup -p0 -n %{name}-rel-%{version}

# We have commas in optflags, so commas can't be used as sed delimiters in
# the configure script.  Also, do not override our build flags.
sed -i '/^-e/s/,/|/g;s/-O3/-O2/' configure

# The configure script is NOT generated by autoconf.  Do NOT use the
# %%configure macro here.
CXXFLAGS="%{optflags} -fPIC" ./configure %{?_smp_mflags}

# Make man pages for the command line interface
export LD_LIBRARY_PATH=$PWD/build
help2man --version-string=%{version} -N -o cadical.1 build/cadical
help2man --version-string=%{version} -N -o mobical.1 -h -h build/mobical

# The makefile has no install target.  Install by hand.
# Install the binaries
mkdir -p %{buildroot}%{_bindir}
cp -p build/{cad,mob}ical %{buildroot}%{_bindir}

# Install the library
mkdir -p %{buildroot}%{_libdir}
cp -p build/ %{buildroot}%{_libdir}
ln -s %{buildroot}%{_libdir}/
ln -s %{buildroot}%{_libdir}/

# Install the header files
mkdir -p %{buildroot}%{_includedir}
cp -p src/cadical.hpp %{buildroot}%{_includedir}
cp -p src/ccadical.h %{buildroot}%{_includedir}

# Install the man pages
mkdir -p %{buildroot}%{_mandir}/man1
cp -p *.1 %{buildroot}%{_mandir}/man1

# Prevent rebuilding the library while testing
sed -i '/make -C \$CADICALBUILD/d;/^make$/d' test/*/

# Some mobical tests randomly fail due to exceeding time or memory limits.
# Turn those tests off.
sed -i 's/ mbt$//' test/makefile

export LD_LIBRARY_PATH=$PWD/build
make -C test


%files libs
%license LICENSE

%files devel

* Wed Jul 24 2019 Jerry James <> - 1:1.0.3-3
- Bump Epoch to fix upgrades from version 06w

* Mon Jul 22 2019 Jerry James <> - 1.0.3-2
- Add ccadical.h to the -devel subpackage (bz 1731887)

* Sat Jul 13 2019 Jerry James <> - 1.0.3-1
- New upstream version
- Drop upstreamed -32bit patch

* Fri Jul 12 2019 Jerry James <> - 1.0.2-1
- New upstream version

* Sat Jun 29 2019 Jerry James <> - 1.0.0-1
- New upstream version

* Wed Jun 12 2019 Jerry James <> - 0-1.sr19
- New upstream version
- Adapt to upstream version scheme
- Drop upstreamed -vector patch
- Add -32bit patch
- Add man pages

* Thu Jan 31 2019 Fedora Release Engineering <> - 06w-3
- Rebuilt for

* Thu Jul 12 2018 Fedora Release Engineering <> - 06w-2
- Rebuilt for

* Fri Jul  6 2018 Jerry James <> - 06w-1
- Initial RPM