Fix DBus policy location (rhbz #1955150), enable tests

This commit is contained in:
Peter Robinson 2021-06-12 13:34:42 +01:00
parent 03c88f028c
commit f3cbc8b4c5

View File

@ -1,8 +1,9 @@
%global selinuxtype targeted
%global with_tests 1
Name: tpm2-abrmd
Version: 2.4.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: A system daemon implementing TPM2 Access Broker and Resource Manager
License: BSD
@ -14,13 +15,15 @@ BuildRequires: make
BuildRequires: systemd
BuildRequires: libtool
BuildRequires: autoconf-archive
BuildRequires: pkgconfig(cmocka)
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(gio-unix-2.0)
BuildRequires: pkgconfig(tss2-mu)
BuildRequires: pkgconfig(tss2-sys)
# tpm2-abrmd depends on tpm2-tss-devel for tss2-mu/sys libs
BuildRequires: tpm2-tss-devel >= 2.4.0
%if 0%{?with_tests}
BuildRequires: pkgconfig(cmocka)
%endif
# tpm2-abrmd depends on the package that contains its SELinux policy module
Requires: (%{name}-selinux >= 2.0.0-1%{?dist} if selinux-policy-%{selinuxtype})
@ -46,7 +49,9 @@ required to build applications that use tpm2-abrmd.
%build
%configure --disable-static --disable-silent-rules \
--with-systemdsystemunitdir=%{_unitdir} \
--with-systemdpresetdir=%{_presetdir}
--with-systemdpresetdir=%{_presetdir} \
--with-dbuspolicydir=%{_datarootdir}/dbus-1/system.d/
%make_build
%install
@ -54,6 +59,11 @@ required to build applications that use tpm2-abrmd.
find %{buildroot}%{_libdir} -type f -name \*.la -delete
rm -f %{buildroot}/%{_presetdir}/tpm2-abrmd.preset
%if 0%{?with_tests}
%check
make check
%endif
%pre
getent group tss >/dev/null || groupadd -f -g 59 -r tss
if ! getent passwd tss >/dev/null ; then
@ -79,7 +89,7 @@ exit 0
%doc README.md CHANGELOG.md
%{_libdir}/libtss2-tcti-tabrmd.so.*
%{_sbindir}/tpm2-abrmd
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/tpm2-abrmd.conf
%{_datarootdir}/dbus-1/system.d/tpm2-abrmd.conf
%{_datarootdir}/dbus-1/system-services/com.intel.tss2.Tabrmd.service
%{_unitdir}/tpm2-abrmd.service
%{_mandir}/man3/Tss2_Tcti_Tabrmd_Init.3*
@ -93,6 +103,9 @@ exit 0
%changelog
* Sat Jun 12 2021 Peter Robinson <pbrobinson@fedoraproject.org> - 2.4.0-2
- Fix DBus policy location (rhbz #1955150), enable tests
* Tue Feb 09 2021 Peter Robinson <pbrobinson@fedoraproject.org> - 2.4.0-1
- Update to 2.4.0