www-servers/jellyfin-bin: fix web location; fix init file

Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Maciej Barć <xgqt@protonmail.com>
This commit is contained in:
Maciej Barć 2020-09-21 06:50:17 +02:00
parent 679674beab
commit 0647b44ecd
No known key found for this signature in database
GPG Key ID: 031C9FE65BED714A
2 changed files with 51 additions and 2 deletions

View File

@ -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 $?
}

View File

@ -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