-
Notifications
You must be signed in to change notification settings - Fork 0
/
odroid-htpc.spec
88 lines (70 loc) · 2.6 KB
/
odroid-htpc.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Name: odroid-htpc
Version: 0.2.3
Release: 1%{?dist}
Summary: Configures an ODROID to act as an HTPC using Kodi
Group: Applications/Multimedia
License: BSD
URL: http://hardkernel.com
Source0: kodi.service
Source1: htpc.target
Source2: kodi_shutdown.pkla
Source3: kodi.xml
Source4: htpc.xml
BuildArch: noarch
BuildRequires: systemd
Requires: dbus-x11
Requires: firewalld-filesystem
Requires: kodi
Requires: xorg-x11-xinit
Requires(pre): shadow-utils
Requires(post): firewalld-filesystem
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%description
This package installs various configurations needed for an ODROID to act as
an HTPC. After enabling the kodi service and defaulting to the htpc target,
the system will automatically start Kodi on boot.
Use this command to enable the service:
systemctl enable kodi
Use this commands to default to htpc:
ln -sf /usr/lib/systemd/system/htpc.target /etc/systemd/system/default.target
%prep
%build
%install
install -p -m0644 -D %{SOURCE0} %{buildroot}%{_unitdir}/kodi.service
install -p -m0644 -D %{SOURCE1} %{buildroot}%{_unitdir}/htpc.target
install -p -m0640 -D %{SOURCE2} %{buildroot}%{_sysconfdir}/polkit-1/localauthority/50-local.d/kodi_shutdown.pkla
install -p -m0644 -D %{SOURCE3} %{buildroot}%{_prefix}/lib/firewalld/services/kodi.xml
install -p -m0644 -D %{SOURCE4} %{buildroot}%{_prefix}/lib/firewalld/zones/htpc.xml
%pre
getent group kodi >/dev/null || groupadd -r kodi
getent passwd kodi >/dev/null || \
useradd -g kodi \
-c "Kodi Media Center Standalone User" kodi
gpasswd -a kodi audio >/dev/null
gpasswd -a kodi video >/dev/null
%post
%firewalld_reload
%systemd_post kodi.service
%preun
%systemd_preun kodi.service
%postun
%systemd_postun_with_restart kodi.service
%files
%{_unitdir}/kodi.service
%{_unitdir}/htpc.target
%config(noreplace) %attr(0640, root, polkitd) %{_sysconfdir}/polkit-1/localauthority/50-local.d/kodi_shutdown.pkla
%{_prefix}/lib/firewalld/services/kodi.xml
%{_prefix}/lib/firewalld/zones/htpc.xml
%changelog
* Sun Oct 23 2016 Scott K Logan <logans@cottsay.net> - 0.2.3-1
- Add firewalld service and zone
* Sun Dec 27 2015 Scott K Logan <logans@cottsay.net> - 0.2.2-1
- Switch away from tty1 because it disables shutdown/reboot buttons
* Sat Dec 12 2015 Scott K Logan <logans@cottsay.net> - 0.2.1-1
- Update kodi.service to use tty1
* Tue Dec 08 2015 Scott K Logan <logans@cottsay.net> - 0.2.0-1
- Remove xinit shenanigans
* Sun Dec 06 2015 Scott K Logan <logans@cottsay.net> - 0.1.0-1
- Initial package