From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1166559-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 41A86138350
	for <garchives@archives.gentoo.org>; Thu, 30 Apr 2020 18:15:34 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 66B82E0837;
	Thu, 30 Apr 2020 18:15:33 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 3E2B8E0837
	for <gentoo-commits@lists.gentoo.org>; Thu, 30 Apr 2020 18:15:33 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id D8C6334EEFB
	for <gentoo-commits@lists.gentoo.org>; Thu, 30 Apr 2020 18:15:31 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 66CAC1FB
	for <gentoo-commits@lists.gentoo.org>; Thu, 30 Apr 2020 18:15:29 +0000 (UTC)
From: "Andrew Ammerlaan" <andrewammerlaan@riseup.net>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Andrew Ammerlaan" <andrewammerlaan@riseup.net>
Message-ID: <1588270514.508464ed92376afc7f9e7f4a2779f82960cc8cf4.andrewammerlaan@gentoo>
Subject: [gentoo-commits] repo/proj/guru:dev commit in: media-video/syncplay/, media-video/syncplay/files/
X-VCS-Repository: repo/proj/guru
X-VCS-Files: media-video/syncplay/files/syncplay-server-init media-video/syncplay/files/syncplay-server-init-conf media-video/syncplay/syncplay-1.6.4_p1.ebuild
X-VCS-Directories: media-video/syncplay/files/ media-video/syncplay/
X-VCS-Committer: andrewammerlaan
X-VCS-Committer-Name: Andrew Ammerlaan
X-VCS-Revision: 508464ed92376afc7f9e7f4a2779f82960cc8cf4
X-VCS-Branch: dev
Date: Thu, 30 Apr 2020 18:15:29 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 06a48cf2-4078-4955-8a04-4c7a3070c0b2
X-Archives-Hash: 5015707bb9565fa6306737887c28cd82
Message-ID: <20200430181529.NME7QoMRF6MIW_LreO5AUi2sZhvD3TIAItmEaYvCEHY@z>

commit:     508464ed92376afc7f9e7f4a2779f82960cc8cf4
Author:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
AuthorDate: Thu Apr 30 18:14:59 2020 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
CommitDate: Thu Apr 30 18:15:14 2020 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=508464ed

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 <AT> riseup.net>

 media-video/syncplay/files/syncplay-server-init    | 65 ++++++++++++++++++++++
 .../syncplay/files/syncplay-server-init-conf       | 14 +++++
 media-video/syncplay/syncplay-1.6.4_p1.ebuild      |  3 +
 3 files changed, 82 insertions(+)

diff --git a/media-video/syncplay/files/syncplay-server-init b/media-video/syncplay/files/syncplay-server-init
new file mode 100644
index 0000000..3018075
--- /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 0000000..c07ef82
--- /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 773ee01..5e5fc87 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() {