796acd
%bcond_without gnutls
796acd
796acd
# Macros needed by SELinux
796acd
%global selinuxtype targeted
796acd
%global moduletype  contrib
796acd
%global modulename  swtpm
796acd
796acd
Summary: TPM Emulator
796acd
Name:           swtpm
85f7ff
Version:        0.8.0
85f7ff
Release:        1%{?dist}
796acd
License:        BSD
85f7ff
Url:            https://github.com/stefanberger/swtpm
85f7ff
Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
85f7ff
Patch0001:      0001-swtpm_setup-fix-Werror-maybe-uninitialized.patch
796acd
85f7ff
BuildRequires:  make
796acd
BuildRequires:  git-core
796acd
BuildRequires:  automake
796acd
BuildRequires:  autoconf
796acd
BuildRequires:  libtool
796acd
BuildRequires:  libtpms-devel >= 0.6.0
85f7ff
BuildRequires:  glib2-devel
85f7ff
BuildRequires:  json-glib-devel
796acd
BuildRequires:  expect
796acd
BuildRequires:  net-tools
796acd
BuildRequires:  openssl-devel
796acd
BuildRequires:  socat
796acd
BuildRequires:  softhsm
796acd
%if %{with gnutls}
796acd
BuildRequires:  gnutls >= 3.4.0
796acd
BuildRequires:  gnutls-devel
796acd
BuildRequires:  gnutls-utils
796acd
BuildRequires:  libtasn1-devel
796acd
BuildRequires:  libtasn1
796acd
%endif
796acd
BuildRequires:  selinux-policy-devel
796acd
BuildRequires:  gcc
796acd
BuildRequires:  libseccomp-devel
796acd
BuildRequires:  tpm2-pkcs11 tpm2-pkcs11-tools tpm2-tools tpm2-abrmd
796acd
796acd
Requires:       %{name}-libs = %{version}-%{release}
796acd
Requires:       libtpms >= 0.6.0
796acd
%{?selinux_requires}
796acd
796acd
%description
796acd
TPM emulator built on libtpms providing TPM functionality for QEMU VMs
796acd
796acd
%package        libs
796acd
Summary:        Private libraries for swtpm TPM emulators
796acd
License:        BSD
796acd
796acd
%description    libs
796acd
A private library with callback functions for libtpms based swtpm TPM emulator
796acd
796acd
%package        devel
796acd
Summary:        Include files for the TPM emulator's CUSE interface for usage by clients
796acd
License:        BSD
796acd
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
796acd
796acd
%description    devel
796acd
Include files for the TPM emulator's CUSE interface.
796acd
796acd
%package        tools
796acd
Summary:        Tools for the TPM emulator
796acd
License:        BSD
796acd
Requires:       swtpm = %{version}-%{release}
796acd
Requires:       bash gnutls-utils
796acd
796acd
%description    tools
796acd
Tools for the TPM emulator from the swtpm package
796acd
85f7ff
%package       tools-pkcs11
85f7ff
Summary:       Tools for creating a local CA based on a pkcs11 device
85f7ff
License:       BSD
85f7ff
Requires:      swtpm-tools = %{version}-%{release}
85f7ff
Requires:      tpm2-pkcs11 tpm2-pkcs11-tools tpm2-tools tpm2-abrmd
85f7ff
Requires:      expect gnutls-utils
796acd
796acd
%description   tools-pkcs11
796acd
Tools for creating a local CA based on a pkcs11 device
796acd
796acd
%prep
85f7ff
%autosetup -S git -p1
796acd
796acd
%build
796acd
796acd
NOCONFIGURE=1 ./autogen.sh
796acd
%configure \
796acd
%if %{with gnutls}
796acd
        --with-gnutls \
796acd
%endif
85f7ff
        --without-cuse
796acd
312523
%make_build
796acd
796acd
%check
312523
make %{?_smp_mflags} check VERBOSE=1
796acd
796acd
%install
796acd
796acd
%make_install
796acd
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.{a,la,so}
85f7ff
rm $RPM_BUILD_ROOT%{_mandir}/man8/swtpm_cuse.8*
796acd
796acd
%post
796acd
for pp in /usr/share/selinux/packages/swtpm.pp \
796acd
          /usr/share/selinux/packages/swtpm_svirt.pp; do
796acd
  %selinux_modules_install -s %{selinuxtype} ${pp}
796acd
done
796acd
restorecon %{_bindir}/swtpm
796acd
796acd
%postun
796acd
if [ $1 -eq  0 ]; then
796acd
  for p in swtpm swtpm_svirt; do
796acd
    %selinux_modules_uninstall -s %{selinuxtype} $p
796acd
  done
