From 821561cda76330f720527ec85b63b0146cc2d324f8c234edf6cbabf78b8d0f24 Mon Sep 17 00:00:00 2001 From: Nikolay Gueorguiev Date: Mon, 18 Mar 2024 19:33:34 +0000 Subject: [PATCH 1/2] Accepting request 1159117 from home:ngueorguiev:branches:security:tls - Updated the .spec file (bsc#1218933, bsc#1221627) * Amended the .spec file to use modulesdir variable - Implemented _multibuild environment (openssl1, engine, provider) - Added a flag and logic for provider in the .spec file * When provider is set to 1, it 'configures' the provider * When provider is set to 0, it 'configures' the engine OBS-URL: https://build.opensuse.org/request/show/1159117 OBS-URL: https://build.opensuse.org/package/show/security:tls/openssl-ibmca?expand=0&rev=57 --- _multibuild | 5 ++++ openssl-ibmca.changes | 10 +++++++ openssl-ibmca.spec | 65 +++++++++++++++++++++++++++++++++++++------ 3 files changed, 72 insertions(+), 8 deletions(-) create mode 100644 _multibuild diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fb1e135 --- /dev/null +++ b/_multibuild @@ -0,0 +1,5 @@ + + openssl1 + engine + provider + diff --git a/openssl-ibmca.changes b/openssl-ibmca.changes index 1981e0a..6f3e2c9 100644 --- a/openssl-ibmca.changes +++ b/openssl-ibmca.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Mon Mar 18 19:18:47 UTC 2024 - Nikolay Gueorguiev + +- Updated the .spec file (bsc#1218933, bsc#1221627) + * Amended the .spec file to use modulesdir variable +- Implemented _multibuild environment (openssl1, engine, provider) +- Added a flag and logic for provider in the .spec file + * When provider is set to 1, it 'configures' the provider + * When provider is set to 0, it 'configures' the engine + ------------------------------------------------------------------- Fri Oct 13 10:39:42 UTC 2023 - Nikolay Gueorguiev diff --git a/openssl-ibmca.spec b/openssl-ibmca.spec index 9953aec..7f62c5d 100644 --- a/openssl-ibmca.spec +++ b/openssl-ibmca.spec @@ -1,7 +1,7 @@ # # spec file for package openssl-ibmca # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,9 +16,30 @@ # +%define flavor @BUILD_FLAVOR@%{nil} + +%if "%{flavor}" == "" %define openssl3 1 +%define provider 0 +%endif + +%if "%{flavor}" == "openssl1" +%define openssl3 0 +%define provider 0 +%endif + +%if "%{flavor}" == "engine" +%define openssl3 1 +%define provider 0 +%endif + +%if "%{flavor}" == "provider" +%define openssl3 1 +%define provider 1 +%endif %global enginesdir %(pkg-config --variable=enginesdir libcrypto) +%global modulesdir %(pkg-config --variable=modulesdir libcrypto) Name: openssl-ibmca Version: 2.4.1 @@ -29,6 +50,7 @@ Group: Hardware/Other URL: https://github.com/opencryptoki/openssl-ibmca Source: https://github.com/opencryptoki/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: engine_section.txt +Source2: _multibuild ### BuildRequires: autoconf BuildRequires: automake @@ -56,17 +78,38 @@ to libica, a library enabling the IBM s390/x CPACF crypto instructions. %build export CFLAGS="%{optflags}" export CPPFLAGS="%{optflags}" -%configure \ + +%if %{provider} + %configure \ + --disable-engine \ + --libdir=%{modulesdir} +%else + %configure \ + --disable-provider \ --libdir=%{enginesdir} +%endif + %make_build %install +%if %{provider} +# +### +# +%else # Update the sample config file so that the dynamic path points # to the correct version of the engines directory. sed -i -e "/^dynamic_path/s, = .*/, = %{enginesdir}/," src/engine/openssl.cnf.sample +%endif %make_install -rm %{buildroot}/%{enginesdir}/ibmca.la +%if %{provider} +# +### +# +%else +rm -f %{buildroot}/%{enginesdir}/ibmca.la +%endif # This file contains the declaration of the ibmca engine section. It # needs to be on the "real" file system when the postinstall scriptlet @@ -110,15 +153,21 @@ fi %doc ChangeLog %doc README.md %doc src/engine/openssl.cnf.sample -%doc src/engine/ibmca-engine-opensslconfig +%doc src/engine/ibmca-engine-opensslconfig.in %dir %{_datadir}/%{name} %{_datadir}/%{name}/openssl-ibmca.sectiondef.txt %{_datadir}/%{name}/openssl-ibmca.enginedef.cnf -%{enginesdir}/ibmca.* -%{_mandir}/man5/ibmca.5%{?ext_man} %if %{openssl3} - %{_mandir}/man5/ibmca-provider.5%{?ext_man} - %{enginesdir}/ibmca-provider.* + %if %{provider} + %{modulesdir}/ibmca-provider.* + %{_mandir}/man5/ibmca-provider.5%{?ext_man} + %else + %{enginesdir}/ibmca.* + %{_mandir}/man5/ibmca.5%{?ext_man} + %endif +%else + %{enginesdir}/ibmca.* + %{_mandir}/man5/ibmca.5%{?ext_man} %endif %changelog From b35925491cf4f40a0950c167bc1a53acddf8c03b794129704b6d62b23ff68187 Mon Sep 17 00:00:00 2001 From: Nikolay Gueorguiev Date: Tue, 19 Mar 2024 07:45:06 +0000 Subject: [PATCH 2/2] Accepting request 1159244 from home:ngueorguiev:branches:security:tls Updated the .spec file. OBS-URL: https://build.opensuse.org/request/show/1159244 OBS-URL: https://build.opensuse.org/package/show/security:tls/openssl-ibmca?expand=0&rev=58 --- openssl-ibmca.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openssl-ibmca.spec b/openssl-ibmca.spec index 7f62c5d..8709b6b 100644 --- a/openssl-ibmca.spec +++ b/openssl-ibmca.spec @@ -104,9 +104,7 @@ sed -i -e "/^dynamic_path/s, = .*/, = %{enginesdir}/," src/engine/openssl.cnf.sa %make_install %if %{provider} -# -### -# +rm -f %{buildroot}/%{modulesdir}/ibmca-provider.la %else rm -f %{buildroot}/%{enginesdir}/ibmca.la %endif