%define reltype targeted %global gitname selinux-policy-openarc %global githash cee423d38917efa701dd416f59c8632fb87a0ffb Name: openarc-selinux Version: 20250111gitcee423d Release: 1%{?dist} Summary: SELinux policy module for openarc License: GPLv2+ URL: https://github.com/edmundlod/selinux-policy-openarc Source0: %{url}/archive/%{githash}.tar.gz BuildArch: noarch BuildRequires: selinux-policy-devel Requires: selinux-policy-%{reltype} Requires(post): policycoreutils, selinux-policy-%{reltype} Requires(postun): policycoreutils %description This package contains the SELinux policy module necessary to run the openarc service under a confined domain. %prep %autosetup -n %{gitname}-%{githash} %build # Compile the SELinux policy module using the standard system framework make -f /usr/share/selinux/devel/Makefile openarc.pp %install # Install the compiled policy module package (.pp) install -d %{buildroot}%{_datadir}/selinux/%{reltype} install -m 0644 openarc.pp %{buildroot}%{_datadir}/selinux/%{reltype}/openarc.pp # Install the interface file for other policies to reference install -d %{buildroot}%{_datadir}/selinux/devel/include/contrib install -m 0644 openarc.if %{buildroot}%{_datadir}/selinux/devel/include/contrib/openarc.if %post # Load the policy module into the running kernel /usr/sbin/semodule -n -i %{_datadir}/selinux/%{reltype}/openarc.pp if /usr/sbin/selinuxenabled ; then /usr/sbin/load_policy # Relabel the files associated with the daemon to enforce contexts %relabel_files fi exit 0 %postun if [ $1 -eq 0 ]; then # Remove the policy module upon package uninstallation /usr/sbin/semodule -n -r openarc if /usr/sbin/selinuxenabled ; then /usr/sbin/load_policy # Clear out contexts or trigger a lazy restorecon if needed fi fi exit 0 %files %attr(0644,root,root) %{_datadir}/selinux/%{reltype}/openarc.pp %attr(0644,root,root) %{_datadir}/selinux/devel/include/contrib/openarc.if %changelog * Thu Sep 03 2026 Release 1 - Initial release