File cbmc.spec of Package cbmc
#
# spec file for package cbmc
#
# Copyright (c) 2022 SUSE LLC
#
# 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/
#
Name: cbmc
URL: https://github.com/diffblue/cbmc/
Version: 6.0.0
Release: 0
Summary: Bounded Model Checking for Software
License: BSD-3-Clause
Group: Development/Tools/Other
Source0: https://github.com/diffblue/cbmc/archive/refs/tags/cbmc-%{version}.tar.gz
Patch0: 0001-don-t-add-static-minisat-lib.patch
Patch1: 0002-do-not-build-with-Werror.patch
Patch2: 0003-make-bash_completion-conforming-to-SUSE.patch
Patch3: 0004-do-not-run-c_library_check.patch
BuildRequires: bison
BuildRequires: cmake
BuildRequires: flex
%if 0%{suse_version} < 1600
BuildRequires: gcc14-c++
%else
BuildRequires: gcc-c++
%endif
BuildRequires: minisat-devel
BuildRequires: ninja
%description
CBMC is a Bounded Model Checker for C and C++ programs. It supports C89, C99,
most of C11 and most compiler extensions provided by gcc and Visual Studio. It
also supports SystemC using Scoot. It allows verifying array bounds (buffer
overflows), pointer safety, exceptions and user-specified assertions.
Furthermore, it can check C and C++ for consistency with other languages, such
as Verilog. The verification is performed by unwinding the loops in the program
and passing the resulting equation to a decision procedure.
%prep
%autosetup -p1 -n cbmc-cbmc-%{version}
sed -i '1s@/usr/bin/env python3@/usr/bin/python3@' scripts/ls_parse.py
sed -i '1{/#!\/bin\/bash/ d}' scripts/bash-autocomplete/cbmc.sh.template
%build
%define __builder ninja
%if 0%{suse_version} < 1600
export CXX=g++-14
%endif
%cmake -DWITH_JBMC=OFF -DBUILD_SHARED_LIBS=OFF -Dsat_impl=system-minisat2
%cmake_build
%install
%cmake_install
chmod 0755 %{buildroot}%{_bindir}/ls_parse.py
# it provides only a static lib -- useless
rm -fr %{buildroot}%{_includedir}/
rm -f %{buildroot}%{_libdir}/*.a
%files
%doc README.md
%license LICENSE
%{_bindir}/*
%{_datadir}/bash-completion/completions/cbmc
%{_mandir}/man1/*.1*
%changelog