X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=macros.selinux;fp=macros.selinux;h=f5f5934a8ddc094d84857d1480cfbf94aecb9704;hb=9a710165b069622ace5c1c784494f2281db74256;hp=0000000000000000000000000000000000000000;hpb=41a8035cb2cd12eae13a5d6ed282559894274ed6;p=packages%2Frpm-tld-macros.git diff --git a/macros.selinux b/macros.selinux new file mode 100644 index 0000000..f5f5934 --- /dev/null +++ b/macros.selinux @@ -0,0 +1,38 @@ +# SELinux specific macro definitions. + +# Desired selinux policy tree +%__policy_tree %{expand:%%global __policy_tree %{lua:\ +t="targeted"\ +f = io.open("/etc/selinux/config")\ +if f then\ + for l in f:lines() do\ + if "SELINUXTYPE=" == string.sub(l,0,12) then t=string.sub(l,13); end\ + end\ + f:close()\ +end\ +print (t)\ +}}%{__policy_tree} + +# Path to selinux file context patterns. +%__file_context_path /etc/selinux/%{__policy_tree}/contexts/files/file_contexts + +# +# Path to selinux file context patterns used to add +# RPMTAG_FILECONTEXTS to packages when building. +# +# Undefined, missing or %{nil} will disable. +%_build_file_context_path %{nil} + +# +# Path to selinux file context patterns used to set +# (or override package content) file contexts when installing. +# +# Undefined, missing or %{nil} will use package content (if available). +%_install_file_context_path %{__file_context_path} + +# +# Path to selinux file context patterns used to verify +# file contexts on file system. +# +# Undefined, missing or %{nil} will use package content (if available). +%_verify_file_context_path %{__file_context_path}