Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@××××××.net>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: media-video/syncplay/, media-video/syncplay/files/
Date: Thu, 30 Apr 2020 18:15:34
Message-Id: 1588270514.508464ed92376afc7f9e7f4a2779f82960cc8cf4.andrewammerlaan@gentoo
1 commit: 508464ed92376afc7f9e7f4a2779f82960cc8cf4
2 Author: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
3 AuthorDate: Thu Apr 30 18:14:59 2020 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
5 CommitDate: Thu Apr 30 18:15:14 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=508464ed
7
8 media-video/syncplay: add initd script and confd conf
9
10 Package-Manager: Portage-2.3.99, Repoman-2.3.22
11 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> riseup.net>
12
13 media-video/syncplay/files/syncplay-server-init | 65 ++++++++++++++++++++++
14 .../syncplay/files/syncplay-server-init-conf | 14 +++++
15 media-video/syncplay/syncplay-1.6.4_p1.ebuild | 3 +
16 3 files changed, 82 insertions(+)
17
18 diff --git a/media-video/syncplay/files/syncplay-server-init b/media-video/syncplay/files/syncplay-server-init
19 new file mode 100644
20 index 0000000..3018075
21 --- /dev/null
22 +++ b/media-video/syncplay/files/syncplay-server-init
23 @@ -0,0 +1,65 @@
24 +#!/sbin/openrc-run
25 +# Copyright 1999-2020 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +command="/usr/bin/python"
29 +command_args="/usr/bin/syncplay-server"
30 +name="syncplay server"
31 +pidfile="/run/syncplay-server.pid"
32 +
33 +description="Syncplay Server to synchronize media playback"
34 +
35 +start() {
36 + ebegin "Starting ${name}"
37 +
38 + args=()
39 +
40 + if [[ ${port} ]]; then
41 + args+=" --port=${port}"
42 + fi
43 +
44 + if [[ ${isolate} == True ]]; then
45 + args+=" --isolate-rooms"
46 + fi
47 +
48 + if [[ ${password} ]]; then
49 + args+=" --password=${password}"
50 + fi
51 +
52 + if [[ ${salt} ]]; then
53 + args+=" --salt=${salt}"
54 + fi
55 +
56 + if [[ ${motd} ]]; then
57 + args+=" --motd-file=${motd}"
58 + fi
59 +
60 + if [[ ${noReady} == True ]]; then
61 + args+=" --disable-ready"
62 + fi
63 +
64 + if [[ ${noChat} == True ]]; then
65 + args+=" --disable-chat"
66 + fi
67 +
68 + if [[ ${maxChatLength} ]]; then
69 + args+=" --max-chat-message-length=${maxChatLength}"
70 + fi
71 +
72 + if [[ ${usernameLength} ]]; then
73 + args+=" --max-username-length=${usernameLength}"
74 + fi
75 +
76 + if [[ ${statsFile} ]]; then
77 + args+=" --stats-db-file=${statsFile}"
78 + fi
79 +
80 + if [[ ${tls} ]]; then
81 + args+=" --tls=${tls}"
82 + fi
83 +
84 + start-stop-daemon --start --background --make-pid --pidfile="${pidfile}" \
85 + --exec "${command}" -- "${command_args}" ${args}
86 +
87 + eend $?
88 +}
89
90 diff --git a/media-video/syncplay/files/syncplay-server-init-conf b/media-video/syncplay/files/syncplay-server-init-conf
91 new file mode 100644
92 index 0000000..c07ef82
93 --- /dev/null
94 +++ b/media-video/syncplay/files/syncplay-server-init-conf
95 @@ -0,0 +1,14 @@
96 +# This is the file that syncplay service loads settings from, it does not affect the binary itself
97 +# See https://syncplay.pl/guide/server/ for a list of available flags and description
98 +
99 +#port="223"
100 +#isolate=False
101 +#password="yourpassword"
102 +#salt="RANDOMSALT"
103 +#motd="/etc/syncplay/motd"
104 +#noReady=False
105 +#noChat=False
106 +#maxChatLength="500"
107 +#usernameLength="20"
108 +#statsFile="/etc/syncplay/stats.db"
109 +#tls="/etc/letsencrypt/live/syncplay.example.com/"
110
111 diff --git a/media-video/syncplay/syncplay-1.6.4_p1.ebuild b/media-video/syncplay/syncplay-1.6.4_p1.ebuild
112 index 773ee01..5e5fc87 100644
113 --- a/media-video/syncplay/syncplay-1.6.4_p1.ebuild
114 +++ b/media-video/syncplay/syncplay-1.6.4_p1.ebuild
115 @@ -40,6 +40,9 @@ python_install() {
116 emake "${MY_MAKEOPTS[@]}" install-client
117 use server && \
118 emake "${MY_MAKEOPTS[@]}" install-server
119 +
120 + newinitd "${FILESDIR}/${PN}-server-init" "${PN}"
121 + newconfd "${FILESDIR}/${PN}-server-init-conf" "${PN}"
122 }
123
124 pkg_postinst() {