Calculate hmac file after installing for binary

This commit is contained in:
yixiangzhike 2023-04-28 12:38:02 +08:00
parent 29c1fdd52c
commit 2d64951dbc

View File

@ -8,9 +8,25 @@
%define enable_docbook_pdf 0 %define enable_docbook_pdf 0
%endif %endif
# Calculate hmac file after installing for binary
%define __spec_install_post \
%{?__debug_package:%{__debug_install_post}} \
%{__arch_install_post} \
%{__os_install_post} \
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sha1hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sha1hmac.hmac \
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sha224hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sha224hmac.hmac \
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sha256hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sha256hmac.hmac \
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sha384hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sha384hmac.hmac \
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sha512hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sha512hmac.hmac \
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sm3hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sm3hmac.hmac \
hardlink -cfv %{buildroot}%{_bindir} \
bin/kcapi-hasher -n fipshmac -d %{buildroot}/%{_lib}/fipscheck %{buildroot}/%{_lib}/libkcapi.so.%{version} || exit 1 \
ln -s libkcapi.so.%{version}.hmac %{buildroot}/%{_lib}/fipscheck/libkcapi.so.1.hmac \
%{nil}
Name: libkcapi Name: libkcapi
Version: 1.4.0 Version: 1.4.0
Release: 1 Release: 2
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
@ -157,17 +173,6 @@ done
%ldconfig_scriptlets %ldconfig_scriptlets
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sha1hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sha1hmac.hmac
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sha224hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sha224hmac.hmac
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sha256hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sha256hmac.hmac
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sha384hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sha384hmac.hmac
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sha512hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sha512hmac.hmac
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sm3hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sm3hmac.hmac
hardlink -cfv %{buildroot}%{_bindir}
bin/kcapi-hasher -n fipshmac -d %{buildroot}/%{_lib}/fipscheck %{buildroot}/%{_lib}/libkcapi.so.%{version} || exit 1
ln -s libkcapi.so.%{version}.hmac %{buildroot}/%{_lib}/fipscheck/libkcapi.so.1.hmac
%check %check
for t in cppcheck scan;do for t in cppcheck scan;do
%make_build $t %make_build $t
@ -214,6 +219,12 @@ popd
%{_mandir}/man3/kcapi_*.3.* %{_mandir}/man3/kcapi_*.3.*
%changelog %changelog
* Fri Apr 28 2023 yixiangzhike <yixiangzhike007@163.com> - 1.4.0-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:calculate hmac file after installing for binary
* Wed Nov 16 2022 yixiangzhike <yixiangzhike007@163.com> - 1.4.0-1 * Wed Nov 16 2022 yixiangzhike <yixiangzhike007@163.com> - 1.4.0-1
- Type:enhancement - Type:enhancement
- ID:NA - ID:NA