-
Notifications
You must be signed in to change notification settings - Fork 0
/
mumble-server-selinux.spec
63 lines (52 loc) · 1.74 KB
/
mumble-server-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
%global with_selinux 1
%global modulename mumble_server
%global selinuxtype targeted
Name: mumble-server-selinux
Version: 1.0
Release: 3%{?dist}
Summary: SELinux policy module for mumble-server
Group: System Environment/Base
License: GPLv2+
Source0: %{modulename}.te
Source1: %{modulename}.if
Source2: %{modulename}.fc
Source3: LICENSE
Requires: selinux-policy-%{selinuxtype}
Requires(post): selinux-policy-%{selinuxtype}
BuildRequires: selinux-policy-devel
BuildArch: noarch
%{?selinux_requires}
%description
SELinux policy module for mumble-server.
%build
%if 0%{?with_selinux}
mkdir -p selinux
cp -p %{SOURCE0} selinux/
cp -p %{SOURCE1} selinux/
cp -p %{SOURCE2} selinux/
cp -p %{SOURCE3} selinux/
make -f %{_datadir}/selinux/devel/Makefile %{modulename}.pp
bzip2 -9 -f %{modulename}.pp
%endif
%pre
%selinux_relabel_pre -s %{selinuxtype}
%install
install -D -m 0644 %{modulename}.pp.bz2 %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2
install -D -p -m 0644 selinux/%{modulename}.if %{buildroot}%{_datadir}/selinux/devel/include/distributed/%{modulename}.if
%check
%post
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2
%selinux_relabel_post -s %{selinuxtype}
if [ "$1" -le "1" ]; then
%systemd_postun_with_restart murmur.service
fi
%postun
if [ $1 -eq 0 ]; then
%selinux_modules_uninstall -s %{selinuxtype} %{modulename}
%selinux_relabel_post -s %{selinuxtype}
fi
%files
%{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.*
%{_datadir}/selinux/devel/include/distributed/%{modulename}.if
%ghost %verify(not md5 size mode mtime) %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{modulename}
%license selinux/LICENSE