-
Notifications
You must be signed in to change notification settings - Fork 0
/
xonadm_selinux.spec
66 lines (53 loc) · 1.79 KB
/
xonadm_selinux.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# vim: sw=4:ts=4:et
%define selinux_policyver 34.21-1
Name: xonadm_selinux
Version: 1.0
Release: 1%{?dist}
Summary: SELinux policy module for xonadm
Group: System Environment/Base
License: GPLv2+
# This is an example. You will need to change it.
URL: http://HOSTNAME
Source0: xonadm.pp
Source1: xonadm.if
Source2: xonadm_selinux.8
Source3: xonadm_u
Requires: policycoreutils, libselinux-utils
Requires(post): selinux-policy-base >= %{selinux_policyver}, policycoreutils
Requires(postun): policycoreutils
BuildArch: noarch
%description
This package installs and sets up the SELinux policy security module for xonadm.
%install
install -d %{buildroot}%{_datadir}/selinux/packages
install -m 644 %{SOURCE0} %{buildroot}%{_datadir}/selinux/packages
install -d %{buildroot}%{_datadir}/selinux/devel/include/contrib
install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/selinux/devel/include/contrib/
install -d %{buildroot}%{_mandir}/man8/
install -m 644 %{SOURCE2} %{buildroot}%{_mandir}/man8/xonadm_selinux.8
install -d %{buildroot}/etc/selinux/targeted/contexts/users/
install -m 644 %{SOURCE3} %{buildroot}/etc/selinux/targeted/contexts/users/xonadm_u
%post
semodule -n -i %{_datadir}/selinux/packages/xonadm.pp
if /usr/sbin/selinuxenabled ; then
/usr/sbin/load_policy
/usr/sbin/semanage user -a -R xonadm_r xonadm_u
fi;
exit 0
%postun
if [ $1 -eq 0 ]; then
semodule -n -r xonadm
if /usr/sbin/selinuxenabled ; then
/usr/sbin/load_policy
/usr/sbin/semanage user -d xonadm_u
fi;
fi;
exit 0
%files
%attr(0600,root,root) %{_datadir}/selinux/packages/xonadm.pp
%{_datadir}/selinux/devel/include/contrib/xonadm.if
%{_mandir}/man8/xonadm_selinux.8.*
/etc/selinux/targeted/contexts/users/xonadm_u
%changelog
* Sun Oct 24 2021 YOUR NAME <YOUR@EMAILADDRESS> 1.0-1
- Initial version