From 679674beabe108332b2d24fb2edfacee4ba4ac94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Bar=C4=87?= Date: Mon, 21 Sep 2020 03:59:56 +0200 Subject: [PATCH] www-servers/jellyfin-bin: fixes; add group dep 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 | 35 +++++++++++++++++++ .../jellyfin-bin/jellyfin-bin-10.6.4.ebuild | 35 ++++++++++++------- 2 files changed, 57 insertions(+), 13 deletions(-) create mode 100755 www-servers/jellyfin-bin/files/jellyfin diff --git a/www-servers/jellyfin-bin/files/jellyfin b/www-servers/jellyfin-bin/files/jellyfin new file mode 100755 index 0000000..67b05f5 --- /dev/null +++ b/www-servers/jellyfin-bin/files/jellyfin @@ -0,0 +1,35 @@ +#!/sbin/openrc-run + +# Copyright 1999-2020 Gentoo Foundation +# Distributed under the terms of the GNU General Public Licence v2 + + +name=jellyfin + +cfgfile="/etc/conf.d/${name}" + +command="/usr/lib/${name}/bin/${name}" +command_user="${name}" +command_background="yes" + +pidfile="/run/${name}.pid" + + +depend() { + need net +} + +start_pre() { + echo "Running with:" + echo " JELLYFIN_ARGS=${JELLYFIN_ARGS}" + echo " JELLYFIN_CACHE_DIR=${JELLYFIN_CACHE_DIR}" + echo " JELLYFIN_CONFIG_DIR=${JELLYFIN_CONFIG_DIR}" + echo " JELLYFIN_DATA_DIR=${JELLYFIN_DATA_DIR}" + echo " JELLYFIN_FFMPEG_OPT=${JELLYFIN_FFMPEG_OPT}" + echo " JELLYFIN_LOG_DIR=${JELLYFIN_LOG_DIR}" + echo " JELLYFIN_NOWEBAPP_OPT=${JELLYFIN_NOWEBAPP_OPT}" + echo " JELLYFIN_RESTART_OPT=${JELLYFIN_RESTART_OPT}" + echo " JELLYFIN_SERVICE_OPT=${JELLYFIN_SERVICE_OPT}" + echo " JELLYFIN_USER=${JELLYFIN_USER}" + echo " JELLYFIN_WEB_OPT=${JELLYFIN_WEB_OPT}" +} 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 912923d..eaa3f13 100644 --- a/www-servers/jellyfin-bin/jellyfin-bin-10.6.4.ebuild +++ b/www-servers/jellyfin-bin/jellyfin-bin-10.6.4.ebuild @@ -27,8 +27,13 @@ SLOT="0" KEYWORDS="-* ~amd64 ~arm64" IUSE="" -DEPEND="" +DEPEND=" + !www-servers/jellyfin + acct-group/jellyfin + acct-user/jellyfin +" RDEPEND=" + ${DEPEND} >=media-video/ffmpeg-4.2.2 dev-db/sqlite media-libs/fontconfig @@ -66,23 +71,27 @@ src_unpack() { src_install() { # Install the Server part insinto usr/lib/ - doins -r usr/lib/${MY_PN} + doins -r "usr/lib/${MY_PN}" insinto etc - doins -r etc/${MY_PN} - insinto etc/default - doins etc/default/${MY_PN} + doins -r "etc/${MY_PN}" # Install the Web UI part - insinto usr/lib/${MY_PN}/bin/${MY_PN}-web - doins -r usr/share/${MY_PN}/web/* + insinto "usr/lib/${MY_PN}/bin/${MY_PN}-web" + doins -r "usr/share/${MY_PN}/web"/* - # Install wrappers and services + # Install wrappers make_wrapper "${MY_PN}" "${EPREFIX}/usr/lib/${MY_PN}/bin/${MY_PN}" - dosym "${EPREFIX}/usr/bin/jellyfin" "${EPREFIX}/usr/bin/jellyfin-bin" - systemd_dounit lib/systemd/system/${MY_PN}.service - systemd_install_serviced etc/systemd/system/${MY_PN}.service.d/${MY_PN}.service.conf + dosym "${EPREFIX}/usr/bin/${MY_PN}" "${EPREFIX}/usr/bin/${PN}" + + # Install services + newinitd "${FILESDIR}/${MY_PN}" "${MY_PN}" + doconfd "etc/default/${MY_PN}" + dosym "${EPREFIX}/etc/conf.d/${MY_PN}" "${EPREFIX}/etc/default/${MY_PN}" + systemd_dounit "lib/systemd/system/${MY_PN}.service" + systemd_install_serviced "etc/systemd/system/${MY_PN}.service.d/${MY_PN}.service.conf" # Fix permissions - fperms +x /usr/lib/${MY_PN}/* - fperms +x /usr/lib/${MY_PN}/bin/* + chmod +x "${ED}/usr/lib/${MY_PN}"/* || die + chmod +x "${ED}/usr/lib/${MY_PN}/bin"/* || die + chown -R jellyfin:jellyfin "${ED}/usr/lib/${MY_PN}" || die }