Split off SELinux policy into swtpm-selinux
This commit is contained in:
parent
68cd9e9c01
commit
f662e81fe3
27
swtpm.spec
27
swtpm.spec
@ -12,7 +12,7 @@
|
|||||||
Summary: TPM Emulator
|
Summary: TPM Emulator
|
||||||
Name: swtpm
|
Name: swtpm
|
||||||
Version: 0.8.0
|
Version: 0.8.0
|
||||||
Release: 4%{?dist}
|
Release: 5%{?dist}
|
||||||
License: BSD
|
License: BSD
|
||||||
Url: http://github.com/stefanberger/swtpm
|
Url: http://github.com/stefanberger/swtpm
|
||||||
Source0: %{url}/archive/%{gitcommit}/%{name}-%{gitshortcommit}.tar.gz
|
Source0: %{url}/archive/%{gitcommit}/%{name}-%{gitshortcommit}.tar.gz
|
||||||
@ -49,9 +49,7 @@ BuildRequires: python3-devel
|
|||||||
|
|
||||||
Requires: %{name}-libs = %{version}-%{release}
|
Requires: %{name}-libs = %{version}-%{release}
|
||||||
Requires: libtpms >= 0.6.0
|
Requires: libtpms >= 0.6.0
|
||||||
%if ! 0%{?flatpak}
|
Requires: (%{name}-selinux if selinux-policy-targeted)
|
||||||
%{?selinux_requires}
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
TPM emulator built on libtpms providing TPM functionality for QEMU VMs
|
TPM emulator built on libtpms providing TPM functionality for QEMU VMs
|
||||||
@ -91,6 +89,16 @@ Requires: expect gnutls-utils %{!?rhel:trousers >= 0.3.9}
|
|||||||
%description tools-pkcs11
|
%description tools-pkcs11
|
||||||
Tools for creating a local CA based on a pkcs11 device
|
Tools for creating a local CA based on a pkcs11 device
|
||||||
|
|
||||||
|
%package selinux
|
||||||
|
Summary: SELinux security policy for swtpm
|
||||||
|
BuildArch: noarch
|
||||||
|
%if ! 0%{?flatpak}
|
||||||
|
%{?selinux_requires}
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%description selinux
|
||||||
|
SELinux security policy for swtpm.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -S git -n %{name}-%{gitcommit} -p1
|
%autosetup -S git -n %{name}-%{gitcommit} -p1
|
||||||
|
|
||||||
@ -113,21 +121,21 @@ make %{?_smp_mflags} check VERBOSE=1
|
|||||||
%make_install
|
%make_install
|
||||||
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.{a,la,so}
|
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.{a,la,so}
|
||||||
|
|
||||||
%post
|
%post selinux
|
||||||
for pp in /usr/share/selinux/packages/swtpm.pp \
|
for pp in /usr/share/selinux/packages/swtpm.pp \
|
||||||
/usr/share/selinux/packages/swtpm_svirt.pp; do
|
/usr/share/selinux/packages/swtpm_svirt.pp; do
|
||||||
%selinux_modules_install -s %{selinuxtype} ${pp}
|
%selinux_modules_install -s %{selinuxtype} ${pp}
|
||||||
done
|
done
|
||||||
restorecon %{_bindir}/swtpm
|
restorecon %{_bindir}/swtpm
|
||||||
|
|
||||||
%postun
|
%postun selinux
|
||||||
if [ $1 -eq 0 ]; then
|
if [ $1 -eq 0 ]; then
|
||||||
for p in swtpm swtpm_svirt; do
|
for p in swtpm swtpm_svirt; do
|
||||||
%selinux_modules_uninstall -s %{selinuxtype} $p
|
%selinux_modules_uninstall -s %{selinuxtype} $p
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%posttrans
|
%posttrans selinux
|
||||||
%selinux_relabel_post -s %{selinuxtype}
|
%selinux_relabel_post -s %{selinuxtype}
|
||||||
|
|
||||||
%ldconfig_post libs
|
%ldconfig_post libs
|
||||||
@ -138,6 +146,8 @@ fi
|
|||||||
%doc README
|
%doc README
|
||||||
%{_bindir}/swtpm
|
%{_bindir}/swtpm
|
||||||
%{_mandir}/man8/swtpm.8*
|
%{_mandir}/man8/swtpm.8*
|
||||||
|
|
||||||
|
%files selinux
|
||||||
%{_datadir}/selinux/packages/swtpm.pp
|
%{_datadir}/selinux/packages/swtpm.pp
|
||||||
%{_datadir}/selinux/packages/swtpm_svirt.pp
|
%{_datadir}/selinux/packages/swtpm_svirt.pp
|
||||||
|
|
||||||
@ -186,6 +196,9 @@ fi
|
|||||||
%{_datadir}/swtpm/swtpm-create-tpmca
|
%{_datadir}/swtpm/swtpm-create-tpmca
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jul 19 2023 Stefan Berger <stefanb@linux.ibm.com> - 0.8.0-4
|
||||||
|
- Split off SELinux policy into swtpm-selinux
|
||||||
|
|
||||||
* Mon May 15 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 0.8.0-4
|
* Mon May 15 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 0.8.0-4
|
||||||
- Remove trousers dependency from RHEL builds
|
- Remove trousers dependency from RHEL builds
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user