From a0fb801c292b1d2d31061856bbbdebf52707d525 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Wed, 12 Feb 2025 14:44:09 +0800 Subject: [PATCH] obsoletes fipscheck package --- libkcapi.spec | 76 +++++++++++++++++++++++++++++++++------------------ libkcapi.yaml | 2 +- 2 files changed, 51 insertions(+), 27 deletions(-) diff --git a/libkcapi.spec b/libkcapi.spec index 2679a9f..9d64918 100644 --- a/libkcapi.spec +++ b/libkcapi.spec @@ -6,27 +6,35 @@ # if you don't need pdf and ps document. %global enable_docbook_pdf 1 -%global hmaccalc_apps sha1hmac sha224hmac sha256hmac sha384hmac sha512hmac sm3hmac +%global hmaccalc_apps sha1hmac sha224hmac sha256hmac sha384hmac sha512hmac sm3hmac fipscheck fipshmac # 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}/kcapi-hasher | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/kcapi-hasher.hmac \ -bin/kcapi-hasher -n sha512hmac %{buildroot}/%{_lib}/libkcapi.so.%{version} | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/libkcapi.so.%{version}.hmac \ -ln -s libkcapi.so.%{version}.hmac %{buildroot}/%{_lib}/hmaccalc/libkcapi.so.1.hmac \ +# Add generation of HMAC checksum of the final stripped +# binary. %%define with lazy globbing is used here +# intentionally, because using %%global does not work. +%define __spec_install_post \ +%{?__debug_package:%{__debug_install_post}} \ +%{__arch_install_post} \ +%{__os_install_post} \ +bin_path=%{buildroot}%{_bindir} \ +lib_path=%{buildroot}/%{_lib} \ +{ bin/kcapi-hasher -n sha512hmac "$bin_path"/kcapi-hasher || exit 1; } | \\\ + cut -f 1 -d ' ' >"$lib_path"/hmaccalc/kcapi-hasher.hmac \ +{ bin/kcapi-hasher -n sha512hmac "$lib_path"/libkcapi.so.%{version} || exit 1; } | \\\ + cut -f 1 -d ' ' >"$lib_path"/hmaccalc/libkcapi.so.%{version}.hmac \ +%{__ln_s} libkcapi.so.%{version}.hmac \\\ + "$lib_path"/hmaccalc/libkcapi.so.1.hmac \ %{nil} Name: libkcapi Version: 1.5.0 -Release: 1 +Release: 13 Summary: libkcapi - Linux Kernel Crypto API User Space Interface Library -License: BSD or GPLv2 -URL: http://www.chronox.de/%{name}/ -Source0: http://www.chronox.de/%{name}/releases/%{version}/%{name}-%{version}.tar.xz -Source1: http://www.chronox.de/%{name}/releases/%{version}/%{name}-%{version}.tar.xz.asc +License: BSD-3-Clause OR GPL-2.0-only +URL: https://www.chronox.de/%{name}/ +Source0: https://www.chronox.de/%{name}/releases/%{version}/%{name}-%{version}.tar.xz +Source1: https://www.chronox.de/%{name}/releases/%{version}/%{name}-%{version}.tar.xz.asc Patch0: libkcapi-1.1.1-lib_Fix_kcapi_handle_destroy_closing_FD_0.patch @@ -56,17 +64,17 @@ Results from the kernel crypto API are returned to the consumer via the library %package devel Summary: Development files for the %{name} package -Requires: %{name} == %{version}-%{release} +Requires: %{name} = %{version}-%{release} -Obsoletes: %{name}-static -Provides: %{name}-static +Obsoletes: %{name}-static < %{version}-%{release} +Provides: %{name}-static = %{version}-%{release} %description devel Header files for applications that use %{name}. %package tests Summary: Testing scripts for the %{name} package -Requires: %{name}%{?_isa} == %{version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}-tools Requires: %{name}-hmaccalc Requires: coreutils @@ -76,6 +84,17 @@ Requires: perl %description tests Auxiliary scripts for testing %{name}. +%package fipscheck +Summary: Drop-in replacements for fipscheck/fipshmac provided by the %{name} package +Requires: %{name} = %{version}-%{release} +Obsoletes: fipscheck < %{version}-%{release} +Provides: fipscheck = %{version}-%{release} +Provides: fipscheck%{?_isa} = %{version}-%{release} + +%description fipscheck +Provides drop-in replacements for fipscheck and fipshmac tools (from +package fipscheck) using %{name}. + %package_help %prep @@ -142,6 +161,7 @@ sed -i -e 's|/xml/4\.5/|/xml/4.1.2/|' lib/doc/libkcapi.tmpl %install %make_install +%delete_la # Install sysctl.d preset. mkdir -p %{buildroot}%{_sysctldir} @@ -155,13 +175,6 @@ install -Dpm 0644 -t %{buildroot}%{_pkgdocdir} doc/%{name}.p{df,s} %endif cp -pr lib/doc/html %{buildroot}%{_pkgdocdir} -# Install replacement tools, if enabled. -rm -f %{buildroot}%{_libexecdir}/%{name}/md5sum \ - %{buildroot}%{_libexecdir}/%{name}/sha*sum \ - %{buildroot}%{_libexecdir}/%{name}/fips* \ - %{buildroot}%{_libexecdir}/%{name}/sm*sum - -find %{buildroot} -type f -name '*.la' -print -delete find %{buildroot} -type f -name '*.hmac' -print -delete find %{buildroot} -type f -size 0 -print -delete find %{buildroot}%{_pkgdocdir} -type f -print | xargs %{__chmod} -c 0644 @@ -176,8 +189,6 @@ for app in %hmaccalc_apps; do ln -s ../libexec/%{name}/$app %{buildroot}%{_bindir}/$app done -%ldconfig_scriptlets - %check %make_build scan %make_build cppcheck CPPCHECK="cppcheck --check-level=exhaustive -UCHECK_DIR" @@ -199,6 +210,10 @@ popd %{_bindir}/kcapi* %{_bindir}/sha*hmac %{_bindir}/sm*hmac +%{_libexecdir}/%{name}/md5sum +%{_libexecdir}/%{name}/sha*sum +%{_libexecdir}/%{name}/sm*sum +%{_libexecdir}/%{name}/fips* %{_libexecdir}/%{name}/sha*hmac %{_libexecdir}/%{name}/sm*hmac /%{_lib}/hmaccalc/kcapi-hasher.hmac @@ -217,6 +232,9 @@ popd %{_libexecdir}/%{name}/kcapi-enc-test-large %{_libexecdir}/%{name}/*.sh +%files fipscheck +%{_bindir}/fips* + %files help %doc %{_pkgdocdir} %exclude %{_pkgdocdir}/README.md @@ -227,6 +245,12 @@ popd %{_mandir}/man3/kcapi_*.3.* %changelog +* Sat Feb 01 2025 Funda Wang - 1.5.0-13 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:obsoletes fipscheck package + * Wed Dec 11 2024 yixiangzhike - 1.5.0-1 - Type:enhancement - ID:NA diff --git a/libkcapi.yaml b/libkcapi.yaml index c1b8873..ffaf8e3 100644 --- a/libkcapi.yaml +++ b/libkcapi.yaml @@ -1,4 +1,4 @@ version_control: github src_repo: smuellerDD/libkcapi tag_prefix: ^v -seperator: . +separator: . -- Gitee