2007-01-16 00:28:17 +01:00
|
|
|
#
|
2011-03-30 11:49:22 +02:00
|
|
|
# spec file for package openssl-ibmca
|
2007-01-16 00:28:17 +01:00
|
|
|
#
|
2018-09-03 10:35:56 +02:00
|
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
2007-01-16 00:28:17 +01:00
|
|
|
#
|
2009-01-09 01:43:14 +01:00
|
|
|
# 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.
|
|
|
|
|
2018-11-21 00:36:22 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2007-01-16 00:28:17 +01:00
|
|
|
#
|
|
|
|
|
2008-04-10 15:18:46 +02:00
|
|
|
|
2007-01-16 00:28:17 +01:00
|
|
|
Name: openssl-ibmca
|
2018-11-27 19:05:19 +01:00
|
|
|
Version: 2.0.2
|
2016-04-28 16:54:31 +02:00
|
|
|
Release: 0
|
2007-01-16 00:28:17 +01:00
|
|
|
Summary: The IBMCA OpenSSL dynamic engine
|
2017-10-02 16:53:42 +02:00
|
|
|
License: Apache-2.0
|
2007-01-16 00:28:17 +01:00
|
|
|
Group: Hardware/Other
|
2018-11-21 00:36:22 +01:00
|
|
|
URL: https://github.com/opencryptoki/openssl-ibmca/
|
2017-10-02 16:53:42 +02:00
|
|
|
Source: openssl-ibmca-%{version}.tar.gz
|
2016-04-28 16:54:31 +02:00
|
|
|
Source1: baselibs.conf
|
2017-10-02 16:53:42 +02:00
|
|
|
BuildRequires: autoconf
|
|
|
|
BuildRequires: automake
|
|
|
|
BuildRequires: libica-devel >= 3.1.1
|
2017-04-14 13:41:49 +02:00
|
|
|
BuildRequires: libica-tools >= 2.4.0
|
2017-10-02 16:53:42 +02:00
|
|
|
BuildRequires: libtool
|
2016-04-28 16:54:31 +02:00
|
|
|
BuildRequires: openssl-devel
|
2013-12-13 11:59:53 +01:00
|
|
|
Requires: openssl
|
2015-03-27 09:39:56 +01:00
|
|
|
ExclusiveArch: s390 s390x
|
2007-01-16 00:28:17 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
This package contains a shared object OpenSSL dynamic engine for the
|
|
|
|
IBM eServer Cryptographic Accelerator (ICA).
|
|
|
|
|
|
|
|
%prep
|
2015-03-27 09:39:56 +01:00
|
|
|
%setup -q
|
2007-01-16 00:28:17 +01:00
|
|
|
|
|
|
|
%build
|
2017-09-23 21:36:11 +02:00
|
|
|
# The directory where crypto engines are located is owned by the libcrypto package.
|
|
|
|
# Find out where that is for this version of the distribution.
|
|
|
|
%define _ENGINE_DIR %(pkg-config --variable=enginesdir libcrypto)
|
|
|
|
|
2017-10-02 16:53:42 +02:00
|
|
|
autoreconf --force --install
|
2016-04-28 16:54:31 +02:00
|
|
|
export CFLAGS="%{optflags}"
|
|
|
|
export CPPFLAGS="%{optflags}"
|
|
|
|
%configure \
|
2017-09-23 21:36:11 +02:00
|
|
|
--libdir=%{_ENGINE_DIR}
|
2016-04-28 16:54:31 +02:00
|
|
|
make %{?_smp_mflags}
|
2007-01-16 00:28:17 +01:00
|
|
|
|
|
|
|
%install
|
2017-09-23 21:36:11 +02:00
|
|
|
# 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, = .*/, = %{_ENGINE_DIR}/," src/openssl.cnf.sample
|
|
|
|
|
2018-11-14 21:37:20 +01:00
|
|
|
%make_install
|
2018-09-03 10:35:56 +02:00
|
|
|
rm %{buildroot}/%{_ENGINE_DIR}/ibmca.la
|
2016-04-28 16:54:31 +02:00
|
|
|
|
|
|
|
%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
|
2016-10-18 10:41:29 +02:00
|
|
|
SSLSMP=%{_docdir}/%{name}/openssl.cnf.sample
|
2016-04-28 16:54:31 +02:00
|
|
|
|
|
|
|
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
|
2016-10-18 10:41:29 +02:00
|
|
|
SMPSZE=52 # Size in lines of original sample config file
|
2016-04-28 16:54:31 +02:00
|
|
|
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
|
2017-04-14 13:41:49 +02:00
|
|
|
if [ $1 -eq 0 ]; then # last uninstall, modify %%{_sysconfdir}/openssl.cnf (bsc#942839)
|
2016-04-28 16:54:31 +02:00
|
|
|
SSLCNF=%{_sysconfdir}/ssl/openssl.cnf
|
|
|
|
if [ -f ${SSLCNF}.orig ]; then
|
|
|
|
mv ${SSLCNF}.orig ${SSLCNF}
|
|
|
|
fi
|
|
|
|
fi
|
2007-01-16 00:28:17 +01:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-, root, root)
|
2018-11-14 21:37:20 +01:00
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
2016-04-28 16:54:31 +02:00
|
|
|
%doc src/openssl.cnf.sample
|
2018-09-03 10:35:56 +02:00
|
|
|
%{_ENGINE_DIR}/ibmca.*
|
2018-11-21 00:36:22 +01:00
|
|
|
%{_mandir}/man5/ibmca.5%{?ext_man}
|
2007-01-16 00:28:17 +01:00
|
|
|
|
2008-04-10 15:18:46 +02:00
|
|
|
%changelog
|