File swtpm.spec of Package swtpm

# spec file for package swtpm
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# 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

Name:           swtpm
Version:        0.2.0
Release:        0
Summary:        Software TPM emulator
License:        BSD-3-Clause
Group:          System/Base
Patch1:         swtpm-tpm-tools-path.patch
Patch2:         swtpm-setup-tcsd-path.patch
Patch3:         swtpm-adjust-seccomp-path.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  expect
BuildRequires:  libtool
BuildRequires:  fuse-devel
BuildRequires:  glib2-devel
BuildRequires:  gnutls
BuildRequires:  libgnutls-devel
BuildRequires:  libopenssl-devel
BuildRequires:  libseccomp-devel
BuildRequires:  libtasn1-devel
BuildRequires:  libtpms-devel
BuildRequires:  python3-Twisted
BuildRequires:  socat
BuildRequires:  tpm-tools
%if 0%{?suse_version} > 1500 
BuildRequires:  net-tools-deprecated
Requires:       tpm-tools
Requires:       trousers
%if 0%{?suse_version} > 1500 
Requires:       net-tools-deprecated
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

The SWTPM package provides TPM emulators with different front-end interfaces
to libtpms. TPM emulators provide socket interfaces (TCP/IP) and the Linux
CUSE interface for the creation of multiple native /dev/vtpm* devices.
Those can be the targets of multiple QEMU cuse-tpm instances.

%package        devel
Summary:        Development files for swtpm
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       glib2-devel
Requires:       libtpms-devel
Requires:       libopenssl-devel

%description    devel
The development files for SWTPM

%setup -q -n %{name}-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1

%configure --with-openssl --disable-static
make %{?_smp_mflags}


%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%config %{_sysconfdir}/swtpm*
%dir %{_datadir}/swtpm
%dir %{_libdir}/swtpm

%files devel
%dir %{_includedir}/swtpm/