Accepting request 934691 from home:aplanas:branches:security
- Use a bcond to enable selinux when is available OBS-URL: https://build.opensuse.org/request/show/934691 OBS-URL: https://build.opensuse.org/package/show/security/tpm2.0-abrmd?expand=0&rev=63
This commit is contained in:
parent
b27e01aef4
commit
127461b313
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Nov 29 12:54:02 UTC 2021 - Alberto Planas Dominguez <aplanas@suse.com>
|
||||||
|
|
||||||
|
- Warp selinux into a bcond
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Nov 25 09:16:32 UTC 2021 - Johannes Segitz <jsegitz@suse.com>
|
Thu Nov 25 09:16:32 UTC 2021 - Johannes Segitz <jsegitz@suse.com>
|
||||||
|
|
||||||
|
@ -18,6 +18,16 @@
|
|||||||
|
|
||||||
%global selinuxtype targeted
|
%global selinuxtype targeted
|
||||||
%global modulename tabrmd
|
%global modulename tabrmd
|
||||||
|
# the auto activation is not whitelisted for <= SLE12-SP3
|
||||||
|
%if 0%{?sle_version} > 120300 || 0%{?is_opensuse}
|
||||||
|
%define install_dbus_files 1
|
||||||
|
%endif
|
||||||
|
# selinux only for Tumbleweed for now
|
||||||
|
%if 0%{?suse_version} >= 1550 && 0%{?is_opensuse}
|
||||||
|
%bcond_without selinux
|
||||||
|
%else
|
||||||
|
%bcond_with selinux
|
||||||
|
%endif
|
||||||
Name: tpm2.0-abrmd
|
Name: tpm2.0-abrmd
|
||||||
Version: 2.4.0
|
Version: 2.4.0
|
||||||
Release: 0
|
Release: 0
|
||||||
@ -35,23 +45,19 @@ BuildRequires: gcc-c++
|
|||||||
BuildRequires: libtool
|
BuildRequires: libtool
|
||||||
BuildRequires: pkgconfig
|
BuildRequires: pkgconfig
|
||||||
BuildRequires: policycoreutils
|
BuildRequires: policycoreutils
|
||||||
BuildRequires: selinux-policy-devel
|
|
||||||
BuildRequires: systemd-rpm-macros
|
BuildRequires: systemd-rpm-macros
|
||||||
BuildRequires: pkgconfig(dbus-1)
|
BuildRequires: pkgconfig(dbus-1)
|
||||||
BuildRequires: pkgconfig(gio-unix-2.0)
|
BuildRequires: pkgconfig(gio-unix-2.0)
|
||||||
BuildRequires: pkgconfig(tss2-sys)
|
BuildRequires: pkgconfig(tss2-sys)
|
||||||
# due to %%selinux_requires
|
|
||||||
BuildRequires: pkgconfig(systemd)
|
|
||||||
#
|
|
||||||
BuildRequires: selinux-policy-targeted
|
|
||||||
Requires(pre): user(tss)
|
|
||||||
Requires: libtss2-tcti-device0
|
Requires: libtss2-tcti-device0
|
||||||
Requires: libtss2-tcti-tabrmd0
|
Requires: libtss2-tcti-tabrmd0
|
||||||
Requires: tpm2-0-tss
|
Requires: tpm2-0-tss
|
||||||
|
Requires(pre): user(tss)
|
||||||
|
%if %{with selinux}
|
||||||
|
BuildRequires: selinux-policy-devel
|
||||||
|
BuildRequires: selinux-policy-targeted
|
||||||
|
BuildRequires: pkgconfig(systemd)
|
||||||
Requires: (%{name}-selinux if selinux-policy-base)
|
Requires: (%{name}-selinux if selinux-policy-base)
|
||||||
# the auto activation is not whitelisted for <= SLE12-SP3
|
|
||||||
%if 0%{?sle_version} > 120300 || 0%{?is_opensuse}
|
|
||||||
%define install_dbus_files 1
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -70,15 +76,17 @@ Requires: tpm2.0-abrmd = %{version}
|
|||||||
This package provides the development files for the Access Broker & Resource
|
This package provides the development files for the Access Broker & Resource
|
||||||
Manager for coordinating access to TPM 2.0 chips.
|
Manager for coordinating access to TPM 2.0 chips.
|
||||||
|
|
||||||
|
%if %{with selinux}
|
||||||
%package selinux
|
%package selinux
|
||||||
Summary: SELinux module for the Access Broker & Resource Manager for TPM 2.0 chips
|
Summary: SELinux module for the Access Broker & Resource Manager for TPM 2.0 chips
|
||||||
Group: System/Management
|
Group: System/Management
|
||||||
BuildArch: noarch
|
|
||||||
Requires: tpm2.0-abrmd = %{version}
|
Requires: tpm2.0-abrmd = %{version}
|
||||||
%selinux_requires
|
BuildArch: noarch
|
||||||
|
%{selinux_requires}
|
||||||
|
|
||||||
%description selinux
|
%description selinux
|
||||||
This package provides the SELinux module for the Access Broker & Resource Manager for TPM 2.0 chips.
|
This package provides the SELinux module for the Access Broker & Resource Manager for TPM 2.0 chips.
|
||||||
|
%endif
|
||||||
|
|
||||||
%package -n libtss2-tcti-tabrmd0
|
%package -n libtss2-tcti-tabrmd0
|
||||||
Summary: Client interface library for tpm2-abrmd
|
Summary: Client interface library for tpm2-abrmd
|
||||||
@ -98,12 +106,11 @@ use with the SAPI library (libtss2-sys) like any other TCTI.
|
|||||||
export CFLAGS="%{optflags} -fPIE"
|
export CFLAGS="%{optflags} -fPIE"
|
||||||
export LDFLAGS="$LDFLAGS -pie"
|
export LDFLAGS="$LDFLAGS -pie"
|
||||||
%configure \
|
%configure \
|
||||||
--disable-static \
|
--disable-static \
|
||||||
--with-sepolicy=yes \
|
%{?with_selinux: --with-sepolicy=yes} \
|
||||||
--with-systemdsystemunitdir=%{_unitdir} \
|
--with-systemdsystemunitdir=%{_unitdir} \
|
||||||
--with-dbuspolicydir=%{_datadir}/dbus-1/system.d
|
--with-dbuspolicydir=%{_datadir}/dbus-1/system.d
|
||||||
%{nil}
|
%make_build PTHREAD_LDFLAGS=-pthread
|
||||||
make %{?_smp_mflags} PTHREAD_LDFLAGS=-pthread
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install
|
%make_install
|
||||||
@ -112,13 +119,15 @@ find %{buildroot} -type f -name "*.la" -delete -print
|
|||||||
ln -sv %{_sbindir}/service %{buildroot}%{_sbindir}/rctpm2-abrmd
|
ln -sv %{_sbindir}/service %{buildroot}%{_sbindir}/rctpm2-abrmd
|
||||||
# don't install the systemd preset, our presets are handled by
|
# don't install the systemd preset, our presets are handled by
|
||||||
# systemd-presets-* packages
|
# systemd-presets-* packages
|
||||||
rm %{buildroot}/usr/lib*/systemd/system-preset/tpm2-abrmd.preset
|
rm %{buildroot}%{_prefix}/lib*/systemd/system-preset/tpm2-abrmd.preset
|
||||||
%if ! 0%{?install_dbus_files}
|
%if ! 0%{?install_dbus_files}
|
||||||
rm %{buildroot}/%{_sysconfdir}/dbus-1/system.d/tpm2-abrmd.conf
|
rm %{buildroot}/%{_sysconfdir}/dbus-1/system.d/tpm2-abrmd.conf
|
||||||
rm %{buildroot}/%{_datadir}/dbus-1/system-services/com.intel.tss2.Tabrmd.service
|
rm %{buildroot}/%{_datadir}/dbus-1/system-services/com.intel.tss2.Tabrmd.service
|
||||||
%endif
|
%endif
|
||||||
|
%if %{with selinux}
|
||||||
mkdir %{buildroot}%{_datadir}/selinux/packages/targeted
|
mkdir %{buildroot}%{_datadir}/selinux/packages/targeted
|
||||||
mv %{buildroot}%{_datadir}/selinux/packages/tab* %{buildroot}%{_datadir}/selinux/packages/targeted
|
mv %{buildroot}%{_datadir}/selinux/packages/tab* %{buildroot}%{_datadir}/selinux/packages/targeted
|
||||||
|
%endif
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
%service_add_pre tpm2-abrmd.service
|
%service_add_pre tpm2-abrmd.service
|
||||||
@ -132,19 +141,21 @@ mv %{buildroot}%{_datadir}/selinux/packages/tab* %{buildroot}%{_datadir}/selinux
|
|||||||
%preun
|
%preun
|
||||||
%service_del_preun tpm2-abrmd.service
|
%service_del_preun tpm2-abrmd.service
|
||||||
|
|
||||||
|
%if %{with selinux}
|
||||||
%pre selinux
|
%pre selinux
|
||||||
%selinux_relabel_pre -s %{selinuxtype}
|
%{selinux_relabel_pre -s %{selinuxtype}}
|
||||||
|
|
||||||
%post selinux
|
%post selinux
|
||||||
%selinux_modules_install -s %{selinuxtype} -p 200 %{_datadir}/selinux/packages/targeted/%{modulename}.pp.bz2
|
%{selinux_modules_install -s %{selinuxtype} -p 200 %{_datadir}/selinux/packages/targeted/%{modulename}.pp.bz2}
|
||||||
|
|
||||||
%postun selinux
|
%postun selinux
|
||||||
if [ $1 -eq 0 ]; then
|
if [ $1 -eq 0 ]; then
|
||||||
%selinux_modules_uninstall -s %{selinuxtype} -p 200 %{modulename}
|
%{selinux_modules_uninstall -s %{selinuxtype} -p 200 %{modulename}}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%posttrans selinux
|
%posttrans selinux
|
||||||
%selinux_relabel_post -s %{selinuxtype}
|
%{selinux_relabel_post -s %{selinuxtype}}
|
||||||
|
%endif
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc *.md
|
%doc *.md
|
||||||
@ -160,16 +171,20 @@ fi
|
|||||||
%{_datadir}/dbus-1/system-services/com.intel.tss2.Tabrmd.service
|
%{_datadir}/dbus-1/system-services/com.intel.tss2.Tabrmd.service
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if %{with selinux}
|
||||||
%files selinux
|
%files selinux
|
||||||
%{_datadir}/selinux/packages/targeted/tabrmd.pp.bz2
|
%{_datadir}/selinux/packages/targeted/tabrmd.pp.bz2
|
||||||
%ghost %verify(not md5 size mtime) %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{modulename}
|
%ghost %verify(not md5 size mtime) %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{modulename}
|
||||||
|
%endif
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%{_includedir}/tss2
|
%{_includedir}/tss2
|
||||||
%{_libdir}/*.so
|
%{_libdir}/*.so
|
||||||
%{_libdir}/pkgconfig/*.pc
|
%{_libdir}/pkgconfig/*.pc
|
||||||
%{_mandir}/man3/Tss2*
|
%{_mandir}/man3/Tss2*
|
||||||
|
%if %{with selinux}
|
||||||
%{_datadir}/selinux/devel/include/contrib/tabrmd.if
|
%{_datadir}/selinux/devel/include/contrib/tabrmd.if
|
||||||
|
%endif
|
||||||
|
|
||||||
%files -n libtss2-tcti-tabrmd0
|
%files -n libtss2-tcti-tabrmd0
|
||||||
%{_libdir}/libtss2-tcti-tabrmd.so.*
|
%{_libdir}/libtss2-tcti-tabrmd.so.*
|
||||||
|
Loading…
Reference in New Issue
Block a user