From 2e746b9076281da6a8a6cfa70f11bd7fcf4db061 Mon Sep 17 00:00:00 2001 From: nyyu Date: Mon, 15 Nov 2021 09:42:49 +0100 Subject: [PATCH] add jellyfin --- jellyfin/.SRCINFO | 39 +++++++++++++++++++ jellyfin/PKGBUILD | 77 ++++++++++++++++++++++++++++++++++++++ jellyfin/jellyfin.conf | 6 +++ jellyfin/jellyfin.service | 13 +++++++ jellyfin/jellyfin.sysusers | 1 + jellyfin/jellyfin.tmpfiles | 2 + 6 files changed, 138 insertions(+) create mode 100644 jellyfin/.SRCINFO create mode 100644 jellyfin/PKGBUILD create mode 100644 jellyfin/jellyfin.conf create mode 100644 jellyfin/jellyfin.service create mode 100644 jellyfin/jellyfin.sysusers create mode 100644 jellyfin/jellyfin.tmpfiles diff --git a/jellyfin/.SRCINFO b/jellyfin/.SRCINFO new file mode 100644 index 0000000..0658bc5 --- /dev/null +++ b/jellyfin/.SRCINFO @@ -0,0 +1,39 @@ +pkgbase = jellyfin + pkgdesc = The Free Software Media System + pkgver = 10.8.0a2 + pkgrel = 1 + url = https://github.com/jellyfin/jellyfin + arch = i686 + arch = x86_64 + arch = armv6h + license = GPL2 + makedepends = dotnet-sdk>=6 + makedepends = npm + makedepends = git + source = jellyfin-10.8.0-alpha2.tar.gz::https://github.com/jellyfin/jellyfin/archive/v10.8.0-alpha2.tar.gz + source = jellyfin-web-10.8.0-alpha2.tar.gz::https://github.com/jellyfin/jellyfin-web/archive/v10.8.0-alpha2.tar.gz + source = jellyfin.conf + source = jellyfin.service + source = jellyfin.sysusers + source = jellyfin.tmpfiles + sha512sums = 9252e0bea2d9dab501f27edfc397e8bc5ff57cebb6974694f785a2d2df11eb1896268ca0dce3cc74df8d8427c38517fd9f223245bfad8bdc48dc2adcc1c609cc + sha512sums = 0b58f7376e05419e960042228e8d22ebf1076e27ab820beff851dd7e360dbb8b356ddf503d66d02ddab6565a70ed1fe43040647e511f9037c8660dcd35842fa1 + sha512sums = 2aa97a1a7a8a447171b59be3e93183e09cbbc32c816843cc47c6777b9aec48bd9c1d9d354f166e0b000ad8d2e94e6e4b0559aa52e5c159abbc103ed2c5afa3f0 + sha512sums = 99d02080b1b92e731250f39ddd13ceca7129d69d0c05e0939620cbc3f499a9574668c63fa889704a4905560888131e980d7ab1fbcc5837b04d33ce26daa9d42b + sha512sums = 6fc2638e6ec4b1ee0240e17815c91107b694e5fde72c1bc7956c83067bbeacb632de899b86837e47a0ec04288131b15c20746373b45e0669c8976069a55d627a + sha512sums = 45a62b62d97b9a83289d4dfde684163b1bcf340c1921fb958e5a701812c61b392901841940c67e5fa5148783277d5b4dc65ba01d3a22e8f855ea62154ad9be33 + +pkgname = jellyfin + depends = jellyfin-web=10.8.0a2 + depends = jellyfin-server=10.8.0a2 + +pkgname = jellyfin-web + pkgdesc = Jellyfin web client + +pkgname = jellyfin-server + pkgdesc = Jellyfin server component + depends = dotnet-runtime>=5 + depends = aspnet-runtime>=5 + depends = ffmpeg + depends = sqlite + backup = etc/conf.d/jellyfin diff --git a/jellyfin/PKGBUILD b/jellyfin/PKGBUILD new file mode 100644 index 0000000..ad1b456 --- /dev/null +++ b/jellyfin/PKGBUILD @@ -0,0 +1,77 @@ +# Maintainer: Luca Weiss +# Contributor: Maxime Gauduin +# Contributor: Daniel Seymour + +_pkgver=10.8.0-alpha2 +pkgbase=jellyfin +pkgname=(jellyfin jellyfin-web jellyfin-server) +pkgver=10.8.0a2 +pkgrel=1 +pkgdesc='The Free Software Media System' +arch=('i686' 'x86_64' 'armv6h') +url='https://github.com/jellyfin/jellyfin' +license=('GPL2') +makedepends=('dotnet-sdk>=6' 'npm' 'git') +source=("jellyfin-$_pkgver.tar.gz::https://github.com/jellyfin/jellyfin/archive/v$_pkgver.tar.gz" + "jellyfin-web-$_pkgver.tar.gz::https://github.com/jellyfin/jellyfin-web/archive/v$_pkgver.tar.gz" + 'jellyfin.conf' + 'jellyfin.service' + 'jellyfin.sysusers' + 'jellyfin.tmpfiles') +sha512sums=('9252e0bea2d9dab501f27edfc397e8bc5ff57cebb6974694f785a2d2df11eb1896268ca0dce3cc74df8d8427c38517fd9f223245bfad8bdc48dc2adcc1c609cc' + '0b58f7376e05419e960042228e8d22ebf1076e27ab820beff851dd7e360dbb8b356ddf503d66d02ddab6565a70ed1fe43040647e511f9037c8660dcd35842fa1' + '2aa97a1a7a8a447171b59be3e93183e09cbbc32c816843cc47c6777b9aec48bd9c1d9d354f166e0b000ad8d2e94e6e4b0559aa52e5c159abbc103ed2c5afa3f0' + '99d02080b1b92e731250f39ddd13ceca7129d69d0c05e0939620cbc3f499a9574668c63fa889704a4905560888131e980d7ab1fbcc5837b04d33ce26daa9d42b' + '6fc2638e6ec4b1ee0240e17815c91107b694e5fde72c1bc7956c83067bbeacb632de899b86837e47a0ec04288131b15c20746373b45e0669c8976069a55d627a' + '45a62b62d97b9a83289d4dfde684163b1bcf340c1921fb958e5a701812c61b392901841940c67e5fa5148783277d5b4dc65ba01d3a22e8f855ea62154ad9be33') + +build(){ + # Build jellyfin-web + cd jellyfin-web-$_pkgver + + npm install --cache "$srcdir"/npm-cache + + # Build jellyfin-server + cd ../jellyfin-$_pkgver + + # Disable dotnet telemetry + export DOTNET_CLI_TELEMETRY_OPTOUT=1 + + dotnet build --configuration Release Jellyfin.Server + # Ideally, this would be run in package() with the --output variable pointing + # to "$pkgdir"/usr/lib/jellyfin, but this step fails in fakeroot. + # The makepkg output looks like + # Restore completed in 56.84 ms for /aur/jellyfin-git/src/jellyfin/Jellyfin.Server/Jellyfin.Server.csproj. + # ==> ERROR: A failure occurred in package(). + # without indicating any sort of failure. + dotnet publish --configuration Release Jellyfin.Server --output "$PWD"/publish + # Clean up the runtimes folder (keep linux-*) + rm -rfv publish/runtimes/{alpine-*,osx*,tizen-*,win*} +} + +package_jellyfin() { + depends=("jellyfin-web=$pkgver" "jellyfin-server=$pkgver") +} + +package_jellyfin-server() { + pkgdesc="Jellyfin server component" + depends=('dotnet-runtime>=5' 'aspnet-runtime>=5' 'ffmpeg' 'sqlite') + backup=('etc/conf.d/jellyfin') + + mkdir -p "$pkgdir"/usr/lib + cp -dr --no-preserve='ownership' jellyfin-$_pkgver/publish "$pkgdir"/usr/lib/jellyfin + + install -Dm 644 jellyfin.service -t "$pkgdir"/usr/lib/systemd/system/ + install -Dm 644 jellyfin.sysusers "$pkgdir"/usr/lib/sysusers.d/jellyfin.conf + install -Dm 644 jellyfin.tmpfiles "$pkgdir"/usr/lib/tmpfiles.d/jellyfin.conf + install -Dm 644 jellyfin.conf "$pkgdir"/etc/conf.d/jellyfin +} + +package_jellyfin-web() { + pkgdesc="Jellyfin web client" + + mkdir -p "$pkgdir"/usr/lib/jellyfin + cp -r jellyfin-web-$_pkgver/dist "$pkgdir"/usr/lib/jellyfin/jellyfin-web +} + +# vim: ts=2 sw=2 et: diff --git a/jellyfin/jellyfin.conf b/jellyfin/jellyfin.conf new file mode 100644 index 0000000..c659bac --- /dev/null +++ b/jellyfin/jellyfin.conf @@ -0,0 +1,6 @@ +# Data directory +JELLYFIN_DATA_DIRECTORY="/var/lib/jellyfin" +# Cache directory +JELLYFIN_CACHE_DIRECTORY="/var/cache/jellyfin" +# Additional options for the binary +JELLYFIN_ADD_OPTS="" diff --git a/jellyfin/jellyfin.service b/jellyfin/jellyfin.service new file mode 100644 index 0000000..cd1626b --- /dev/null +++ b/jellyfin/jellyfin.service @@ -0,0 +1,13 @@ +[Unit] +Description=Jellyfin Media Server +After=network.target + +[Service] +User=jellyfin +EnvironmentFile=/etc/conf.d/jellyfin +ExecStart=/usr/bin/dotnet /usr/lib/jellyfin/jellyfin.dll --datadir ${JELLYFIN_DATA_DIRECTORY} --cachedir ${JELLYFIN_CACHE_DIRECTORY} ${JELLYFIN_ADD_OPTS} +Restart=on-abort +TimeoutSec=20 + +[Install] +WantedBy=multi-user.target diff --git a/jellyfin/jellyfin.sysusers b/jellyfin/jellyfin.sysusers new file mode 100644 index 0000000..41c3491 --- /dev/null +++ b/jellyfin/jellyfin.sysusers @@ -0,0 +1 @@ +u jellyfin - "Jellyfin Media Server" /var/lib/jellyfin diff --git a/jellyfin/jellyfin.tmpfiles b/jellyfin/jellyfin.tmpfiles new file mode 100644 index 0000000..fd1efe2 --- /dev/null +++ b/jellyfin/jellyfin.tmpfiles @@ -0,0 +1,2 @@ +d /var/cache/jellyfin 0755 jellyfin jellyfin - +d /var/lib/jellyfin 0755 jellyfin jellyfin -