1# Maintainer: Simon Zeni <simon@bl4ckb0ne.ca>
2pkgname=jellyfin
3pkgver=10.8.5
4pkgrel=0
5pkgdesc="The Free Software Media System"
6pkgusers="$pkgname"
7pkggroups="$pkgname"
8install="$pkgname.pre-install"
9url="https://jellyfin.org/"
10arch="x86_64"
11license="GPL-2.0-only"
12makedepends="dotnet6-sdk"
13depends="aspnetcore6-runtime ffmpeg"
14subpackages="$pkgname-openrc"
15source="$pkgname-$pkgver.tar.gz::https://github.com/jellyfin/jellyfin/archive/refs/tags/v$pkgver.tar.gz
16 $pkgname.initd
17 $pkgname.confd"
18
19case $CARCH in
20 x86_64) _dotnet_arch=x64;;
21 aarch64) _dotnet_arch=arm64;;
22 armv7|armhf) _dotnet_arch=arm;;
23esac
24
25# parses RID from /etc/os-release depending on if edge or production release
26# to set _runtime_id
27# shellcheck disable=SC2034
28. /etc/os-release
29[ -n "${VERSION_ID//[^_]}" ] && _runtime_id="alpine.${VERSION_ID%_*}-$_dotnet_arch" || _runtime_id="alpine.${VERSION_ID%.*}-$_dotnet_arch"
30
31build() {
32 dotnet build --configuration Release Jellyfin.Server --no-self-contained --runtime $_runtime_id
33 dotnet publish --configuration Release Jellyfin.Server --no-self-contained --output publish --runtime $_runtime_id
34}
35
36check() {
37 # check on aarch64 is broken for dotnet6-sdk v6.0.1xx due to
38 # https://github.com/microsoft/vstest/issues/2566
39 if [ "$CARCH" = "aarch64" ]; then
40 return
41 fi
42
43 dotnet test --runtime $_runtime_id
44}
45
46package() {
47 mkdir -p "$pkgdir"/usr/lib
48 cp -dr publish "$pkgdir"/usr/lib/jellyfin
49
50 mkdir -p "$pkgdir"/usr/bin
51 ln -s /usr/lib/jellyfin/jellyfin "$pkgdir"/usr/bin/jellyfin
52
53 install -Dm755 "$srcdir"/$pkgname.initd \
54 "$pkgdir"/etc/init.d/$pkgname
55 install -Dm644 "$srcdir"/$pkgname.confd \
56 "$pkgdir"/etc/conf.d/$pkgname
57}
58
59sha512sums="
60a4c436919ae6b07fede95b98d6a16c6405c5a8efd8457c522cf5dd273fa0edb9d33e582f59c3ac4377a19129512530c344de58d81807adbd83af16b41dea8e1d jellyfin-10.8.5.tar.gz
61364a70a953d921048a249fd370642c1782e434c850334cd55e35bbb10d1bb93482d37faa1c11da5d7acba96a084d9832e5db212b65b0fa9907c7d3afe553aaf9 jellyfin.initd
62d35eb07d11d711b8ad35c7726e151a8096609712fee3bfea00c9adeff8e56660e3cde3d9b0b2dc8a847514af4d2b32340e2b29b77facfab4f8921ba15ba671b0 jellyfin.confd
63"