From 88c4beb808aaad962d13a3c2577d030311b69b56 Mon Sep 17 00:00:00 2001 From: Lukas Vrabec Date: Nov 03 2019 12:21:27 +0000 Subject: Update the macros based on changes from upstream repo Ref: https://github.com/fedora-selinux/selinux-policy-macros/commit/b2f1034f7649afa16db93f08724dcb2c8ebbfc80 Resolves: #16 --- diff --git a/rpm.macros b/rpm.macros index d86e729..6e62d45 100644 --- a/rpm.macros +++ b/rpm.macros @@ -76,13 +76,15 @@ fi \ # %selinux_relabel_pre [-s ] %selinux_relabel_pre("s:") \ -. /etc/selinux/config \ -_policytype=%{-s*} \ -if [ -z "${_policytype}" ]; then \ - _policytype="targeted" \ -fi \ -if %{_sbindir}/selinuxenabled && [ "${SELINUXTYPE}" = "${_policytype}" ]; then \ - [ -f %{_file_context_file_pre} ] || cp -f %{_file_context_file} %{_file_context_file_pre} \ +if %{_sbindir}/selinuxenabled; then \ + . /etc/selinux/config \ + _policytype=%{-s*} \ + if [ -z "${_policytype}" ]; then \ + _policytype="targeted" \ + fi \ + if [ "${SELINUXTYPE}" = "${_policytype}" ]; then \ + [ -f %{_file_context_file_pre} ] || cp -f %{_file_context_file} %{_file_context_file_pre} \ + fi \ fi \ %{nil}