Name: cryptominisat4
Version: 4.5.3
Release: 5%{?dist}
Summary: SAT solver
License: LGPLv2
URL: http://www.msoos.org/cryptominisat4/
Source0: https://github.com/msoos/cryptominisat/archive/%{version}.tar.gz
# Text is from the sources, therefore under the same copyright and license as
# the code. Man page formatting contributed by Jerry James.
Source1: %{name}.1
BuildRequires: boost-devel
BuildRequires: chrpath
BuildRequires: cmake
BuildRequires: m4ri-devel
BuildRequires: python2-devel
BuildRequires: tbb-devel
%ifnarch s390
BuildRequires: valgrind-devel
%endif
BuildRequires: vim-common
BuildRequires: zlib-devel
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description
CryptoMiniSat is a modern, multi-threaded, feature-rich, simplifying SAT
solver. Highlights:
- Instance simplification at every point of the search (inprocessing)
- Over 100 configurable parameters to tune to specific needs
- Collection of statistical data to MySQL database + javascript-based
visualization of it
- Clean C++ and python interfaces
%package devel
Summary: Header files for developing with %{name}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: m4ri-devel%{?_isa}
Requires: tbb-devel%{?_isa}
%description devel
Header files for developing applications that use %{name}.
%package libs
Summary: Cryptominisat library
%description libs
The %{name} library.
%package -n python-%{name}
Summary: Python interface to %{name}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description -n python-%{name}
Python interface to %{name}.
%prep
%setup -q -n cryptominisat-%{version}
# Don't override our compiler flags
sed -i 's/-O2 -mtune=native/-DNDEBUG/' CMakeLists.txt
if [ "%{_libdir}" = "%{_prefix}/lib64" ]; then
sed -i 's,${dir}/lib,&64,g' cmake/FindPkgMacros.cmake
fi
# Fix the python install
sed -ri 's|install |&--root %{buildroot} |' python/CMakeLists.txt
%build
%cmake -DALSO_BUILD_STATIC_LIB=OFF .
make %{?_smp_mflags}
%install
make install DESTDIR=%{buildroot}
# Install the man page
mkdir -p %{buildroot}%{_mandir}/man1
sed 's/@VERSION@/%{version}/' %{SOURCE1} > \
%{buildroot}%{_mandir}/man1/%{name}.1
touch -r %{SOURCE1} %{buildroot}%{_mandir}/man1/%{name}.1
# Move library files to where they should go
if [ "%{_libdir}" = "/usr/lib64" ]; then
mkdir -p %{buildroot}%{_libdir}
mv %{buildroot}%{_prefix}/lib/lib%{name}* %{buildroot}%{_libdir}
mv %{buildroot}%{_prefix}/lib/cmake %{buildroot}%{_libdir}
sed -i 's|%{_prefix}/lib/|%{_libdir}/|' \
%{buildroot}%{_libdir}/cmake/%{name}/*.cmake
fi
# Remove buildroot paths from cmake files
sed -i 's|%{buildroot}||' %{buildroot}%{_libdir}/cmake/%{name}/*.cmake
# Remove rpaths
chrpath -d %{buildroot}%{_bindir}/%{name}
chrpath -d %{buildroot}%{_bindir}/%{name}_simple
# Fix permissions
chmod 0755 %{buildroot}%{python2_sitearch}/pycryptosat.so
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%files
%doc README.markdown
%{_bindir}/%{name}
%{_bindir}/%{name}_simple
%{_mandir}/man1/%{name}*
%files devel
%{_includedir}/%{name}/
%{_libdir}/lib%{name}.so
%{_libdir}/cmake/
%files libs
%doc AUTHORS
%license LICENSE-LGPL
%{_libdir}/lib%{name}.so.*
%files -n python-%{name}
%doc python/README.rst
%license python/LICENSE
%{python2_sitearch}/pycryptosat*
%changelog
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.5.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Fri Jan 15 2016 Jonathan Wakely <jwakely@redhat.com> - 4.5.3-4
- Rebuilt for Boost 1.60
* Fri Sep 04 2015 Jonathan Wakely <jwakely@redhat.com> - 4.5.3-3
- Rebuilt for Boost 1.59
* Fri Aug 28 2015 Jerry James <loganjerry@gmail.com> - 4.5.3-2
- Fix license
- Also remove rpath from cryptominisat4_simple
* Fri Aug 28 2015 Jerry James <loganjerry@gmail.com> - 4.5.3-1
- New upstream version
* Sat Aug 22 2015 Jerry James <loganjerry@gmail.com> - 4.5.2-1
- Initial RPM