Skip to content

Commit

Permalink
simp-tpm2-simulator builds with service
Browse files Browse the repository at this point in the history
  • Loading branch information
op-ct committed Apr 20, 2018
1 parent 8ba2c2c commit cc153b7
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions simp-tpm2-simulator/simp-tpm2-simulator.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@ Release: 0%{?dist}
Summary: The IBM TPM2.0 simulator

# SIMP customization:
%define _prefix /usr/local
%global _prefix /usr/local
%global _name tpm2-simulator

License: BSD
URL: https://sourceforge.net/projects/ibmswtpm2/
###https://sourceforge.net/projects/ibmswtpm2/files/ibmtpm%%{version}.tar.gz/download
Source0: %{name}-%{version}.tar.gz
Source1: %{name}.service

BuildRequires: gcc-c++
BuildRequires: pkgconfig(openssl)


%description
IBM's simulator that implements 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.

This version has been packaged by the SIMP team for %{dist}

%prep
%setup -q %{SOURCE0}

Expand All @@ -28,17 +30,34 @@ cd src/
%make_build

%install
mkdir -p %{buildroot}/%{_bindir}
cp -p src/tpm_server %{buildroot}/%{_bindir}/tpm2-simulator
install -m 0755 -D src/tpm_server %{buildroot}%{_bindir}/%{_name}
install -m 0644 -D %{SOURCE1} %{buildroot}%{_unitdir}/%{_name}.service

%files
%doc ibmtpm.doc
%license LICENSE
%{_bindir}/tpm2-*
%{_bindir}/%{_name}
%{_unitdir}/%{_name}.service



%pre
mkdir -p %{_datadir}

getent group tpm2sim >/dev/null || groupadd -g 61 -r tpm2sim
getent passwd tpm2sim >/dev/null || \
useradd -r -u 61 -g tpm2sim -d /dev/null -s /sbin/nologin \
-c "Account used by the simp-tpm2-simulator package to sandbox the simp-tpm2-simulator daemon" tpm2sim
exit 0

%post
%systemd_postun %{_name}.serivce

%post -p /sbin/ldconfig
%preun
%systemd_preun %{_name}.serivce

%postun -p /sbin/ldconfig
%postun
%systemd_postun %{_name}.serivce

%changelog
* Mon Apr 9 2018 Chris Tessmer <[email protected]> - 3.0.3-3
Expand Down

0 comments on commit cc153b7

Please sign in to comment.