forked from pool/openssl-ibmca
0e4a3b4ec5
* openssl-ibmca 2.2.1 Bug fixes * openssl-ibmca 2.2.0 Implement fallbacks based on OpenSSL Disable software fallbacks from libica Allow to specify default library (libica vs. libica-cex) to use Provide "libica" engine ctrl to switch library at load time Update README.md Remove libica link dependency Generate sample configuration files from system configuration Restructure registration global data * openssl-ibmca 2.1.3 Bug fix * openssl-ibmca 2.1.2 Bug fixes - Modified spec file to * Define a global variable enginedir the same was as IBM does instead of _ENGINE_DIR as we had been doing. * Implemented %make_build macro according to spec-cleaner * Changed the package description to match IBM's. * Removed the redundant "autoreconf --force --install" OBS-URL: https://build.opensuse.org/package/show/security:tls/openssl-ibmca?expand=0&rev=27
125 lines
4.2 KiB
RPMSpec
125 lines
4.2 KiB
RPMSpec
#
|
|
# spec file for package openssl-ibmca
|
|
#
|
|
# Copyright (c) 2021 SUSE LLC
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%global enginesdir %(pkg-config --variable=enginesdir libcrypto)
|
|
|
|
Name: openssl-ibmca
|
|
Version: 2.2.1
|
|
Release: 0
|
|
Summary: The IBMCA OpenSSL dynamic engine
|
|
License: Apache-2.0
|
|
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: baselibs.conf
|
|
|
|
BuildRequires: autoconf
|
|
BuildRequires: automake
|
|
BuildRequires: libica-devel >= 3.1.1
|
|
BuildRequires: libica-tools >= 2.4.0
|
|
BuildRequires: libtool
|
|
BuildRequires: openssl-devel
|
|
Requires: libica3
|
|
Requires: openssl
|
|
ExclusiveArch: s390x
|
|
|
|
%description
|
|
This package contains a shared object OpenSSL dynamic engine which interfaces
|
|
to libica, a library enabling the IBM s390/x CPACF crypto instructions.
|
|
|
|
%prep
|
|
%autosetup
|
|
./bootstrap.sh
|
|
|
|
%build
|
|
export CFLAGS="%{optflags}"
|
|
export CPPFLAGS="%{optflags}"
|
|
%configure \
|
|
--libdir=%{enginesdir}
|
|
%make_build
|
|
|
|
%install
|
|
# 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/openssl.cnf.sample
|
|
|
|
%make_install
|
|
rm %{buildroot}/%{enginesdir}/ibmca.la
|
|
|
|
%post
|
|
#Original fix for bsc#942839 was to update on first install
|
|
#For bsc#966139 update if openssl_def not found
|
|
SSLCNF=%{_sysconfdir}/ssl/openssl.cnf
|
|
SSLSMP=%{_docdir}/%{name}/openssl.cnf.sample
|
|
|
|
if [ -f ${SSLCNF} -a -f ${SSLSMP} ]; then
|
|
if grep '^openssl_conf[[:space:]]*=[[:space:]]*openssl_def$' ${SSLCNF} >/dev/null 2>&1; then
|
|
# Config already installed. Update library path if necessary
|
|
SECTSTART=$(grep -n '\[ibmca_section\]' ${SSLCNF} | head -n1 | cut -d':' -f1)
|
|
REPLINE=""
|
|
if [ "z${SECTSTART}" != "z" ]; then
|
|
REPLINE=$((SECTSTART - 1 + $(tail -n+${SECTSTART} ${SSLCNF} | grep -n 'dynamic_path' | head -n1 | cut -d':' -f1) ))
|
|
fi
|
|
if [ "z${REPLINE}" != "z" ]; then
|
|
head -n$((REPLINE - 1)) ${SSLCNF} > ${SSLCNF}.temp
|
|
grep 'dynamic_path' ${SSLSMP} >> ${SSLCNF}.temp
|
|
tail -n+$((REPLINE + 1)) ${SSLCNF} >> ${SSLCNF}.temp
|
|
mv ${SSLCNF}.temp ${SSLCNF}
|
|
fi
|
|
else
|
|
CNFSZE=350 # Size in lines of original openssl.cnf
|
|
SMPSZE=52 # Size in lines of original sample config file
|
|
CNFINS=9 # Line number in openssl.cnf to insert new line
|
|
SMPUSE=11 # Line number in sample to copy from
|
|
if [ $(wc -l ${SSLCNF} | cut -d ' ' -f 1) -ne ${CNFSZE} ]; then
|
|
echo Original ${SSLCNF} incorrect size. Please manually update from ${SSLSMP}
|
|
elif [ $(wc -l ${SSLSMP} | cut -d ' ' -f 1) -ne ${SMPSZE} ]; then
|
|
echo Original ${SSLSMP} incorrect size. Please manually update to ${SSLCNF}
|
|
else
|
|
mv ${SSLCNF} ${SSLCNF}.orig
|
|
head -n ${CNFINS} ${SSLCNF}.orig > ${SSLCNF}
|
|
head -n ${SMPUSE} ${SSLSMP} | tail -n 1 >> ${SSLCNF}
|
|
tail -n $((CNFSZE - CNFINS)) ${SSLCNF}.orig >> ${SSLCNF}
|
|
head -n $((SMPUSE - 1)) ${SSLSMP} >> ${SSLCNF}
|
|
tail -n $((SMPSZE - SMPUSE)) ${SSLSMP} >> ${SSLCNF}
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
%postun
|
|
if [ $1 -eq 0 ]; then # last uninstall, modify %%{_sysconfdir}/openssl.cnf (bsc#942839)
|
|
SSLCNF=%{_sysconfdir}/ssl/openssl.cnf
|
|
if [ -f ${SSLCNF}.orig ]; then
|
|
mv ${SSLCNF}.orig ${SSLCNF}
|
|
fi
|
|
fi
|
|
|
|
%files
|
|
%license LICENSE
|
|
%doc README.md
|
|
%doc src/openssl.cnf.sample
|
|
%doc src/openssl.cnf.defaultlibica
|
|
%doc src/openssl.cnf.libica
|
|
%doc src/openssl.cnf.libica-cex
|
|
%dir %{_datadir}/%{name}
|
|
%{_datadir}/%{name}/openssl.cnf.*
|
|
%{enginesdir}/ibmca.*
|
|
%{_mandir}/man5/ibmca.5%{?ext_man}
|
|
|
|
%changelog
|