# disable in source builds on EPEL <9 %undefine __cmake_in_source_build %undefine __cmake3_in_source_build # python2 is not available on RHEL > 7 and Fedora %if 0%{?rhel} > 7 || 0%{?fedora} %bcond_with python2 %else %bcond_without python2 %endif # python3 support is optional %bcond_without python3 Name: csdiff Version: 3.1.0.20231109.150230.gf482df6 Release: 1%{?dist} Summary: Non-interactive tools for processing code scan results in plain-text License: GPL-3.0-or-later URL: https://github.com/csutils/csdiff Source0: csdiff-3.1.0.20231109.150230.gf482df6.tar.gz # the following upstream commit is needed to work with up2date csdiff/csgrep # https://github.com/csutils/csmock/commit/48b09b3a Conflicts: csmock-plugin-shellcheck <= 2.5 # Use Boost 1.69 on EPEL 7 %if 0%{?rhel} == 7 BuildRequires: boost169-devel %endif # Use Boost 1.78 on EPEL 8 and 9 %if 0%{?rhel} == 8 || 0%{?rhel} == 9 BuildRequires: boost1.78-devel %endif # Use boost-devel everywhere else %if 0%{?rhel} > 9 || 0%{?fedora} BuildRequires: boost-devel %endif BuildRequires: cmake3 BuildRequires: gcc-c++ BuildRequires: help2man BuildRequires: make %if 0%{?rhel} == 7 Provides: bundled(boost_json) Provides: bundled(boost_nowide) %endif %description This package contains the csdiff tool for comparing code scan defect lists in order to find out added or fixed defects, and the csgrep utility for filtering defect lists using various filtering predicates. %if %{with python2} %package -n python2-%{name} Summary: Python interface to csdiff for Python 2 BuildRequires: python2-devel %py_provides python2-%{name} %description -n python2-%{name} This package contains the Python 2 binding for the csdiff tool for comparing code scan defect lists to find out added or fixed defects. %endif %if %{with python3} %package -n python3-%{name} Summary: Python interface to csdiff for Python 3 BuildRequires: python3-devel %py_provides python3-%{name} %description -n python3-%{name} This package contains the Python 3 binding for the csdiff tool for comparing code scan defect lists to find out added or fixed defects. %endif %prep %autosetup -n csdiff-3.1.0.20231109.150230.gf482df6 %build %if 0%{?rhel} == 7 # Set paths for CMake's FindBoost export BOOST_INCLUDEDIR=/usr/include/boost169 export BOOST_LIBRARYDIR=/usr/lib64/boost169 %endif make version.cc %cmake3 \ -DPYCSDIFF_PYTHON2=%{?with_python2:ON} \ -DPYCSDIFF_PYTHON3=%{?with_python3:ON} %cmake3_build %install %cmake3_install %check %ctest3 %files %doc README %license COPYING %{_bindir}/csdiff %{_bindir}/csgrep %{_bindir}/cshtml %{_bindir}/cslinker %{_bindir}/cssort %{_bindir}/cstrans-df-run %{_datadir}/%{name} %{_mandir}/man1/csdiff.1* %{_mandir}/man1/csgrep.1* %{_mandir}/man1/cshtml.1* %{_mandir}/man1/cslinker.1* %{_mandir}/man1/cssort.1* %{_mandir}/man1/cstrans-df-run.1* %if %{with python2} %files -n python2-%{name} %license COPYING %{python2_sitearch}/pycsdiff.so %endif %if %{with python3} %files -n python3-%{name} %license COPYING %{python3_sitearch}/pycsdiff.so %endif