Clean up cppcheck conditional

Move it up near the other conditional macro defs and utilize it for the
temporary cppcheck disablement.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
This commit is contained in:
Ondrej Mosnacek 2021-03-24 10:39:26 +01:00
parent f0029bf72c
commit eee399ccc3

View File

@ -22,6 +22,14 @@
%else
%bcond_with test_package
%endif
# disable cppcheck analysis in ELN/RHEL to avoid the dependency bz#1931518
%if 0%{?rhel}
%bcond_with cppcheck
%else
# Temporarily disable cppcheck on Fedora until bz#1923600 is fixed in rawhide
%bcond_with cppcheck
#bcond_without cppcheck
%endif
# This package needs at least Linux Kernel v4.10.0.
%global min_kernel_ver 4.10.0
@ -106,13 +114,6 @@ done \
"$lib_path"/fipscheck/libkcapi.so.%{vmajor}.hmac \
%{nil}
# disable cppcheck analysis in ELN/RHEL to avoid the dependency bz#1931518
%if 0%{?rhel}
%bcond_with cppcheck
%else
%bcond_without cppcheck
%endif
Name: libkcapi
Version: %{vmajor}.%{vminor}.%{vpatch}
Release: 1%{?dist}
@ -139,11 +140,9 @@ BuildRequires: perl-interpreter
BuildRequires: systemd
BuildRequires: xmlto
BuildRequires: make
#Temoporarily disabling cppcheck on Fedora untill #bz1923600
#is fixed in rawhide
#%if %{with cppcheck}
#BuildRequires: cppcheck
#%endif
%if %{with cppcheck}
BuildRequires: cppcheck
%endif
# For ownership of %%{_sysctldir}.
Requires: systemd
@ -387,11 +386,9 @@ done
%check
# Some basic sanity checks.
%make_build scan
#Temoporarily disabling cppcheck on Fedora untill #bz1923600
#is fixed in rawhide
#%if %{with cppcheck}
#%make_build cppcheck
#%endif
%if %{with cppcheck}
%make_build cppcheck
%endif
# On some arches `/proc/sys/net/core/optmem_max` is lower than 20480,
# which is the lowest limit needed to run the testsuite. If that limit