From 2a042c913ccc2ebf114386d33eb1aa4484d7aca4 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Tue, 18 May 2021 09:16:57 +0200 Subject: [PATCH] Update RHEL package spec files --- contrib/packages/rpm/el7/SPECS/tigervnc.spec | 34 +++++++++++------- contrib/packages/rpm/el8/SPECS/tigervnc.spec | 36 ++++++++++++-------- 2 files changed, 43 insertions(+), 27 deletions(-) diff --git a/contrib/packages/rpm/el7/SPECS/tigervnc.spec b/contrib/packages/rpm/el7/SPECS/tigervnc.spec index f739755c..52eea001 100644 --- a/contrib/packages/rpm/el7/SPECS/tigervnc.spec +++ b/contrib/packages/rpm/el7/SPECS/tigervnc.spec @@ -1,3 +1,8 @@ + +#defining macros needed by SELinux +%global selinuxtype targeted +%global modulename vncsession + Name: tigervnc Version: @VERSION@ Release: 1%{?snap:.%{snap}}%{?dist} @@ -121,10 +126,11 @@ This package contains icons for TigerVNC viewer %package selinux Summary: SELinux module for TigerVNC BuildArch: noarch -Requires(pre): libselinux-utils -Requires(post): selinux-policy-base >= %{_selinux_policy_version} -Requires(post): policycoreutils policycoreutils-python -Requires(post): libselinux-utils +BuildRequires: selinux-policy-devel +Requires: selinux-policy-%{selinuxtype} +Requires(post): selinux-policy-%{selinuxtype} +BuildRequires: selinux-policy-devel +%{?selinux_requires} %description selinux This package provides the SELinux policy module to ensure TigerVNC @@ -234,20 +240,18 @@ if [ -x %{_bindir}/gtk-update-icon-cache ]; then %{_bindir}/gtk-update-icon-cache -q %{_datadir}/icons/hicolor || : fi + %pre selinux -%selinux_relabel_pre +%selinux_relabel_pre -s %{selinuxtype} %post selinux -%selinux_modules_install %{_datadir}/selinux/packages/vncsession.pp -%selinux_relabel_post - -%posttrans selinux -%selinux_relabel_post +%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2 +%selinux_relabel_post -s %{selinuxtype} %postun selinux -%selinux_modules_uninstall vncsession if [ $1 -eq 0 ]; then - %selinux_relabel_post + %selinux_modules_uninstall -s %{selinuxtype} %{modulename} + %selinux_relabel_post -s %{selinuxtype} fi %files -f %{name}.lang @@ -297,9 +301,13 @@ fi %{_datadir}/icons/hicolor/*/apps/* %files selinux -%{_datadir}/selinux/packages/vncsession.pp +%{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.* +%ghost %verify(not md5 size mtime) %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{modulename} %changelog +* Tue May 18 2021 Jan Grulich 1.11.0-1 +- SELinux package improvements + * Mon Jul 27 2020 Mark Mielke 1.10.1-1 - Update build requirements and fix unexpected rpm macro expansion. diff --git a/contrib/packages/rpm/el8/SPECS/tigervnc.spec b/contrib/packages/rpm/el8/SPECS/tigervnc.spec index c2017cae..2a4e4dbd 100644 --- a/contrib/packages/rpm/el8/SPECS/tigervnc.spec +++ b/contrib/packages/rpm/el8/SPECS/tigervnc.spec @@ -1,3 +1,8 @@ + +#defining macros needed by SELinux +%global selinuxtype targeted +%global modulename vncsession + Name: tigervnc Version: @VERSION@ Release: 1%{?snap:.%{snap}}%{?dist} @@ -55,7 +60,7 @@ Provides: tightvnc-server = 1.5.0-0.15.20090204svn3586 Obsoletes: tightvnc-server < 1.5.0-0.15.20090204svn3586 Requires: perl-interpreter Requires: tigervnc-server-minimal = %{version}-%{release} -Requires: tigervnc-selinux = %{version}-%{release} +Requires: (%{name}-selinux if selinux-policy-%{selinuxtype}) Requires: xorg-x11-xauth Requires: xorg-x11-xinit Requires(post): systemd @@ -122,10 +127,11 @@ This package contains icons for TigerVNC viewer %package selinux Summary: SELinux module for TigerVNC BuildArch: noarch -Requires(pre): libselinux-utils -Requires(post): selinux-policy-base >= %{_selinux_policy_version} -Requires(post): policycoreutils policycoreutils-python -Requires(post): libselinux-utils +BuildRequires: selinux-policy-devel +Requires: selinux-policy-%{selinuxtype} +Requires(post): selinux-policy-%{selinuxtype} +BuildRequires: selinux-policy-devel +%{?selinux_requires} %description selinux This package provides the SELinux policy module to ensure TigerVNC @@ -235,20 +241,18 @@ if [ -x %{_bindir}/gtk-update-icon-cache ]; then %{_bindir}/gtk-update-icon-cache -q %{_datadir}/icons/hicolor || : fi + %pre selinux -%selinux_relabel_pre +%selinux_relabel_pre -s %{selinuxtype} %post selinux -%selinux_modules_install %{_datadir}/selinux/packages/vncsession.pp -%selinux_relabel_post - -%posttrans selinux -%selinux_relabel_post +%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2 +%selinux_relabel_post -s %{selinuxtype} %postun selinux -%selinux_modules_uninstall vncsession if [ $1 -eq 0 ]; then - %selinux_relabel_post + %selinux_modules_uninstall -s %{selinuxtype} %{modulename} + %selinux_relabel_post -s %{selinuxtype} fi %files -f %{name}.lang @@ -298,9 +302,13 @@ fi %{_datadir}/icons/hicolor/*/apps/* %files selinux -%{_datadir}/selinux/packages/vncsession.pp +%{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.* +%ghost %verify(not md5 size mtime) %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{modulename} %changelog +* Tue May 18 2021 Jan Grulich 1.11.0-1 +- SELinux package improvements + * Mon Jul 27 2020 Mark Mielke 1.10.1-1 - Update build requirements and fix unexpected rpm macro expansion. -- 2.39.5