diff options
-rw-r--r-- | media-tv/jellyfin/Manifest | 8 | ||||
-rw-r--r-- | media-tv/jellyfin/files/jellyfin.conf.d | 23 | ||||
-rwxr-xr-x | media-tv/jellyfin/files/jellyfin.init.d | 32 | ||||
-rw-r--r-- | media-tv/jellyfin/files/jellyfin.service | 13 | ||||
-rw-r--r-- | media-tv/jellyfin/files/jellyfin.service.conf | 22 | ||||
-rw-r--r-- | media-tv/jellyfin/files/logging.json | 30 | ||||
-rw-r--r-- | media-tv/jellyfin/jellyfin-10.6.4.ebuild | 80 |
7 files changed, 208 insertions, 0 deletions
diff --git a/media-tv/jellyfin/Manifest b/media-tv/jellyfin/Manifest new file mode 100644 index 0000000..1a499a2 --- /dev/null +++ b/media-tv/jellyfin/Manifest @@ -0,0 +1,8 @@ +AUX jellyfin.conf.d 705 BLAKE2B b84357eb38ebdb702f33c40f561b0f69121e6640ddde153956dfc748ee2015eb50247bc7d133be087e34c329281e8bdd4b59d881ef9746a600990cdb6a76e029 SHA512 f7667f6f436ff4a1b8b722a09ccb839bb3e6345936fb6be9412941579fca8f0fa65510120c924dac9ea6e6103298234e8f082ce023668a52aee33f20abb8f554 +AUX jellyfin.init.d 792 BLAKE2B 6864de02d331d03a9d35bfc17cf1de4749a3a4c624815d8260b58f029176c2a742beffa5e3cb11afe64791d2a301c0cf15ac8dd87402c1e9cba390a28da2eab6 SHA512 a0d13cbf9620727ac3cee327a906c35573157bd5496171eb4e899812a76d32dc0a308909bc06744f6307b6096c6a9a034766fb38c679d90dee1d6a13e65c9f67 +AUX jellyfin.service 284 BLAKE2B edb72b8827cc50bd3150f4ea4ba9ba8db79abb754cc27f395778be28d2afe62dd57466d5670dbcce767ac693bfeb8f0e28419d4aa3e469c7ea98aedebadf08ba SHA512 99d2ee1bf8ebc50fbd8e077f1815014236a82db4065d96e64ad0aa3a3bf6aa4c7a33b1dd5ae1b978fa802ac3a81358276cb40c0f3c17ebaa96292de9711cc6f5 +AUX jellyfin.service.conf 614 BLAKE2B 7f083260c8fdc0ad675f0bbe525439d5e9c1e2f8d44183717f2f5a3fb7df887efed43951126dcad4af3f1396d2caccbc6a6be9a4183506c4990317eb434be192 SHA512 6643f1a4b10e10ef1df2f1f658d33fe5db353ac576eaec0408c2d4b274529b5a61b4c245da705fb98f3b31325e02a14bed30c7a92dbc3a638fba67bf8f593afc +AUX logging.json 1040 BLAKE2B 7aa5c3a71db3c532a65995a64b5a2b040624faeaa41dc76df04652ce582c4a7a00adc0226f8506a3bafc7828e1d18abbc68a706487fa4f011b8151aedd544623 SHA512 e29a95dec16b0e4028485a40578df4832569fe5e356b28e153d18ded2e25d2ba28c5817076066ea67ff7bff3ff266675f6468e0307f86ea5e63324280ac9452b +DIST jellyfin-10.6.4.tar.gz 1282345 BLAKE2B 4fe317773e8bca69c0c45ba05ea1d1e0006e08ac94b3711069f3faaa8a18d61972ce54c5321d0b4b32df9f3d2c9e647f40d6ae99ad5d18b2d32daac4d50ac520 SHA512 54fd370bedc5e809c8f6e0491c94696ef61430dd7e69691b4cfd70a90863d6921dbf4bccc056b9b21547b5b9411b0235c2fc30d61947c128633c762a38e5ac6e +DIST jellyfin-web-10.6.4.tar.gz 3887442 BLAKE2B e71697d920dce6f530065bf8b6c189ec766ab6a8c82326d9cc1f14fa64e77da28fb8d96b4929063c3a53669845693edf46399e6976339c9fc5eeff24c51e9af9 SHA512 ae71befc3d959efd10c769e9f542849d6b9461299231e008d88e7fcff5d2369f5b88789eacddabdf98c5f7d54f526e3f2b6a3ac3bb3b73ca6ea29c54d0c83954 +EBUILD jellyfin-10.6.4.ebuild 2160 BLAKE2B ab759d8c571cda66f1d545ee799c1ef4e530a5801650f72487e788bc9f18b007241d7e05c6c1d684e413543b6963d49b5fae3e48fb7f4fbb458d134ec0172270 SHA512 46a384bc382610bb7b874c6a685092bc883c17b757a0efce89d062d6d74eb5b0fd222ce385f8cc7e82598fbee9d314acd5387b0c3ffe755d80495f99bfd09341 diff --git a/media-tv/jellyfin/files/jellyfin.conf.d b/media-tv/jellyfin/files/jellyfin.conf.d new file mode 100644 index 0000000..459d754 --- /dev/null +++ b/media-tv/jellyfin/files/jellyfin.conf.d @@ -0,0 +1,23 @@ +# Jellyfin default configuration options +# This is a POSIX shell fragment + +# Use this file to override the default configurations; add additional +# options with JELLYFIN_ADD_OPTS. +#JELLYFIN_ADD_OPTS="" + +# Program directories +JELLYFIN_DATA_DIR="/var/lib/jellyfin" +JELLYFIN_CONFIG_DIR="/etc/jellyfin" +JELLYFIN_LOG_DIR="/var/log/jellyfin" +JELLYFIN_CACHE_DIR="/var/cache/jellyfin" + +# [OPTIONAL] run Jellyfin as a headless service +#JELLYFIN_SERVICE_OPT="--service" + +# [OPTIONAL] run Jellyfin without the web app +#JELLYFIN_NOWEBAPP_OPT="--noautorunwebapp" + +# Application username +JELLYFIN_USER="jellyfin" +# Full application command +JELLYFIN_ARGS="$JELLYFIN_SERVICE_OPT $JELLFIN_NOWEBAPP_OPT $JELLYFIN_ADD_OPTS" diff --git a/media-tv/jellyfin/files/jellyfin.init.d b/media-tv/jellyfin/files/jellyfin.init.d new file mode 100755 index 0000000..7ce8f54 --- /dev/null +++ b/media-tv/jellyfin/files/jellyfin.init.d @@ -0,0 +1,32 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="Jellyfin Media Server" + +user="${JELLYFIN_USER}:${JELLYFIN_USER}" + +start_stop_daemon_args="--user $user --wait 10" + +command="/usr/bin/jellyfin" +command_args="--configdir $JELLYFIN_CONFIG_DIR + --datadir $JELLYFIN_DATA_DIR + --cachedir $JELLYFIN_CACHE_DIR + --logdir $JELLYFIN_LOG_DIR + $JELLYFIN_ARGS" + +command_background="true" + +pidfile="/run/jellyfin.pid" + +depend() { + need net + after bootmisc +} + +start_pre() { + checkpath --directory --owner $user $JELLYFIN_CONFIG_DIR + checkpath --directory --owner $user $JELLYFIN_DATA_DIR + checkpath --directory --owner $user $JELLYFIN_CACHE_DIR + checkpath --directory --owner $user $JELLYFIN_LOG_DIR +} diff --git a/media-tv/jellyfin/files/jellyfin.service b/media-tv/jellyfin/files/jellyfin.service new file mode 100644 index 0000000..9a147f4 --- /dev/null +++ b/media-tv/jellyfin/files/jellyfin.service @@ -0,0 +1,13 @@ +[Unit] +Description = Jellyfin Media Server +After = network.target + +[Service] +Type = simple +User = jellyfin +ExecStart = /usr/bin/jellyfin ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT} ${JELLYFIN_ADD_OPTS} +Restart = on-failure +TimeoutSec = 15 + +[Install] +WantedBy = multi-user.target diff --git a/media-tv/jellyfin/files/jellyfin.service.conf b/media-tv/jellyfin/files/jellyfin.service.conf new file mode 100644 index 0000000..465a8fc --- /dev/null +++ b/media-tv/jellyfin/files/jellyfin.service.conf @@ -0,0 +1,22 @@ +# Jellyfin systemd configuration options + +# Use this file to override the user or environment file location. + +[Service] + +# Application username +User = jellyfin + +# Program directories +Environment="JELLYFIN_DATA_DIR=/var/lib/jellyfin" +Environment="JELLYFIN_CONFIG_DIR=/etc/jellyfin" +Environment="JELLYFIN_LOG_DIR=/var/log/jellyfin" +Environment="JELLYFIN_CACHE_DIR=/var/cache/jellyfin" + +# [OPTIONAL] run Jellyfin as a headless service +#Environment="JELLYFIN_SERVICE_OPT=--service" + +# [OPTIONAL] run Jellyfin without the web app +#Environment="JELLYFIN_NOWEBAPP_OPT=--noautorunwebapp" + +Environment="JELLYFIN_ADD_OPTS=" diff --git a/media-tv/jellyfin/files/logging.json b/media-tv/jellyfin/files/logging.json new file mode 100644 index 0000000..f32b208 --- /dev/null +++ b/media-tv/jellyfin/files/logging.json @@ -0,0 +1,30 @@ +{ + "Serilog": { + "MinimumLevel": "Information", + "WriteTo": [ + { + "Name": "Console", + "Args": { + "outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "Async", + "Args": { + "configure": [ + { + "Name": "File", + "Args": { + "path": "%JELLYFIN_LOG_DIR%//jellyfin.log", + "fileSizeLimitBytes": 10485700, + "rollOnFileSizeLimit": true, + "retainedFileCountLimit": 10, + "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message}{NewLine}{Exception}" + } + } + ] + } + } + ] + } +} diff --git a/media-tv/jellyfin/jellyfin-10.6.4.ebuild b/media-tv/jellyfin/jellyfin-10.6.4.ebuild new file mode 100644 index 0000000..db5d36b --- /dev/null +++ b/media-tv/jellyfin/jellyfin-10.6.4.ebuild @@ -0,0 +1,80 @@ +# Copyright 2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit systemd + +DESCRIPTION="The Free Software Media System" +HOMEPAGE="https://github.com/jellyfin/jellyfin" + +SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz + https://github.com/${PN}/${PN}-web/archive/v${PV}.tar.gz -> ${PN}-web-${PV}.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64" + +DEPEND="!media-tv/jellyfin-bin" +RDEPEND="${DEPEND} + acct-group/jellyfin + acct-user/jellyfin + media-video/ffmpeg[fontconfig,gmp,libass,libdrm,truetype,fribidi,vorbis,vdpau,vaapi,x264,x265,webp,bluray,zvbi,mp3,opus,theora] + sys-process/at + dev-db/sqlite:3 + media-libs/fontconfig + media-libs/freetype + dev-util/lttng-ust + app-crypt/mit-krb5 + dev-libs/icu + dev-libs/openssl" +BDEPEND="dev-dotnet/dotnetcore-sdk-bin:3.1 + sys-apps/yarn" + +METAFILETOBUILD="MediaBrowser.sln" + + +src_compile() { + cd ${WORKDIR}/${PN}-web-${PV} + yarn install || die + cp -r dist/. ${S}/MediaBrowser.WebDashboard/jellyfin-web + cd ${S} + export DOTNET_CLI_TELEMETRY_OPTOUT=1 + dotnet build --configuration Release Jellyfin.Server || die + dotnet publish --configuration Release Jellyfin.Server --output ${S}/bin --self-contained --runtime linux-x64 || die +} + +src_install() { + + insinto /etc/${PN} + doins ${FILESDIR}/logging.json + fowners -R "${PN}:${PN}" "/etc/${PN}" + + cp "${FILESDIR}/${PN}.conf.d" "${T}/${PN}.conf.d" || die + cp "${FILESDIR}/${PN}.service.conf" "${T}/${PN}.service.conf" || die + + sed -i "s|/usr/lib/|/usr/$(get_libdir)/|g" \ + "${T}/${PN}.conf.d" \ + "${T}/${PN}.service.conf" || die + + newconfd "${T}/${PN}.conf.d" "${PN}" + newinitd "${FILESDIR}/${PN}.init.d" "${PN}" + + systemd_install_serviced ${T}/${PN}.service.conf + systemd_dounit ${FILESDIR}/${PN}.service + + keepdir "/var/lib/${PN}" + fowners -R "${PN}:${PN}" "/var/lib/${PN}" + + keepdir "/var/log/${PN}" + fowners -R "${PN}:${PN}" "/var/log/${PN}" + + keepdir "/var/cache/${PN}" + fowners -R "${PN}:${PN}" "/var/cache/${PN}" + + insinto /usr/$(get_libdir)/${PN}/ + doins -r ${S}/bin + fperms 0755 /usr/$(get_libdir)/${PN}/bin/${PN} + + dosym /usr/$(get_libdir)/${PN}/bin/${PN} /usr/bin/${PN} +} |