2016-02-24 11:20:32 +01:00
|
|
|
#
|
2016-04-08 11:42:06 +02:00
|
|
|
# spec file for package tpm2-0-tss
|
2016-02-24 11:20:32 +01:00
|
|
|
#
|
2017-02-08 14:48:45 +01:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
2016-02-24 11:20:32 +01:00
|
|
|
#
|
|
|
|
# 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 http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2016-02-24 11:22:48 +01:00
|
|
|
Name: tpm2-0-tss
|
2017-02-08 14:48:45 +01:00
|
|
|
Version: 1.0
|
2016-02-24 11:20:32 +01:00
|
|
|
Release: 0
|
2017-02-18 12:42:59 +01:00
|
|
|
Summary: Intel's TCG Software Stack access library for TPM 2.0 chips
|
2016-03-24 18:38:07 +01:00
|
|
|
License: BSD-2-Clause
|
2016-02-24 11:20:32 +01:00
|
|
|
Group: Productivity/Security
|
2016-02-24 11:22:48 +01:00
|
|
|
Url: https://github.com/01org/TPM2.0-TSS
|
2017-02-08 14:48:45 +01:00
|
|
|
Source0: https://github.com/01org/TPM2.0-TSS/archive/%{version}.tar.gz
|
2016-02-24 11:20:32 +01:00
|
|
|
Source2: baselibs.conf
|
2017-02-08 16:27:23 +01:00
|
|
|
Patch0: tpm2-0-tss-configure.patch
|
2017-02-08 17:30:51 +01:00
|
|
|
BuildRequires: autoconf-archive
|
2016-02-24 11:40:41 +01:00
|
|
|
BuildRequires: automake
|
2016-02-24 14:01:43 +01:00
|
|
|
BuildRequires: gcc-c++
|
2016-02-24 11:20:32 +01:00
|
|
|
BuildRequires: libtool
|
|
|
|
BuildRequires: pkg-config
|
2016-08-06 21:28:47 +02:00
|
|
|
BuildRequires: systemd-rpm-macros
|
2016-02-24 11:20:32 +01:00
|
|
|
Requires(pre): pwdutils
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
|
|
|
|
%description
|
2017-05-11 17:15:35 +02:00
|
|
|
The tpm2-0-tss package provides a TPM 2.0 TSS implementation. This
|
|
|
|
implementation is developed by INTEL. Note that the current resource manager
|
2017-05-15 13:53:42 +02:00
|
|
|
implementation is considered deprecated (a prototype, probably buggy and
|
2017-05-11 17:15:35 +02:00
|
|
|
insecure) by its developers.
|
2016-02-24 11:20:32 +01:00
|
|
|
|
|
|
|
%package devel
|
2017-02-18 12:42:59 +01:00
|
|
|
Summary: Development headers for the Intel TSS library for TPM 2.0 chips
|
2016-02-24 11:20:32 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
Requires: glibc-devel
|
2017-02-18 12:42:59 +01:00
|
|
|
Requires: libsapi0 = %{version}
|
|
|
|
Requires: libtcti-device0 = %{version}
|
|
|
|
Requires: libtcti-socket0 = %{version}
|
2016-02-24 11:20:32 +01:00
|
|
|
|
|
|
|
%description devel
|
2017-02-15 19:15:01 +01:00
|
|
|
This package provides the development files for the libsapi library
|
2016-03-24 10:49:46 +01:00
|
|
|
for accessing TPM 2.0 chips.
|
2016-02-24 11:20:32 +01:00
|
|
|
|
2017-02-15 19:15:01 +01:00
|
|
|
%package -n libsapi0
|
2017-02-18 12:42:59 +01:00
|
|
|
Summary: TPM2 System API library
|
2016-04-08 11:42:06 +02:00
|
|
|
Group: System/Libraries
|
2016-05-07 10:25:53 +02:00
|
|
|
# Non-SLPP package name from earlier
|
|
|
|
Obsoletes: libtss2 < %version-%release
|
|
|
|
Provides: libtss2 = %version-%release
|
2016-02-24 11:20:32 +01:00
|
|
|
|
2017-02-15 19:15:01 +01:00
|
|
|
%description -n libsapi0
|
2016-03-24 10:49:46 +01:00
|
|
|
This package provides the library to access the TSS (TCG Software Stack) for
|
|
|
|
accessing TPM 2.0 chips.
|
2016-02-24 11:20:32 +01:00
|
|
|
|
2017-02-18 12:42:59 +01:00
|
|
|
%package -n libtcti-device0
|
|
|
|
Summary: TCTI library for communicating with a TPM device node
|
|
|
|
Group: System/Libraries
|
|
|
|
|
|
|
|
%description -n libtcti-device0
|
|
|
|
TPM Command Transmission Interface library for communicating with a
|
|
|
|
TPM device node.
|
|
|
|
|
|
|
|
%package -n libtcti-socket0
|
|
|
|
Summary: TCTI library for communicating with a TPM over a socket
|
|
|
|
Group: System/Libraries
|
|
|
|
|
|
|
|
%description -n libtcti-socket0
|
|
|
|
TPM Command Transmission Interface library for communicating with a
|
|
|
|
TPM over a socket.
|
|
|
|
|
2016-02-24 11:20:32 +01:00
|
|
|
%prep
|
2017-02-08 14:48:45 +01:00
|
|
|
%setup -q -n TPM2.0-TSS-%{version}
|
2017-02-08 16:27:23 +01:00
|
|
|
%patch0 -p1
|
2016-02-24 11:20:32 +01:00
|
|
|
|
|
|
|
%build
|
2016-02-24 11:40:41 +01:00
|
|
|
bash bootstrap
|
2017-02-18 12:42:59 +01:00
|
|
|
%configure --disable-static
|
2016-02-24 14:01:43 +01:00
|
|
|
make %{?_smp_mflags} PTHREAD_LDFLAGS=-pthread
|
2016-02-24 11:20:32 +01:00
|
|
|
|
|
|
|
%install
|
2016-02-24 11:22:48 +01:00
|
|
|
%make_install
|
2016-04-08 11:42:06 +02:00
|
|
|
find %{buildroot} -type f -name "*.la" -delete -print
|
2017-02-08 14:48:45 +01:00
|
|
|
install -D -m 0644 contrib/resourcemgr.service %{buildroot}/%{_unitdir}/resourcemgr.service
|
2017-04-11 16:26:35 +02:00
|
|
|
sed -e 's#usr/local/sbin/#usr/sbin/#;' -i %{buildroot}/%{_unitdir}/resourcemgr.service
|
2016-08-06 21:28:47 +02:00
|
|
|
ln -sv %{_sbindir}/service %{buildroot}%{_sbindir}/rcresourcemgr
|
2017-05-12 11:04:15 +02:00
|
|
|
%define udev_rule_file 90-tpm.rules
|
|
|
|
install -D -m 0644 contrib/tpm-udev.rules %{buildroot}%{_udevrulesdir}/%{udev_rule_file}
|
2016-02-24 11:20:32 +01:00
|
|
|
|
2017-02-15 19:15:01 +01:00
|
|
|
%post -n libsapi0 -p /sbin/ldconfig
|
|
|
|
%postun -n libsapi0 -p /sbin/ldconfig
|
2017-02-18 12:42:59 +01:00
|
|
|
%post -n libtcti-device0 -p /sbin/ldconfig
|
|
|
|
%postun -n libtcti-device0 -p /sbin/ldconfig
|
|
|
|
%post -n libtcti-socket0 -p /sbin/ldconfig
|
|
|
|
%postun -n libtcti-socket0 -p /sbin/ldconfig
|
2016-02-24 11:20:32 +01:00
|
|
|
|
2016-08-06 21:28:47 +02:00
|
|
|
%pre
|
2017-05-11 17:15:35 +02:00
|
|
|
# the same user is employed by trousers:
|
|
|
|
#
|
|
|
|
# trousers just needs those accounts for dropping privileges to. The service
|
|
|
|
# starts as root and uses set*id to drop to tss, after the tpm device has been
|
|
|
|
# opened.
|
|
|
|
#
|
|
|
|
# resourcemgr has no set*id handling and thus requires /dev/tpm to be owned
|
|
|
|
# by the tss user. Therefore we also need to install a udev rule file.
|
|
|
|
#
|
|
|
|
# trousers was here first and created the user like this, also giving it a
|
|
|
|
# home in /var/lib/tpm. I don't think the home directory is used by any of
|
|
|
|
# both packages ATM. Trousers is keeping state there, but the directory is
|
|
|
|
# owned by root and files are opened before dropping privileges. The passwd
|
|
|
|
# entry seems not to be evaluated.
|
|
|
|
#
|
|
|
|
# so I guess we can share the account between the two packages for now.
|
|
|
|
%_bindir/getent group tss >/dev/null || %{_sbindir}/groupadd -g 98 tss || :
|
|
|
|
%_bindir/getent passwd tss >/dev/null || \
|
|
|
|
%{_sbindir}/useradd -u 98 -o -g tss -s /bin/false -c "TSS daemon" \
|
|
|
|
-d %{_localstatedir}/lib/tpm tss || :
|
2016-08-06 21:28:47 +02:00
|
|
|
%service_add_pre resourcemgr.service
|
|
|
|
|
|
|
|
%post
|
|
|
|
%service_add_post resourcemgr.service
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%service_del_postun resourcemgr.service
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%service_del_preun resourcemgr.service
|
|
|
|
|
2016-02-24 11:20:32 +01:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2017-02-15 19:15:01 +01:00
|
|
|
%doc *.md LICENSE
|
2016-04-08 11:42:06 +02:00
|
|
|
%{_sbindir}/resourcemgr
|
2016-08-06 21:28:47 +02:00
|
|
|
/%{_unitdir}/resourcemgr.service
|
|
|
|
%{_sbindir}/rcresourcemgr
|
2017-05-12 11:04:15 +02:00
|
|
|
%{_udevrulesdir}/%{udev_rule_file}
|
2016-02-24 11:20:32 +01:00
|
|
|
|
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root)
|
2016-02-24 14:01:43 +01:00
|
|
|
%{_includedir}/tcti
|
2017-02-15 19:15:01 +01:00
|
|
|
%{_includedir}/sapi
|
2016-02-24 11:20:32 +01:00
|
|
|
%{_libdir}/*.so
|
2017-02-15 19:15:01 +01:00
|
|
|
%{_libdir}/pkgconfig/*.pc
|
2016-02-24 14:01:43 +01:00
|
|
|
##only available in static form
|
2017-05-11 17:15:35 +02:00
|
|
|
#%%{_libdir}/libtddl.a
|
2016-02-24 11:20:32 +01:00
|
|
|
|
2017-02-15 19:15:01 +01:00
|
|
|
%files -n libsapi0
|
2016-02-24 11:20:32 +01:00
|
|
|
%defattr(-,root,root)
|
2017-02-18 12:42:59 +01:00
|
|
|
%{_libdir}/libsapi.so.*
|
|
|
|
|
|
|
|
%files -n libtcti-device0
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_libdir}/libtcti-device.so.*
|
|
|
|
|
|
|
|
%files -n libtcti-socket0
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_libdir}/libtcti-socket.so.*
|
2016-02-24 14:01:43 +01:00
|
|
|
|
2016-02-24 11:20:32 +01:00
|
|
|
%changelog
|