File kissat.spec of Package kissat

#
# spec file for package kissat
#
# Copyright (c) 2025 Eyad Issa
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

%global lib_suffix 4_0_2
%global lib_name libkissat-%{lib_suffix}

Name:           kissat
Version:        4.0.2
Release:        0
Summary:        A KISS inspired SAT solver, written in C
License:        MIT
URL:            https://github.com/arminbiere/kissat
Source0:        %{URL}/archive/rel-%{version}/kissat-%{version}.tar.gz
BuildRequires:  gcc
%ifarch %{ix86}
Patch1:         fix32-bit.patch
%endif

%description
Kissat is a "keep it simple and clean bare metal SAT solver" written
in C.

It is a port of CaDiCaL back to C with improved data structures,
better scheduling of inprocessing and optimized algorithms and
implementation.


%package -n %{lib_name}
Summary:        Shared library for the KISS inspired SAT solver


%description -n %{lib_name}
Kissat is a "keep it simple and clean bare metal SAT solver" written
in C.

This package contains the shared library for kissat.


%package devel
Summary:        Development files for the KISS inspired SAT solver
Requires:       %{lib_name} = %{version}-%{release}


%description devel
Kissat is a "keep it simple and clean bare metal SAT solver" written
in C.

This package contains the development files for kissat, including
the .so symlink.


%prep
%autosetup -p1 -n kissat-rel-%{version}


%build
export MAKEFLAGS="$MAKEFLAGS --no-print-directory"
export CONFIGURE_FLAGS="-p -s -shared"
# not autotools configure
./configure $CONFIGURE_FLAGS
# build the library
%make_build


%install
# install the library
install -Dm755 build/libkissat.so %{buildroot}%{_libdir}/libkissat.%{version}.so
# create symlink for the library
ln -sf libkissat.%{version}.so    %{buildroot}%{_libdir}/libkissat.so
# install the header file
install -Dm644 src/kissat.h %{buildroot}%{_includedir}/kissat.h


%check
export MAKEFLAGS="$MAKEFLAGS --no-print-directory"
%make_build test


%files -n %{lib_name}
%doc README.md
%license LICENSE
%{_libdir}/libkissat.%{version}.so


%files devel
%{_libdir}/libkissat.so
%{_includedir}/kissat.h


%changelog
openSUSE Build Service is sponsored by