[icinga-checkins] icinga.org: icingaweb2/master: RPM: Fix missing scriplets dependecies for selinux

git at icinga.org git at icinga.org
Tue Dec 13 13:47:31 CET 2016


Module: icingaweb2
Branch: master
Commit: 6c039445f252248f3762f3a8b78f82ac7b925c1c
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=6c039445f252248f3762f3a8b78f82ac7b925c1c

Author: Eric Lippmann <eric.lippmann at icinga.com>
Date:   Tue Dec 13 12:45:39 2016 +0100

RPM: Fix missing scriplets dependecies for selinux

refs #8270

---

 icingaweb2.spec |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/icingaweb2.spec b/icingaweb2.spec
index de3c1f9..9d7d9ac 100644
--- a/icingaweb2.spec
+++ b/icingaweb2.spec
@@ -112,7 +112,9 @@ BuildRequires:  checkpolicy, selinux-policy-devel, /usr/share/selinux/devel/poli
 %if "%{_selinux_policy_version}" != ""
 Requires:       selinux-policy >= %{_selinux_policy_version}
 %endif
-Requires:       %{name} = %{version}-%{release}
+Requires:           %{name} = %{version}-%{release}
+Requires(post):     policycoreutils
+Requires(postun):   policycoreutils
 
 %description selinux
 SELinux policy for Icinga Web 2
@@ -297,21 +299,21 @@ exit 0
 %post selinux
 for selinuxvariant in %{selinux_variants}
 do
-  /usr/sbin/semodule -s ${selinuxvariant} -i %{_datadir}/selinux/${selinuxvariant}/icingaweb2.pp &> /dev/null || :
+  %{_sbindir}/semodule -s ${selinuxvariant} -i %{_datadir}/selinux/${selinuxvariant}/icingaweb2.pp &> /dev/null || :
 done
-/sbin/restorecon -R %{basedir} || :
-/sbin/restorecon -R %{configdir} || :
-/sbin/restorecon -R %{logdir} || :
+%{_sbindir}/restorecon -R %{basedir} &> /dev/null || :
+%{_sbindir}/restorecon -R %{configdir} &> /dev/null || :
+%{_sbindir}/restorecon -R %{logdir} &> /dev/null || :
 
 %postun selinux
 if [ $1 -eq 0 ] ; then
   for selinuxvariant in %{selinux_variants}
   do
-     /usr/sbin/semodule -s ${selinuxvariant} -r icingaweb2 &> /dev/null || :
+     %{_sbindir}/semodule -s ${selinuxvariant} -r icingaweb2 &> /dev/null || :
   done
-  [ -d %{basedir} ] && /sbin/restorecon -R %{basedir} &> /dev/null || :
-  [ -d %{configdir} ] && /sbin/restorecon -R %{configdir} &> /dev/null || :
-  [ -d %{logdir} ] && /sbin/restorecon -R %{logdir} &> /dev/null || :
+  [ -d %{basedir} ] && %{_sbindir}/restorecon -R %{basedir} &> /dev/null || :
+  [ -d %{configdir} ] && %{_sbindir}/restorecon -R %{configdir} &> /dev/null || :
+  [ -d %{logdir} ] && %{_sbindir}/restorecon -R %{logdir} &> /dev/null || :
 fi
 
 %files selinux



More information about the icinga-checkins mailing list