# Macros needed by SELinux. %global selinuxtype targeted %global moduletype contrib %global modulename ibmswtpm2 Name: ibmswtpm2 Version: 1661 Release: 2%{?dist} Summary: IBM's Software TPM 2.0 URL: https://sourceforge.net/projects/ibmswtpm2/ # ibmswtpm2-1661.tar.gz is ibmtpm1661.tar.gz repackaged into # a ibmswtpm2-1661 directory. Original file can be downloaded # from: # https://sourceforge.net/projects/ibmswtpm2/files/ibmtpm1661.tar.gz/download Source0: ibmswtpm2-1661.tar.gz Source1: ibm-tpm-emulator.service Source3: tpm-server-init Source4: tpm_serverd Source5: ibmswtpm2.pp.bz2 Patch1: 0001-OpenSSL-3.patch License: Custom Requires: openssl-libs Requires: tpm2-tss Requires: tpm2-abrmd Requires: tpm2-tools Requires: procps-ng Requires: selinux-policy-targeted Requires(post): selinux-policy-targeted BuildRequires: selinux-policy-devel BuildRequires: selinux-policy-targeted Requires(post): selinux-policy-targeted Requires(post): libselinux-utils Requires(post): policycoreutils BuildRequires: git-core BuildRequires: make BuildRequires: gcc BuildRequires: openssl-devel BuildRequires: systemd Requires(post): libselinux-utils Requires(post): policycoreutils %description An implementation of the TCG TPM 2.0 specification. It is based on the TPM specification Parts 3 and 4 source code donated by Microsoft, with additional files to complete the implementation. %prep %autosetup -S git %build cd src %make_build %pre %selinux_relabel_pre -s %{selinuxtype} %post %selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2 %postun if [ $1 -eq 0 ]; then %selinux_modules_uninstall -s %{selinuxtype} %{modulename} fi %posttrans %selinux_relabel_post -s %{selinuxtype} %install cd src %make_install mkdir -p %{buildroot}/{%{_unitdir},%{_bindir},%{_datadir}/selinux/packages/%{selinuxtype}} install -m644 %{SOURCE1} %{buildroot}/%{_unitdir} install -m755 %{SOURCE3} %{buildroot}/%{_bindir} install -m755 %{SOURCE4} %{buildroot}/%{_bindir} install -m644 %{SOURCE5} %{buildroot}/%{_datadir}/selinux/packages/%{selinuxtype} %files %{_bindir}/tpm_server %{_bindir}/tpm_serverd %{_bindir}/tpm-server-init %{_unitdir}/ibm-tpm-emulator.service %{_datadir}/selinux/packages/%{selinuxtype} %changelog * Wed Oct 06 2021 Sergio Correia - 1661-2 - Do not touch tpm2-abrmd * Fri Sep 03 2021 Sergio Correia - 1661-1 - First release