!57 【Mainline】fix the failure of building with cppcheck>=2.11

From: @yixiangzhike 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
This commit is contained in:
openeuler-ci-bot 2023-07-25 10:12:19 +00:00 committed by Gitee
commit 9c559eb88b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -8,6 +8,9 @@
%define enable_docbook_pdf 0
%endif
# check failed with cppcheck >= 2.11
%define min_cppcheck %pkg_version_cmp cppcheck 2.11
# Calculate hmac file after installing for binary
%define __spec_install_post \
%{?__debug_package:%{__debug_install_post}} \
@ -26,7 +29,7 @@ ln -s libkcapi.so.%{version}.hmac %{buildroot}/%{_lib}/fipscheck/libkcapi.so.
Name: libkcapi
Version: 1.4.0
Release: 2
Release: 3
Summary: libkcapi - Linux Kernel Crypto API User Space Interface Library
License: BSD or GPLv2
@ -174,6 +177,10 @@ done
%ldconfig_scriptlets
%check
%if %{min_cppcheck} >= 0
# add -UCHECK_DIR to cppcheck with cppcheck >= 2.11
sed -i 's/\$(CPPCHECK)/\$(CPPCHECK) -UCHECK_DIR/' Makefile
%endif
for t in cppcheck scan;do
%make_build $t
done
@ -219,6 +226,12 @@ popd
%{_mandir}/man3/kcapi_*.3.*
%changelog
* Tue Jul 25 2023 yixiangzhike <yixiangzhike007@163.com> - 1.4.0-3
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix the failure of building with cppcheck >= 2.11
* Fri Apr 28 2023 yixiangzhike <yixiangzhike007@163.com> - 1.4.0-2
- Type:bugfix
- ID:NA