Blame rpm/opencryptoki.spec

Packit 8681c6
%global _hardened_build 1
Packit 8681c6
Packit 8681c6
Name:			opencryptoki
Packit Service 8aa27d
Summary:		Implementation of the PKCS#11 (Cryptoki) specification v3.0
Packit Service 8aa27d
Version:		3.15.1
Packit 8681c6
Release:		1%{?dist}
Packit 8681c6
License:		CPL
Packit 8681c6
Group:			System Environment/Base
Packit 8681c6
URL:			https://github.com/opencryptoki/opencryptoki
Packit 8681c6
Source:			https://github.com/%{name}/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Packit 8681c6
Packit 8681c6
Requires(pre):		coreutils
Packit 8681c6
BuildRequires:		openssl-devel >= 1.0.2
Packit 8681c6
BuildRequires:		trousers-devel
Packit 8681c6
BuildRequires:		openldap-devel
Packit 8681c6
BuildRequires:		autoconf automake libtool
Packit 8681c6
BuildRequires:		bison flex
Packit 8681c6
BuildRequires:		systemd
Packit 8681c6
BuildRequires:		libitm-devel
Packit 8681c6
%ifarch s390 s390x
Packit 8681c6
BuildRequires:		libica-devel >= 3.3
Packit 8681c6
%endif
Packit 8681c6
Requires(pre):		%{name}-libs%{?_isa} = %{version}-%{release}
Packit 8681c6
Requires:		%{name}-libs%{?_isa} = %{version}-%{release}
Packit 8681c6
Requires:		%{name}(token)
Packit 8681c6
Requires(post):		systemd
Packit 8681c6
Requires(preun):	systemd
Packit 8681c6
Requires(postun):	systemd
Packit 8681c6
Packit 8681c6
Packit 8681c6
%description
Packit 8681c6
Opencryptoki implements the PKCS#11 specification v2.20 for a set of
Packit 8681c6
cryptographic hardware, such as IBM 4764 and 4765 crypto cards, and the
Packit 8681c6
Trusted Platform Module (TPM) chip. Opencryptoki also brings a software
Packit 8681c6
token implementation that can be used without any cryptographic
Packit 8681c6
hardware.
Packit 8681c6
This package contains the Slot Daemon (pkcsslotd) and general utilities.
Packit 8681c6
Packit 8681c6
Packit 8681c6
%package libs
Packit 8681c6
Group:			System Environment/Libraries
Packit 8681c6
Summary:		The run-time libraries for opencryptoki package
Packit 8681c6
Requires(pre):		shadow-utils
Packit 8681c6
Packit 8681c6
%description libs
Packit 8681c6
Opencryptoki implements the PKCS#11 specification v2.20 for a set of
Packit 8681c6
cryptographic hardware, such as IBM 4764 and 4765 crypto cards, and the
Packit 8681c6
Trusted Platform Module (TPM) chip. Opencryptoki also brings a software
Packit 8681c6
token implementation that can be used without any cryptographic
Packit 8681c6
hardware.
Packit 8681c6
This package contains the PKCS#11 library implementation, and requires
Packit 8681c6
at least one token implementation (packaged separately) to be fully
Packit 8681c6
functional.
Packit 8681c6
Packit 8681c6
Packit 8681c6
%package devel
Packit 8681c6
Group:			Development/Libraries
Packit 8681c6
Summary:		Development files for openCryptoki
Packit 8681c6
Requires:		%{name}-libs%{?_isa} = %{version}-%{release}
Packit 8681c6
Packit 8681c6
%description devel
Packit 8681c6
This package contains the development header files for building
Packit 8681c6
opencryptoki and PKCS#11 based applications
Packit 8681c6
Packit 8681c6
Packit 8681c6
%package swtok
Packit 8681c6
Group:			System Environment/Libraries
Packit 8681c6
Summary:		The software token implementation for opencryptoki
Packit 8681c6
Requires(pre):		%{name}-libs%{?_isa} = %{version}-%{release}
Packit 8681c6
Requires:		%{name}-libs%{?_isa} = %{version}-%{release}
Packit 8681c6
Provides:		%{name}(token)
Packit 8681c6
Packit 8681c6
%description swtok
Packit 8681c6
Opencryptoki implements the PKCS#11 specification v2.20 for a set of
Packit 8681c6
cryptographic hardware, such as IBM 4764 and 4765 crypto cards, and the
Packit 8681c6
Trusted Platform Module (TPM) chip. Opencryptoki also brings a software
Packit 8681c6
token implementation that can be used without any cryptographic
Packit 8681c6
hardware.
Packit 8681c6
This package brings the software token implementation to use opencryptoki
Packit 8681c6
without any specific cryptographic hardware.
Packit 8681c6
Packit 8681c6
Packit 8681c6
%package tpmtok
Packit 8681c6
Group:			System Environment/Libraries
Packit 8681c6
Summary:		Trusted Platform Module (TPM) device support for opencryptoki
Packit 8681c6
Requires(pre):		%{name}-libs%{?_isa} = %{version}-%{release}
Packit 8681c6
Requires:		%{name}-libs%{?_isa} = %{version}-%{release}
Packit 8681c6
Provides:		%{name}(token)
Packit 8681c6
Packit 8681c6
%description tpmtok
Packit 8681c6
Opencryptoki implements the PKCS#11 specification v2.20 for a set of
Packit 8681c6
cryptographic hardware, such as IBM 4764 and 4765 crypto cards, and the
Packit 8681c6
Trusted Platform Module (TPM) chip. Opencryptoki also brings a software
Packit 8681c6
token implementation that can be used without any cryptographic
Packit 8681c6
hardware.
Packit 8681c6
This package brings the necessary libraries and files to support
Packit 8681c6
Trusted Platform Module (TPM) devices in the opencryptoki stack.
Packit 8681c6
Packit 8681c6
Packit 8681c6
%package icsftok
Packit 8681c6
Group:			System Environment/Libraries
Packit 8681c6
Summary:		ICSF token support for opencryptoki
Packit 8681c6
Requires(pre):		%{name}-libs%{?_isa} = %{version}-%{release}
Packit 8681c6
Requires:		%{name}-libs%{?_isa} = %{version}-%{release}
Packit 8681c6
Provides:		%{name}(token)
Packit 8681c6
Packit 8681c6
%description icsftok
Packit 8681c6
Opencryptoki implements the PKCS#11 specification v2.20 for a set of
Packit 8681c6
cryptographic hardware, such as IBM 4764 and 4765 crypto cards, and the
Packit 8681c6
Trusted Platform Module (TPM) chip. Opencryptoki also brings a software
Packit 8681c6
token implementation that can be used without any cryptographic
Packit 8681c6
hardware.
Packit 8681c6
This package brings the necessary libraries and files to support
Packit 8681c6
ICSF token in the opencryptoki stack.
Packit 8681c6
Packit 8681c6
Packit 8681c6
%ifarch s390 s390x
Packit 8681c6
%package icatok
Packit 8681c6
Group:			System Environment/Libraries
Packit 8681c6
Summary:		ICA cryptographic devices (clear-key) support for opencryptoki
Packit 8681c6
Requires(pre):		%{name}-libs%{?_isa} = %{version}-%{release}
Packit 8681c6
Requires:		%{name}-libs%{?_isa} = %{version}-%{release}
Packit 8681c6
Provides:		%{name}(token)
Packit 8681c6
Packit 8681c6
%description icatok
Packit 8681c6
Opencryptoki implements the PKCS#11 specification v2.20 for a set of
Packit 8681c6
cryptographic hardware, such as IBM 4764 and 4765 crypto cards, and the
Packit 8681c6
Trusted Platform Module (TPM) chip. Opencryptoki also brings a software
Packit 8681c6
token implementation that can be used without any cryptographic
Packit 8681c6
hardware.
Packit 8681c6
This package brings the necessary libraries and files to support ICA
Packit 8681c6
devices in the opencryptoki stack. ICA is an interface to IBM
Packit 8681c6
cryptographic hardware such as IBM 4764 or 4765 that uses the
Packit 8681c6
"accelerator" or "clear-key" path.
Packit 8681c6
Packit 8681c6
%package ccatok
Packit 8681c6
Group:			System Environment/Libraries
Packit 8681c6
Summary:		CCA cryptographic devices (secure-key) support for opencryptoki
Packit 8681c6
Requires(pre):		%{name}-libs%{?_isa} = %{version}-%{release}
Packit 8681c6
Requires:		%{name}-libs%{?_isa} = %{version}-%{release}
Packit 8681c6
Provides:		%{name}(token)
Packit 8681c6
Packit 8681c6
%description ccatok
Packit 8681c6
Opencryptoki implements the PKCS#11 specification v2.20 for a set of
Packit 8681c6
cryptographic hardware, such as IBM 4764 and 4765 crypto cards, and the
Packit 8681c6
Trusted Platform Module (TPM) chip. Opencryptoki also brings a software
Packit 8681c6
token implementation that can be used without any cryptographic
Packit 8681c6
hardware.
Packit 8681c6
This package brings the necessary libraries and files to support CCA
Packit 8681c6
devices in the opencryptoki stack. CCA is an interface to IBM
Packit 8681c6
cryptographic hardware such as IBM 4764 or 4765 that uses the
Packit 8681c6
"co-processor" or "secure-key" path.
Packit 8681c6
Packit 8681c6
%package ep11tok
Packit 8681c6
Group:			System Environment/Libraries
Packit 8681c6
Summary:		EP11 cryptographic devices (secure-key) support for opencryptoki
Packit 8681c6
Requires(pre):		%{name}-libs%{?_isa} = %{version}-%{release}
Packit 8681c6
Requires:		%{name}-libs%{?_isa} = %{version}-%{release}
Packit 8681c6
Provides:		%{name}(token)
Packit 8681c6
Packit 8681c6
%description ep11tok
Packit 8681c6
Opencryptoki implements the PKCS#11 specification v2.20 for a set of
Packit 8681c6
cryptographic hardware, such as IBM 4764 and 4765 crypto cards, and the
Packit 8681c6
Trusted Platform Module (TPM) chip. Opencryptoki also brings a software
Packit 8681c6
token implementation that can be used without any cryptographic
Packit 8681c6
hardware.
Packit 8681c6
This package brings the necessary libraries and files to support EP11
Packit 8681c6
tokens in the opencryptoki stack. The EP11 token is a token that uses
Packit 8681c6
the IBM Crypto Express adapters (starting with Crypto Express 4S adapters)
Packit 8681c6
configured with Enterprise PKCS#11 (EP11) firmware.
Packit 8681c6
%endif
Packit 8681c6
Packit 8681c6
Packit 8681c6
%prep
Packit 8681c6
%setup -q -n %{name}-%{version}
Packit 8681c6
Packit 8681c6
%build
Packit 8681c6
./bootstrap.sh
Packit 8681c6
Packit 8681c6
%configure --with-systemd=%{_unitdir}	\
Packit 8681c6
%ifarch s390 s390x
Packit 8681c6
    --enable-icatok --enable-ccatok --enable-ep11tok --enable-pkcsep11_migrate
