diff --git a/rpm.macros b/rpm.macros index bf473c9..cc598d6 100644 --- a/rpm.macros +++ b/rpm.macros @@ -20,11 +20,13 @@ %_selinux_policy_version SELINUXPOLICYVERSION +%_selinux_store_path SELINUXSTOREPATH + %_file_context_file %{_sysconfdir}/selinux/${SELINUXTYPE}/contexts/files/file_contexts %_file_context_file_pre %{_localstatedir}/lib/rpm-state/file_contexts.pre -%_file_custom_defined_booleans %{_sharedstatedir}/selinux/${_policytype}/rpmbooleans.custom -%_file_custom_defined_booleans_tmp %{_sharedstatedir}/selinux/${_policytype}/rpmbooleans.custom.tmp +%_file_custom_defined_booleans %{_selinux_store_path}/${_policytype}/rpmbooleans.custom +%_file_custom_defined_booleans_tmp %{_selinux_store_path}/${_policytype}/rpmbooleans.custom.tmp # %selinux_requires %selinux_requires \ @@ -64,7 +66,7 @@ if [ -z "${_policytype}" ]; then \ _policytype="targeted" \ fi \ if [ $1 -eq 0 ]; then \ - %{_sbindir}/semodule -n -X %{!-p:200}%{-p*} -r %* &> /dev/null || : \ + %{_sbindir}/semodule -n -X %{!-p:200}%{-p*} -s ${_policytype} -r %* &> /dev/null || : \ if %{_sbindir}/selinuxenabled && [ "${SELINUXTYPE}" = "${_policytype}" ]; then \ %{_sbindir}/load_policy \ fi \ @@ -93,7 +95,7 @@ if [ -z "${_policytype}" ]; then \ fi \ if %{_sbindir}/selinuxenabled && [ "${SELINUXTYPE}" = "${_policytype}" ]; then \ if [ -f %{_file_context_file_pre} ]; then \ - %{_sbindir}/fixfiles -C %{_file_context_file_pre} restore \ + %{_sbindir}/fixfiles -C %{_file_context_file_pre} restore &> /dev/null \ rm -f %{_file_context_file_pre} \ fi \ fi \ diff --git a/selinux-policy.spec b/selinux-policy.spec index fd9545a..e7c7e60 100644 --- a/selinux-policy.spec +++ b/selinux-policy.spec @@ -438,6 +438,7 @@ mv %{buildroot}%{_usr}/share/man/man8/style.css %{buildroot}%{_usr}/share/selinu mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d install -m 644 %{SOURCE102} %{buildroot}%{_rpmconfigdir}/macros.d/macros.selinux-policy sed -i 's/SELINUXPOLICYVERSION/%{version}-%{release}/' %{buildroot}%{_rpmconfigdir}/macros.d/macros.selinux-policy +sed -i 's/SELINUXSTOREPATH/%{_sharestatedir}/selinux/' %{buildroot}%{_rpmconfigdir}/macros.d/macros.selinux-policy rm -rf selinux_config