aboutsummaryrefslogtreecommitdiff
path: root/apks/jellyfin
diff options
context:
space:
mode:
authorGabriel Arakaki Giovanini <mail@gabrielgio.me>2022-10-17 21:48:23 +0000
committerGabriel Arakaki Giovanini <mail@gabrielgio.me>2022-10-17 21:48:23 +0000
commit79c054a4536b9f21fa8e98513afb2cbcd799f71e (patch)
treec7ef92b79d49b9fd957903f0e8cf2e7a13acb14d /apks/jellyfin
parent0204e511bd3a183291c0582d51ee0f0c177754ec (diff)
downloadapkbuilds-79c054a4536b9f21fa8e98513afb2cbcd799f71e.tar.gz
apkbuilds-79c054a4536b9f21fa8e98513afb2cbcd799f71e.tar.bz2
apkbuilds-79c054a4536b9f21fa8e98513afb2cbcd799f71e.zip
feat: Add jellyfin
Add jellyfin to avoid importing the whole edge repo.
Diffstat (limited to 'apks/jellyfin')
-rw-r--r--apks/jellyfin/APKBUILD63
-rw-r--r--apks/jellyfin/jellyfin.confd5
-rw-r--r--apks/jellyfin/jellyfin.initd20
-rw-r--r--apks/jellyfin/jellyfin.pre-install9
4 files changed, 97 insertions, 0 deletions
diff --git a/apks/jellyfin/APKBUILD b/apks/jellyfin/APKBUILD
new file mode 100644
index 0000000..80b8076
--- /dev/null
+++ b/apks/jellyfin/APKBUILD
@@ -0,0 +1,63 @@
+# Maintainer: Simon Zeni <simon@bl4ckb0ne.ca>
+pkgname=jellyfin
+pkgver=10.8.5
+pkgrel=0
+pkgdesc="The Free Software Media System"
+pkgusers="$pkgname"
+pkggroups="$pkgname"
+install="$pkgname.pre-install"
+url="https://jellyfin.org/"
+arch="x86_64 armv7 aarch64"
+license="GPL-2.0-only"
+makedepends="dotnet6-sdk"
+depends="aspnetcore6-runtime ffmpeg"
+subpackages="$pkgname-openrc"
+source="$pkgname-$pkgver.tar.gz::https://github.com/jellyfin/jellyfin/archive/refs/tags/v$pkgver.tar.gz
+ $pkgname.initd
+ $pkgname.confd"
+
+case $CARCH in
+ x86_64) _dotnet_arch=x64;;
+ aarch64) _dotnet_arch=arm64;;
+ armv7|armhf) _dotnet_arch=arm;;
+esac
+
+# parses RID from /etc/os-release depending on if edge or production release
+# to set _runtime_id
+# shellcheck disable=SC2034
+. /etc/os-release
+[ -n "${VERSION_ID//[^_]}" ] && _runtime_id="alpine.${VERSION_ID%_*}-$_dotnet_arch" || _runtime_id="alpine.${VERSION_ID%.*}-$_dotnet_arch"
+
+build() {
+ dotnet build --configuration Release Jellyfin.Server --no-self-contained --runtime $_runtime_id
+ dotnet publish --configuration Release Jellyfin.Server --no-self-contained --output publish --runtime $_runtime_id
+}
+
+check() {
+ # check on aarch64 is broken for dotnet6-sdk v6.0.1xx due to
+ # https://github.com/microsoft/vstest/issues/2566
+ if [ "$CARCH" = "aarch64" ]; then
+ return
+ fi
+
+ dotnet test --runtime $_runtime_id
+}
+
+package() {
+ mkdir -p "$pkgdir"/usr/lib
+ cp -dr publish "$pkgdir"/usr/lib/jellyfin
+
+ mkdir -p "$pkgdir"/usr/bin
+ ln -s /usr/lib/jellyfin/jellyfin "$pkgdir"/usr/bin/jellyfin
+
+ install -Dm755 "$srcdir"/$pkgname.initd \
+ "$pkgdir"/etc/init.d/$pkgname
+ install -Dm644 "$srcdir"/$pkgname.confd \
+ "$pkgdir"/etc/conf.d/$pkgname
+}
+
+sha512sums="
+a4c436919ae6b07fede95b98d6a16c6405c5a8efd8457c522cf5dd273fa0edb9d33e582f59c3ac4377a19129512530c344de58d81807adbd83af16b41dea8e1d jellyfin-10.8.5.tar.gz
+364a70a953d921048a249fd370642c1782e434c850334cd55e35bbb10d1bb93482d37faa1c11da5d7acba96a084d9832e5db212b65b0fa9907c7d3afe553aaf9 jellyfin.initd
+d35eb07d11d711b8ad35c7726e151a8096609712fee3bfea00c9adeff8e56660e3cde3d9b0b2dc8a847514af4d2b32340e2b29b77facfab4f8921ba15ba671b0 jellyfin.confd
+"
diff --git a/apks/jellyfin/jellyfin.confd b/apks/jellyfin/jellyfin.confd
new file mode 100644
index 0000000..6cd891c
--- /dev/null
+++ b/apks/jellyfin/jellyfin.confd
@@ -0,0 +1,5 @@
+supervisor=supervise-daemon
+datadir="/var/lib/jellyfin"
+cachedir="/var/cache/jellyfin"
+logdir="/var/log/jellyfin"
+opts="--nowebclient"
diff --git a/apks/jellyfin/jellyfin.initd b/apks/jellyfin/jellyfin.initd
new file mode 100644
index 0000000..278d79d
--- /dev/null
+++ b/apks/jellyfin/jellyfin.initd
@@ -0,0 +1,20 @@
+#!/sbin/openrc-run
+
+name=jellyfin
+description="The Free Software Media System"
+
+command=/usr/bin/jellyfin
+command_user=jellyfin:jellyfin
+command_args="--datadir ${datadir} --cachedir ${cachedir} --logdir ${logdir} ${opts}"
+
+depend() {
+ use logger dns
+ need net
+ after firewall
+}
+
+start_pre() {
+ checkpath -d -o $command_user "$datadir"
+ checkpath -d -o $command_user "$cachedir"
+ checkpath -d -o $command_user "$logdir"
+}
diff --git a/apks/jellyfin/jellyfin.pre-install b/apks/jellyfin/jellyfin.pre-install
new file mode 100644
index 0000000..6e64716
--- /dev/null
+++ b/apks/jellyfin/jellyfin.pre-install
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+user=jellyfin
+group=jellyfin
+
+addgroup -S $group 2>/dev/null
+adduser -S -D -h /var/lib/$user -s /sbin/nologin -G $group -g $user $user 2>/dev/null
+
+exit 0