Packit 8681c6
%else
Packit 8681c6
    --disable-icatok --disable-ccatok --disable-ep11tok --disable-pkcsep11_migrate --disable-pkcscca_migrate
Packit 8681c6
%endif
Packit 8681c6
Packit 8681c6
make %{?_smp_mflags} CHGRP=/bin/true
Packit 8681c6
Packit 8681c6
%install
Packit 8681c6
make install DESTDIR=$RPM_BUILD_ROOT CHGRP=/bin/true
Packit 8681c6
Packit 8681c6
# Remove unwanted cruft
Packit 8681c6
rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/*.la
Packit 8681c6
rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/stdll/*.la
Packit 8681c6
Packit 8681c6
%post libs -p /sbin/ldconfig
Packit 8681c6
%post swtok -p /sbin/ldconfig
Packit 8681c6
%post tpmtok -p /sbin/ldconfig
Packit 8681c6
%post icsftok -p /sbin/ldconfig
Packit 8681c6
%ifarch s390 s390x
Packit 8681c6
%post icatok -p /sbin/ldconfig
Packit 8681c6
%post ccatok -p /sbin/ldconfig
Packit 8681c6
%post ep11tok -p /sbin/ldconfig
Packit 8681c6
%endif
Packit 8681c6
Packit 8681c6
%postun libs -p /sbin/ldconfig
Packit 8681c6
%postun swtok -p /sbin/ldconfig
Packit 8681c6
%postun tpmtok -p /sbin/ldconfig
Packit 8681c6
%postun icsftok -p /sbin/ldconfig
Packit 8681c6
%ifarch s390 s390x
Packit 8681c6
%postun icatok -p /sbin/ldconfig
Packit 8681c6
%postun ccatok -p /sbin/ldconfig
Packit 8681c6
%postun ep11tok -p /sbin/ldconfig
Packit 8681c6
%endif
Packit 8681c6
Packit 8681c6
%pre libs
Packit 8681c6
# Create pkcs11 group
Packit 8681c6
getent group pkcs11 >/dev/null || groupadd -r pkcs11
Packit 8681c6
exit 0
Packit 8681c6
Packit 8681c6
%post
Packit 8681c6
%systemd_post pkcsslotd.service
Packit 8681c6
Packit 8681c6
%preun
Packit 8681c6
%systemd_preun pkcsslotd.service
Packit 8681c6
Packit 8681c6
%postun
Packit 8681c6
%systemd_postun_with_restart pkcsslotd.service
Packit 8681c6
Packit 8681c6
Packit 8681c6
%files
Packit 8681c6
%doc ChangeLog FAQ README.md
Packit 8681c6
%doc doc/opencryptoki-howto.md
Packit 8681c6
%doc doc/README.token_data
Packit 8681c6
%dir %{_sysconfdir}/%{name}
Packit 8681c6
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
Packit 8681c6
%{_prefix}/lib/tmpfiles.d/%{name}.conf
Packit 8681c6
%{_unitdir}/pkcsslotd.service
Packit 8681c6
%{_sbindir}/pkcsconf
Packit 8681c6
%{_sbindir}/pkcsslotd
Packit Service 8aa27d
%{_sbindir}/p11sak
Packit Service 8aa27d
%{_sbindir}/pkcstok_migrate
Packit 8681c6
%{_mandir}/man1/pkcsconf.1*
Packit Service 8aa27d
%{_mandir}/man1/p11sak.1*
Packit Service 8aa27d
%{_mandir}/man1/pkcstok_migrate.1*
Packit 8681c6
%{_mandir}/man5/%{name}.conf.5*
Packit 8681c6
%{_mandir}/man7/%{name}.7*
Packit 8681c6
%{_mandir}/man8/pkcsslotd.8*
Packit 8681c6
%{_libdir}/opencryptoki/methods
Packit 8681c6
%{_libdir}/pkcs11/methods
Packit 8681c6
%dir %attr(770,root,pkcs11) %{_sharedstatedir}/%{name}
Packit 8681c6
%dir %attr(770,root,pkcs11) %{_localstatedir}/lock/%{name}
Packit 8681c6
%dir %attr(770,root,pkcs11) %{_localstatedir}/lock/%{name}/*
Packit 8681c6
Packit 8681c6
%files libs
Packit 8681c6
%license LICENSE
Packit 8681c6
%{_sysconfdir}/ld.so.conf.d/*
Packit 8681c6
# Unversioned .so symlinks usually belong to -devel packages, but opencryptoki
Packit 8681c6
# needs them in the main package, because:
Packit 8681c6
#   documentation suggests that programs should dlopen "PKCS11_API.so".
Packit 8681c6
%dir %{_libdir}/opencryptoki
Packit 8681c6
%{_libdir}/opencryptoki/libopencryptoki.*
Packit 8681c6
%{_libdir}/opencryptoki/PKCS11_API.so
Packit 8681c6
%dir %{_libdir}/opencryptoki/stdll
Packit 8681c6
%dir %{_libdir}/pkcs11
Packit 8681c6
%{_libdir}/pkcs11/libopencryptoki.so
Packit 8681c6
%{_libdir}/pkcs11/PKCS11_API.so
Packit 8681c6
%{_libdir}/pkcs11/stdll
Packit 8681c6
%dir %attr(770,root,pkcs11) %{_localstatedir}/log/opencryptoki
Packit 8681c6
Packit 8681c6
Packit 8681c6
%files devel
Packit 8681c6
%{_includedir}/%{name}/
Packit 8681c6
Packit 8681c6
%files swtok
Packit 8681c6
%{_libdir}/opencryptoki/stdll/libpkcs11_sw.*
Packit 8681c6
%{_libdir}/opencryptoki/stdll/PKCS11_SW.so
Packit 8681c6
%dir %attr(770,root,pkcs11) %{_sharedstatedir}/%{name}/swtok/
Packit 8681c6
%dir %attr(770,root,pkcs11) %{_sharedstatedir}/%{name}/swtok/TOK_OBJ/
Packit 8681c6
Packit 8681c6
%files tpmtok
Packit 8681c6
%doc doc/README.tpm_stdll
Packit 8681c6
%{_libdir}/opencryptoki/stdll/libpkcs11_tpm.*
Packit 8681c6
%{_libdir}/opencryptoki/stdll/PKCS11_TPM.so
Packit 8681c6
%dir %attr(770,root,pkcs11) %{_sharedstatedir}/%{name}/tpm/
Packit 8681c6
Packit 8681c6
%files icsftok
Packit 8681c6
%doc doc/README.icsf_stdll
Packit 8681c6
%{_sbindir}/pkcsicsf
Packit 8681c6
%{_mandir}/man1/pkcsicsf.1*
Packit 8681c6
%{_libdir}/opencryptoki/stdll/libpkcs11_icsf.*
Packit 8681c6
%{_libdir}/opencryptoki/stdll/PKCS11_ICSF.so
Packit 8681c6
%dir %attr(770,root,pkcs11) %{_sharedstatedir}/%{name}/icsf/
Packit 8681c6
Packit 8681c6
%ifarch s390 s390x
Packit 8681c6
%files icatok
Packit 8681c6
%{_libdir}/opencryptoki/stdll/libpkcs11_ica.*
Packit 8681c6
%{_libdir}/opencryptoki/stdll/PKCS11_ICA.so
Packit 8681c6
%dir %attr(770,root,pkcs11) %{_sharedstatedir}/%{name}/lite/
Packit 8681c6
%dir %attr(770,root,pkcs11) %{_sharedstatedir}/%{name}/lite/TOK_OBJ/
Packit 8681c6
Packit 8681c6
%files ccatok
Packit 8681c6
%doc doc/README.cca_stdll
Packit 8681c6
%{_sbindir}/pkcscca
Packit 8681c6
%{_mandir}/man1/pkcscca.1*
Packit 8681c6
%{_libdir}/opencryptoki/stdll/libpkcs11_cca.*
Packit 8681c6
%{_libdir}/opencryptoki/stdll/PKCS11_CCA.so
Packit 8681c6
%dir %attr(770,root,pkcs11) %{_sharedstatedir}/%{name}/ccatok/
Packit 8681c6
%dir %attr(770,root,pkcs11) %{_sharedstatedir}/%{name}/ccatok/TOK_OBJ/
Packit 8681c6
Packit 8681c6
%files ep11tok
Packit 8681c6
%doc doc/README.ep11_stdll
Packit 8681c6
%config(noreplace) %{_sysconfdir}/%{name}/ep11tok.conf
Packit 8681c6
%config(noreplace) %{_sysconfdir}/%{name}/ep11cpfilter.conf
Packit 8681c6
%{_sbindir}/pkcsep11_migrate
Packit 8681c6
%{_sbindir}/pkcsep11_session
Packit 8681c6
%{_mandir}/man1/pkcsep11_migrate.1.*
Packit 8681c6
%{_mandir}/man1/pkcsep11_session.1.*
Packit 8681c6
%{_libdir}/opencryptoki/stdll/libpkcs11_ep11.*
Packit 8681c6
%{_libdir}/opencryptoki/stdll/PKCS11_EP11.so
Packit 8681c6
%dir %attr(770,root,pkcs11) %{_sharedstatedir}/%{name}/ep11tok/
Packit 8681c6
%dir %attr(770,root,pkcs11) %{_sharedstatedir}/%{name}/ep11tok/TOK_OBJ/
Packit 8681c6
%endif
Packit 8681c6
Packit 8681c6
Packit 8681c6
%changelog
Packit 8681c6
* Fri Nov 15 2019 Patrick Steuer <patrick.steuer@de.ibm.com> 3.12.0
Packit 8681c6
- Update build time requirements
Packit 8681c6
* Thu Oct 26 2017 Eduardo Barretto <ebarretto@linux.vnet.ibm.com> 3.8.0
Packit 8681c6
- Update URL and source
Packit 8681c6
- Remove unnecessary steps from spec file
Packit 8681c6
* Tue Apr 25 2017 Eduardo Barretto <ebarretto@linux.vnet.ibm.com> 3.7.0
Packit 8681c6
- Update spec file according to Fedora 25
Packit 8681c6
- Add libitm as build dependency
Packit 8681c6
- Added icsftok
Packit 8681c6
- Added s390x ep11tok
Packit 8681c6
* Thu Jul 29 2010 Klaus H Kiwi <klausk@linux.vnet.ibm.com> 2.3.2-1
Packit 8681c6
- Put STDLLs in separate packages
Packit 8681c6
- General spec file cleanup
Packit 8681c6
* Thu Aug 7 2006 Daniel H Jones <danjones@us.ibm.com>
Packit 8681c6
- spec file cleanup
Packit 8681c6
* Tue Aug 1 2006 Daniel H Jones <danjones@us.ibm.com>
Packit 8681c6
- sw token not created for s390
Packit 8681c6
* Tue Jul 25 2006 Daniel H Jones <danjones@us.ibm.com>
Packit 8681c6
- fixed post section and /var/lib/opencryptoki perms
Packit 8681c6
* Thu May 25 2006 Daniel H Jones <danjones@us.ibm.com> 2.2.4-1
Packit 8681c6
- initial file created