Compare commits

..

No commits in common. "a198e1c1702e6cd47e85157f6d76136fdeda0c78" and "f1dbaf3dc52d8ad299387d36163a605b2b36bf6a" have entirely different histories.

3 changed files with 19 additions and 48 deletions

BIN
tpm2-abrmd-2.3.3.tar.gz Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,20 +1,20 @@
%global selinuxtype targeted
Name: tpm2-abrmd
Version: 2.4.1
Release: 2
Version: 2.3.3
Release: 1
Summary: A system daemon implementing the TPM2 access broker (TAB) & Resource Manager (RM) spec from the TCG
License: BSD
URL: https://github.com/tpm2-software/tpm2-abrmd
Source0: https://github.com/tpm2-software/tpm2-abrmd/releases/download/%{version}/%{name}-%{version}.tar.gz
BuildRequires: systemd pkgconfig(cmocka) pkgconfig(dbus-1) pkgconfig(gio-unix-2.0) pkgconfig(tss2-mu) pkgconfig(tss2-sys)
BuildRequires: tpm2-tss-devel >= 2.4.0 libtool autoconf-archive libgcrypt libgcrypt-devel
BuildRequires: tpm2-tss-devel libtool autoconf-archive libgcrypt libgcrypt-devel
BuildRequires: chrpath
BuildRequires: selinux-policy-devel pkgconfig(systemd)
# tpm2-abrmd depends on the package that contains itsSELinux policy module
Requires: (%{name}-selinux >= 2.3.3-2 if selinux-policy)
Requires: (%{name}-selinux >= 2.0.0-1 if selinux-policy-%{selinuxtype})
%description
This is a system daemon implementing the TPM2 access broker (TAB) & Resource Manager (RM) spec from the TCG.
@ -23,7 +23,7 @@ The daemon (tpm2-abrmd) is implemented using Glib and the GObject system.
%package devel
Summary: Files necessary to develop applications with tpm2-abrmd
Requires: %{name}%{_isa} = %{version}-%{release}
Requires: tpm2-tss-devel >= 2.4.0
Requires: tpm2-tss-devel
%description devel
@ -35,7 +35,7 @@ This package contains development library files, headers and config files of tpm
BuildArch: noarch
Summary: SELinux policies for tpm2-abrmd
Requires: selinux-policy >= 0.0.1
Requires(post): selinux-policy-%{selinuxtype}
Requires(post): selinux-policy-base >= 0.0.1
Requires(post): libselinux-utils
Requires(post): policycoreutils
Requires(post): policycoreutils-python-utils
@ -45,16 +45,13 @@ This package contains SELinux policies for tpm2-abrmd
%prep
%autosetup -p1 -n %{name}-%{version}
autoreconf --install
%build
export GDBUS_CODEGEN="/usr/bin/gdbus-codegen"
%configure --disable-static --disable-silent-rules \
--with-systemdsystemunitdir=%{_unitdir} \
--with-systemdpresetdir=%{_presetdir} \
--with-sepolicy \
--with-dbuspolicydir=%{_datadir}/dbus-1/system.d/ \
--enable-unit
--with-sepolicy
%make_build
%install
@ -75,31 +72,35 @@ mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
echo "/usr/lib64/" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf
%check
make check
make test
%pre selinux
%pre
%selinux_relabel_pre -s targeted
#add a user to sandbox the tpm2-abrmd daemon
getent group tss >/dev/null || groupadd -g 59 -r tss
getent passwd tss >/dev/null || \
useradd -r -u 59 -g tss -d /dev/null -s /sbin/nologin \
-c "Account used by the tpm2-abrmd package to sandbox the tpm2-abrmd daemon" tss
exit 0
%preun
%systemd_preun tpm2-abrmd.service
%post
/sbin/ldconfig
%systemd_post tpm2-abrmd.service
%post selinux
%selinux_modules_install -s targeted %{_datadir}/selinux/packages/tabrmd.pp.bz2
%postun
/sbin/ldconfig
%systemd_postun tpm2-abrmd.service
%postun selinux
if [ $1 -eq 0 ]; then
%selinux_modules_uninstall -s targeted tabrmd
fi
%posttrans selinux
%posttrans
%selinux_relabel_post -s targeted
%files
@ -111,7 +112,7 @@ fi
%{_unitdir}/tpm2-abrmd.service
%{_presetdir}/tpm2-abrmd.preset
%{_datadir}/dbus-1/system-services/com.intel.tss2.Tabrmd.service
%{_datadir}/dbus-1/system.d/tpm2-abrmd.conf
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/tpm2-abrmd.conf
%config(noreplace) /etc/ld.so.conf.d/*
%files devel
@ -132,36 +133,6 @@ fi
%{_datadir}/selinux/packages/tabrmd.pp.bz2
%changelog
* Tue Jan 10 2023 jinlun <jinlun@huawei.com> - 2.4.1-2
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: add code check in tpm2-abrmd
* Thu Nov 3 2022 jinlun<jinlun@huawei.com> - 2.4.1-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: update to 2.4.1
* Tue Oct 25 2022 gaoyusong<gaoyusong2@huawei.com> - 2.4.0-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix problem that pointers access invalid address
* Tue Dec 14 2021 panxiaohe<panxiaohe@huawei.com> - 2.4.0-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: update to 2.4.0
* Tue May 25 2021 Hugel<gengqihu1@huawei.com> - 2.3.3-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: fix the SELinux label missing issue
* Mon Aug 31 2020 Hugel<gengqihu1@huawei.com> - 2.3.3-1
- Type:enhancement
- ID:NA