-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simp-tpm2-simulator builds with service
- Loading branch information
Showing
1 changed file
with
27 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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} | ||
|
||
|
@@ -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 | ||
|