blob: eef7c66df0019c02f0ed49b7856a1145de29ce71 [file] [log] [blame]
# spec file for RHEL/CentOS and Fedora
%bcond_without gnutls
# Macros needed by SELinux
%global selinuxtype targeted
%global moduletype contrib
%global modulename swtpm
Summary: TPM Emulator
Name: swtpm
Version: 0.8.0
Release: 1%{?dist}
License: BSD
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: libtool
BuildRequires: libtpms-devel >= 0.6.0
BuildRequires: glib2-devel
BuildRequires: json-glib-devel
BuildRequires: expect
BuildRequires: net-tools
BuildRequires: openssl-devel
BuildRequires: socat
BuildRequires: softhsm
%if (0%{?fedora}) || (0%{?rhel} && 0%{?rhel} < 9)
BuildRequires: trousers >= 0.3.9
%if %{with gnutls}
BuildRequires: gnutls >= 3.1.0
BuildRequires: gnutls-devel
BuildRequires: gnutls-utils
BuildRequires: libtasn1-devel
BuildRequires: libtasn1
BuildRequires: selinux-policy-devel
BuildRequires: gcc
BuildRequires: libseccomp-devel
BuildRequires: tpm2-pkcs11 tpm2-pkcs11-tools tpm2-tools tpm2-abrmd
Requires: %{name}-libs = %{version}-%{release}
Requires: libtpms >= 0.6.0
TPM emulator built on libtpms providing TPM functionality for QEMU VMs
%package libs
Summary: Private libraries for swtpm TPM emulators
License: BSD
%description libs
A private library with callback functions for libtpms based swtpm TPM emulator
%package devel
Summary: Include files for the TPM emulator's CUSE interface for usage by clients
License: BSD
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description devel
Include files for the TPM emulator's CUSE interface.
%package tools
Summary: Tools for the TPM emulator
License: BSD
Requires: swtpm = %{version}-%{release}
Requires: trousers >= 0.3.9 bash gnutls-utils
%description tools
Tools for the TPM emulator from the swtpm package
%package tools-pkcs11
Summary: Tools for creating a local CA based on a pkcs11 device
License: BSD
Requires: swtpm-tools = %{version}-%{release}
Requires: tpm2-pkcs11 tpm2-pkcs11-tools tpm2-tools tpm2-abrmd
Requires: expect gnutls-utils trousers >= 0.3.9
%description tools-pkcs11
Tools for creating a local CA based on a pkcs11 device
%configure \
%if %{with gnutls}
--with-gnutls \
make %{?_smp_mflags} check
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.{a,la,so}
for pp in /usr/share/selinux/packages/swtpm.pp \
/usr/share/selinux/packages/swtpm_svirt.pp; do
%selinux_modules_install -s %{selinuxtype} ${pp}
if [ $1 -eq 0 ]; then
for p in swtpm swtpm_svirt; do
%selinux_modules_uninstall -s %{selinuxtype} $p
%selinux_relabel_post -s %{selinuxtype}
%ldconfig_post libs
%ldconfig_postun libs
%license LICENSE
%files libs
%license LICENSE
%dir %{_libdir}/%{name}
%files devel
%dir %{_includedir}/%{name}
%files tools
%if %{with gnutls}
%config(noreplace) %{_sysconfdir}/swtpm_setup.conf
%config(noreplace) %{_sysconfdir}/swtpm-localca.options
%config(noreplace) %{_sysconfdir}/swtpm-localca.conf
%dir %{_datadir}/swtpm
%attr( 750, tss, root) %{_localstatedir}/lib/swtpm-localca
%files tools-pkcs11
* Tue Nov 09 2021 Stefan Berger <> - 0.7.0-0.20211022git-------
- v0.7.0 release
* Mon Jun 7 2021 Stefan Berger <> - 0.6.0-0.20210607git-------
- v0.6.0 release
* Wed Oct 7 2020 Stefan Berger <> - 0.5.0-0.20201007git-------
- v0.5.0 release
* Fri Aug 28 2020 Stefan Berger <> - 0.4.0-20200218git-------
- v0.4.0 release
* Mon Feb 17 2020 Stefan Berger <> - 0.3.0-20200218git38f36f3
- v0.3.0 release
* Fri Jul 19 2019 Stefan Berger <> - 0.2.0-20190716git817d3a8
- v0.2.0 release
* Mon Feb 4 2019 Stefan Berger <> - 0.1.0-0.20190204git2c25d13
- v0.1.0 release
* Mon Sep 17 2018 Stefan Berger <> - 0.1.0-0.20180918git67d7ea3
- Created initial version of rpm spec files
- Version is now 0.1.0
- Bugzilla for this spec: