From 0647b44ecddb39b2dcc5851dfd7e57526271d922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Bar=C4=87?= Date: Mon, 21 Sep 2020 06:50:17 +0200 Subject: [PATCH] www-servers/jellyfin-bin: fix web location; fix init file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Package-Manager: Portage-3.0.4, Repoman-3.0.1 Signed-off-by: Maciej Barć --- www-servers/jellyfin-bin/files/jellyfin | 44 ++++++++++++++++++- .../jellyfin-bin/jellyfin-bin-10.6.4.ebuild | 9 +++- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/www-servers/jellyfin-bin/files/jellyfin b/www-servers/jellyfin-bin/files/jellyfin index 67b05f5..0cdb068 100755 --- a/www-servers/jellyfin-bin/files/jellyfin +++ b/www-servers/jellyfin-bin/files/jellyfin @@ -9,7 +9,7 @@ name=jellyfin cfgfile="/etc/conf.d/${name}" command="/usr/lib/${name}/bin/${name}" -command_user="${name}" +command_user="${JELLYFIN_USER}" command_background="yes" pidfile="/run/${name}.pid" @@ -32,4 +32,46 @@ start_pre() { echo " JELLYFIN_SERVICE_OPT=${JELLYFIN_SERVICE_OPT}" echo " JELLYFIN_USER=${JELLYFIN_USER}" echo " JELLYFIN_WEB_OPT=${JELLYFIN_WEB_OPT}" + + mkdir -p ${JELLYFIN_CACHE_DIR} + mkdir -p ${JELLYFIN_CONFIG_DIR} + mkdir -p ${JELLYFIN_DATA_DIR} + mkdir -p ${JELLYFIN_LOG_DIR} + + chown -R ${command_user}:${command_user} ${JELLYFIN_CACHE_DIR} + chown -R ${command_user}:${command_user} ${JELLYFIN_CONFIG_DIR} + chown -R ${command_user}:${command_user} ${JELLYFIN_DATA_DIR} + chown -R ${command_user}:${command_user} ${JELLYFIN_LOG_DIR} +} + +start() { + ebegin "Starting ${name}" + + env JELLYFIN_CACHE_DIR=${JELLYFIN_CACHE_DIR} \ + JELLYFIN_CONFIG_DIR=${JELLYFIN_CONFIG_DIR} \ + JELLYFIN_DATA_DIR=${JELLYFIN_DATA_DIR} \ + JELLYFIN_LOG_DIR=${JELLYFIN_LOG_DIR} \ + start-stop-daemon --start --exec ${command} \ + --background \ + --pidfile ${pidfile} \ + --user ${command_user} \ + --make-pidfile \ + -- ${JELLYFIN_ARGS} + + eend $? +} + +stop() { + ebegin "Stopping ${name}" + + env JELLYFIN_CACHE_DIR=${JELLYFIN_CACHE_DIR} \ + JELLYFIN_CONFIG_DIR=${JELLYFIN_CONFIG_DIR} \ + JELLYFIN_DATA_DIR=${JELLYFIN_DATA_DIR} \ + JELLYFIN_LOG_DIR=${JELLYFIN_LOG_DIR} \ + start-stop-daemon --stop --exec ${command} \ + --pidfile ${pidfile} \ + --user ${command_user} \ + -- ${JELLYFIN_ARGS} + + eend $? } diff --git a/www-servers/jellyfin-bin/jellyfin-bin-10.6.4.ebuild b/www-servers/jellyfin-bin/jellyfin-bin-10.6.4.ebuild index eaa3f13..155d600 100644 --- a/www-servers/jellyfin-bin/jellyfin-bin-10.6.4.ebuild +++ b/www-servers/jellyfin-bin/jellyfin-bin-10.6.4.ebuild @@ -68,6 +68,13 @@ src_unpack() { unpack_deb "${P}-web.deb" } +src_prepare() { + default + + # Comment JELLYFIN_FFMPEG_OPT as that path is wrong + sed -i "s/JELLYFIN_FFMPEG_OPT=/#JELLYFIN_FFMPEG_OPT=/" "etc/default/${MY_PN}" +} + src_install() { # Install the Server part insinto usr/lib/ @@ -76,7 +83,7 @@ src_install() { doins -r "etc/${MY_PN}" # Install the Web UI part - insinto "usr/lib/${MY_PN}/bin/${MY_PN}-web" + insinto "usr/share/${MY_PN}/web" doins -r "usr/share/${MY_PN}/web"/* # Install wrappers