aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ammerlaan <andrewammerlaan@riseup.net>2020-04-30 20:14:59 +0200
committerAndrew Ammerlaan <andrewammerlaan@riseup.net>2020-04-30 20:15:14 +0200
commit508464ed92376afc7f9e7f4a2779f82960cc8cf4 (patch)
treef12a6a03601f0b16d7f69e3a7a11ddd16cd7e006 /media-video
parentdev-libs/octetos-core: adding package (diff)
downloadguru-508464ed92376afc7f9e7f4a2779f82960cc8cf4.tar.gz
guru-508464ed92376afc7f9e7f4a2779f82960cc8cf4.tar.bz2
guru-508464ed92376afc7f9e7f4a2779f82960cc8cf4.zip
media-video/syncplay: add initd script and confd conf
Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@riseup.net>
Diffstat (limited to 'media-video')
-rw-r--r--media-video/syncplay/files/syncplay-server-init65
-rw-r--r--media-video/syncplay/files/syncplay-server-init-conf14
-rw-r--r--media-video/syncplay/syncplay-1.6.4_p1.ebuild3
3 files changed, 82 insertions, 0 deletions
diff --git a/media-video/syncplay/files/syncplay-server-init b/media-video/syncplay/files/syncplay-server-init
new file mode 100644
index 00000000..30180757
--- /dev/null
+++ b/media-video/syncplay/files/syncplay-server-init
@@ -0,0 +1,65 @@
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/bin/python"
+command_args="/usr/bin/syncplay-server"
+name="syncplay server"
+pidfile="/run/syncplay-server.pid"
+
+description="Syncplay Server to synchronize media playback"
+
+start() {
+ ebegin "Starting ${name}"
+
+ args=()
+
+ if [[ ${port} ]]; then
+ args+=" --port=${port}"
+ fi
+
+ if [[ ${isolate} == True ]]; then
+ args+=" --isolate-rooms"
+ fi
+
+ if [[ ${password} ]]; then
+ args+=" --password=${password}"
+ fi
+
+ if [[ ${salt} ]]; then
+ args+=" --salt=${salt}"
+ fi
+
+ if [[ ${motd} ]]; then
+ args+=" --motd-file=${motd}"
+ fi
+
+ if [[ ${noReady} == True ]]; then
+ args+=" --disable-ready"
+ fi
+
+ if [[ ${noChat} == True ]]; then
+ args+=" --disable-chat"
+ fi
+
+ if [[ ${maxChatLength} ]]; then
+ args+=" --max-chat-message-length=${maxChatLength}"
+ fi
+
+ if [[ ${usernameLength} ]]; then
+ args+=" --max-username-length=${usernameLength}"
+ fi
+
+ if [[ ${statsFile} ]]; then
+ args+=" --stats-db-file=${statsFile}"
+ fi
+
+ if [[ ${tls} ]]; then
+ args+=" --tls=${tls}"
+ fi
+
+ start-stop-daemon --start --background --make-pid --pidfile="${pidfile}" \
+ --exec "${command}" -- "${command_args}" ${args}
+
+ eend $?
+}
diff --git a/media-video/syncplay/files/syncplay-server-init-conf b/media-video/syncplay/files/syncplay-server-init-conf
new file mode 100644
index 00000000..c07ef82b
--- /dev/null
+++ b/media-video/syncplay/files/syncplay-server-init-conf
@@ -0,0 +1,14 @@
+# This is the file that syncplay service loads settings from, it does not affect the binary itself
+# See https://syncplay.pl/guide/server/ for a list of available flags and description
+
+#port="223"
+#isolate=False
+#password="yourpassword"
+#salt="RANDOMSALT"
+#motd="/etc/syncplay/motd"
+#noReady=False
+#noChat=False
+#maxChatLength="500"
+#usernameLength="20"
+#statsFile="/etc/syncplay/stats.db"
+#tls="/etc/letsencrypt/live/syncplay.example.com/"
diff --git a/media-video/syncplay/syncplay-1.6.4_p1.ebuild b/media-video/syncplay/syncplay-1.6.4_p1.ebuild
index 773ee016..5e5fc874 100644
--- a/media-video/syncplay/syncplay-1.6.4_p1.ebuild
+++ b/media-video/syncplay/syncplay-1.6.4_p1.ebuild
@@ -40,6 +40,9 @@ python_install() {
emake "${MY_MAKEOPTS[@]}" install-client
use server && \
emake "${MY_MAKEOPTS[@]}" install-server
+
+ newinitd "${FILESDIR}/${PN}-server-init" "${PN}"
+ newconfd "${FILESDIR}/${PN}-server-init-conf" "${PN}"
}
pkg_postinst() {