-
Notifications
You must be signed in to change notification settings - Fork 0
/
jellyfin_selinux.spec
70 lines (52 loc) · 1.7 KB
/
jellyfin_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
66
67
68
69
# vim: sw=4:ts=4:et
%define relabel_files() \
restorecon -R /usr/lib/jellyfinmediaserver/Plex Media Server; \
%define selinux_policyver 3.14.3-41
Name: jellyfin_selinux
Version: 1.0
Release: 1%{?dist}
Summary: SELinux policy module for jellyfin
Group: System Environment/Base
License: GPLv2+
# This is an example. You will need to change it.
URL: http://HOSTNAME
Source0: jellyfin.pp
Source1: jellyfin.if
Source2: jellyfin_selinux.8
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 jellyfin.
%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/jellyfin_selinux.8
install -d %{buildroot}/etc/selinux/targeted/contexts/users/
%post
semodule -n -i %{_datadir}/selinux/packages/jellyfin.pp
if /usr/sbin/selinuxenabled ; then
/usr/sbin/load_policy
%relabel_files
fi;
exit 0
%postun
if [ $1 -eq 0 ]; then
semodule -n -r jellyfin
if /usr/sbin/selinuxenabled ; then
/usr/sbin/load_policy
%relabel_files
fi;
fi;
exit 0
%files
%attr(0600,root,root) %{_datadir}/selinux/packages/jellyfin.pp
%{_datadir}/selinux/devel/include/contrib/jellyfin.if
%{_mandir}/man8/jellyfin_selinux.8.*
%changelog
* Sun Nov 8 2020 YOUR NAME <git@psanders.me> 1.0-1
- Initial version