796acd
fi
796acd
796acd
%posttrans
796acd
%selinux_relabel_post -s %{selinuxtype}
796acd
796acd
%ldconfig_post libs
796acd
%ldconfig_postun libs
796acd
796acd
%files
796acd
%license LICENSE
796acd
%doc README
796acd
%{_bindir}/swtpm
796acd
%{_mandir}/man8/swtpm.8*
796acd
%{_datadir}/selinux/packages/swtpm.pp
796acd
%{_datadir}/selinux/packages/swtpm_svirt.pp
796acd
796acd
%files libs
796acd
%license LICENSE
796acd
%doc README
796acd
796acd
%dir %{_libdir}/%{name}
796acd
%{_libdir}/%{name}/libswtpm_libtpms.so.0
796acd
%{_libdir}/%{name}/libswtpm_libtpms.so.0.0.0
796acd
796acd
%files devel
796acd
%dir %{_includedir}/%{name}
796acd
%{_includedir}/%{name}/*.h
796acd
%{_mandir}/man3/swtpm_ioctls.3*
796acd
796acd
%files tools
796acd
%doc README
796acd
%{_bindir}/swtpm_bios
796acd
%if %{with gnutls}
796acd
%{_bindir}/swtpm_cert
796acd
%endif
796acd
%{_bindir}/swtpm_setup
796acd
%{_bindir}/swtpm_ioctl
312523
%{_bindir}/swtpm_localca
796acd
%{_mandir}/man8/swtpm_bios.8*
796acd
%{_mandir}/man8/swtpm_cert.8*
796acd
%{_mandir}/man8/swtpm_ioctl.8*
85f7ff
%{_mandir}/man5/swtpm-localca.conf.5*
85f7ff
%{_mandir}/man5/swtpm-localca.options.5*
796acd
%{_mandir}/man8/swtpm-localca.8*
312523
%{_mandir}/man8/swtpm_localca.8*
796acd
%{_mandir}/man8/swtpm_setup.8*
85f7ff
%{_mandir}/man5/swtpm_setup.conf.5*
796acd
%config(noreplace) %{_sysconfdir}/swtpm_setup.conf
796acd
%config(noreplace) %{_sysconfdir}/swtpm-localca.options
796acd
%config(noreplace) %{_sysconfdir}/swtpm-localca.conf
796acd
%dir %{_datadir}/swtpm
796acd
%{_datadir}/swtpm/swtpm-localca
796acd
%{_datadir}/swtpm/swtpm-create-user-config-files
796acd
%attr( 750, tss, root) %{_localstatedir}/lib/swtpm-localca
796acd
796acd
%files tools-pkcs11
796acd
%{_mandir}/man8/swtpm-create-tpmca.8*
796acd
%{_datadir}/swtpm/swtpm-create-tpmca
796acd
796acd
%changelog
85f7ff
* Tue Nov 22 2022 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.8.0-1
85f7ff
- Update to v0.8.0 release
85f7ff
  Resolves: rhbz#2092944
85f7ff
85f7ff
* Fri Jun 17 2022 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.7.0-3.20211109gitb79fd91
85f7ff
- Disable OpenSSL FIPS mode to avoid libtpms failures
85f7ff
  Resolves: rhbz#2090219
85f7ff
cea8ae
* Mon Feb 21 2022 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.7.0-2.20211109gitb79fd91
cea8ae
- Add fix for CVE-2022-23645.
cea8ae
  Resolves: rhbz#2056518
cea8ae
312523
* Fri Nov 12 2021 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.7.0-1.20211109gitb79fd91
312523
- Update to v0.7.0 release
312523
  Resolves: rhbz#2021580 & rhbz#1990153
312523
796acd
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 0.6.0-3.20210607gitea627b3
796acd
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
796acd
  Related: rhbz#1991688
796acd
796acd
* Mon Jul 12 2021 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.6.0-2.20210607gitea627b3
796acd
- rebuilt with AM_* flags patch 
796acd
796acd
* Wed Jun 16 2021 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.6.0-1.20210607gitea627b3
796acd
- new version
796acd
- Fixes: rhbz#1972785
796acd
796acd
* Wed Jun 16 2021 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.5.2-7.20201226gite59c0c1
796acd
- Removed trouser dependency (used for vTPM 1.2, unsupported)
796acd
- Fixes: rhbz#1967919
796acd
796acd
* Wed Jun 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.5.2-6.20201226gite59c0c1
796acd
- Rebuilt for RHEL 9 BETA for openssl 3.0
796acd
  Related: rhbz#1971065
796acd
796acd
* Tue May 18 2021 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.5.2-5.20201226gite59c0c1
796acd
- Add -Wno-error=deprecated-declarations to fix build with OpenSSL 3.0.
796acd
- Fixes: rhbz#1958033
796acd
796acd
* Tue Apr 20 2021 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.5.2-4.20201226gite59c0c1
796acd
- Remove unnecessary twisted dependency.
796acd
- Fixes: rhbz#1935825
796acd
796acd
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.5.2-3.20201226gite59c0c1
796acd
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
796acd
796acd
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-2.20201226gite59c0c1
796acd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
796acd
796acd
* Sat Dec 26 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.5.2-1.20201226gite59c0c1a
796acd
- Bugfixes for stable release
796acd
796acd
* Mon Dec 07 2020 Jeff Law <law@redhat.com> - 0.5.1-3.20201117git96f5a04c
796acd
- Avoid diagnostic from gcc-11
796acd
796acd
* Fri Nov 13 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.5.1-2.20201117git96f5a04c
796acd
- Another build of v0.5.1 after more fixes
796acd
796acd
* Fri Nov 13 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.5.1-1.20201007git390f5bd4
796acd
- Update to v0.5.1 addressing potential symlink attack issue (CVE-2020-28407)
796acd
796acd
* Wed Oct 7 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.5.0-1.20201007gitb931e109
796acd
- Update to v0.5.0 release
796acd
796acd
* Fri Aug 28 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.4.0-1.20200828git0c238a2
796acd
- Update to v0.4.0 release
796acd
796acd
* Thu Aug 27 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.3.4-2.20200711git80f0418
796acd
- Disable pkcs11 related test case running into GnuTLS locking bug
796acd
796acd
* Tue Aug 11 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.3.4-1.20200711git80f0418
796acd
- Update to v0.3.4 release
796acd
796acd
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-3.20200218git74ae43b
796acd
- Second attempt - Rebuilt for
796acd
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
796acd
796acd
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-2.20200218git74ae43b
796acd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
796acd
796acd
* Mon Feb 24 2020 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.3.0-1.20200218git74ae43b
796acd
- Update to v0.3.0 release
796acd
796acd
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-7.20191115git8dae4b3
796acd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
796acd
796acd
* Fri Nov 15 2019 Stefan Berger <stefanb@linux.ibm.com> - 0.2.0-6.20191018git8dae4b3
796acd
- follow stable-0.2.0 branch with fix of GnuTLS API call to get subject key ID
796acd
796acd
* Fri Oct 18 2019 Stefan Berger <stefanb@linux.ibm.com> - 0.2.0-5.20191018git9227cf4
796acd
- follow stable-0.2.0 branch with swtpm_cert OID bugfix for TPM 2
796acd
796acd
* Tue Aug 13 2019 Stefan Berger <stefanb@linux.ibm.com> - 0.2.0-4.20190801git13536aa
796acd
- run 'restorecon' on swtpm in post to get SELinux label on first install
796acd
796acd
* Thu Aug 01 2019 Stefan Berger <stefanb@linux.ibm.com> - 0.2.0-3.20190801git13536aa
796acd
- follow stable-0.2.0 branch with some bug fixes
796acd
796acd
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-2.20190723gitf0b4137
796acd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
796acd
796acd
* Tue Jul 23 2019 Stefan Berger <stefanb@linux.ibm.com> - 0.2.0-1.20190723gitf0b4137
796acd
- follow stable-0.2.0 branch with some bug fixes
796acd
796acd
* Tue Jul 16 2019 Stefan Berger <stefanb@linux.ibm.com> - 0.2.0-0.20190716git374b669
796acd
- (tentative) v0.2.0 release of swtpm
796acd
796acd
* Thu Apr 25 2019 Stefan Berger <stefanb@linux.ibm.com> - 0.1.0-0.20190425gitca85606
796acd
- pick up bug fixes
796acd
796acd
* Mon Feb 04 2019 Stefan Berger <stefanb@linux.ibm.com> - 0.1.0-0.20190204git2c25d13.1
796acd
- v0.1.0 release of swtpm
796acd
796acd
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.0-0.20181212git8b9484a.1
796acd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
796acd
796acd
* Wed Dec 12 2018 Stefan Berger <stefanb@linux.ibm.com> - 0.1.0-0.20181212git8b9484a
796acd
- Follow improvements in swtpm repo primarily related to fixes for 'ubsan'
796acd
796acd
* Tue Nov 06 2018 Stefan Berger <stefanb@linux.ibm.com> - 0.1.0-0.20181106git05d8160
796acd
- Follow improvements in swtpm repo
796acd
- Remove ownership change of swtpm_setup.sh; have root own the file as required
796acd
796acd
* Wed Oct 31 2018 Stefan Berger <stefanb@linux.ibm.com> - 0.1.0-0.20181031gitc782a85
796acd
- Follow improvements and fixes in swtpm
796acd
796acd
* Tue Oct 02 2018 Stefan Berger <stefanb@linux.vnet.ibm.com> - 0.1.0-0.20181002git0143c41
796acd
- Fixes to SELinux policy
796acd
- Improvements on various other parts
796acd
* Tue Sep 25 2018 Stefan Berger <stefanb@linux.vnet.ibm.com> - 0.1.0-0.20180924gitce13edf
796acd
- Initial Fedora build
796acd
* Mon Sep 17 2018 Stefan Berger <stefanb@linux.vnet.ibm.com> - 0.1.0-0.20180918git67d7ea3
796acd
- Created initial version of rpm spec files
796acd
- Version is now 0.1.0
796acd
- Bugzilla for this spec: https://bugzilla.redhat.com/show_bug.cgi?id=1611829