File tree Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Original file line number Diff line number Diff line change 24
24
# Format must contain '$x' somewhere to do anything useful
25
25
%global _format() export %1= ""; for x in %{modulenames }; do %1+= %2; %1+= " "; done;
26
26
27
- # Relabel files
28
- %global relabel_files() %{_sbindir }/restorecon -R %{_bindir }/docker %{_localstatedir }/run/containerd.sock %{_localstatedir }/run/docker.sock %{_localstatedir }/run/docker.pid %{_sysconfdir }/docker %{_localstatedir }/log/docker %{_localstatedir }/log/lxc %{_localstatedir }/lock/lxc %{_unitdir }/docker.service %{_unitdir }/docker-containerd.service %{_sysconfdir }/docker %{_libexecdir }/docker &> /dev/null || :
29
-
30
27
# Version of SELinux we were using
31
28
%if 0%{?fedora } >= 22
32
29
%global selinux_policyver 3.13.1-220
@@ -87,6 +84,9 @@ rm -rf container-selinux.spec
87
84
88
85
%check
89
86
87
+ %pre
88
+ %selinux_relabel_pre -s %{selinuxtype }
89
+
90
90
%post
91
91
# Install all modules in a single transaction
92
92
if [ $1 -eq 1 ]; then
96
96
%{_sbindir }/semodule -n -s %{selinuxtype } -r container 2> /dev/null
97
97
%{_sbindir }/semodule -n -s %{selinuxtype } -d docker 2> /dev/null
98
98
%{_sbindir }/semodule -n -s %{selinuxtype } -d gear 2> /dev/null
99
- %{_sbindir }/semodule -n -X 200 -s %{selinuxtype } -i $MODULES > /dev/null
100
- if %{_sbindir}/selinuxenabled ; then
101
- %{_sbindir}/load_policy
102
- %relabel_files
103
- if [ $1 -eq 1 ]; then
104
- restorecon -R %{_sharedstatedir}/docker & > /dev/null || :
105
- fi
106
- fi
99
+ %selinux_modules_install -s %{selinuxtype } $MODULES
107
100
108
101
%postun
109
102
if [ $1 -eq 0 ]; then
110
- %{_sbindir}/semodule -n -r %{modulenames} docker & > /dev/null || :
111
- if %{_sbindir}/selinuxenabled ; then
112
- %{_sbindir}/load_policy
113
- %relabel_files
114
- fi
103
+ %selinux_modules_uninstall -s %{selinuxtype} %{modulenames} docker
115
104
fi
116
105
106
+ %posttrans
107
+ %selinux_relabel_post -s %{selinuxtype }
108
+
117
109
#define license tag if not already defined
118
110
%{! ?_licensedir:%global license %doc }
119
111
You can’t perform that action at this time.
0 commit comments