fix the failure of building with cppcheck>=2.11

This commit is contained in:
yixiangzhike 2023-07-25 16:41:21 +08:00
parent 84938aa683
commit ddddd219bf

View File

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