%global debug_package %{nil} %if 0%{?almalinux} %global runtime_dist rhel.%{rhel} %endif %if 0%{?rocky} %global runtime_dist rocky.%{rhel} %endif %if 0%{?centos} && !0%{?almalinux} && !0%{?rocky} %global runtime_dist centos.%{rhel} %endif %if 0%{?rhel} && !0%{?almalinux} && !0%{?rocky} && !0%{?centos} %global runtime_dist rhel.%{rhel} %endif %if 0%{?fedora} %global runtime_dist fedora.%{fedora} %endif %ifarch x86_64 %global runtime_arch x64 %endif %ifarch aarch64 %global runtime_arch arm64 %endif %ifarch ppc64le s390x %global runtime_arch %{_arch} %endif Name: jellyfin Version: 10.9.0 Release: 9%{?dist} Summary: The Free Software Media System License: GPLv2 URL: https://jellyfin.org # Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `v%%{version}.tar.gz` Source0: jellyfin-server-%{version}.tar.gz Source1: jellyfin-dependencies-%{version}.tar.gz Source2: jellyfin-nupkg-%{version}.tar.gz Source10: jellyfin-selinux-launcher.sh Source11: jellyfin.service Source12: jellyfin.env Source13: jellyfin.override.conf Source14: jellyfin-firewalld.xml Source15: jellyfin-server-lowports.conf Source16: skia-v2.88.3.tar.gz Patch0: jellyfin-skia-s390x-build.patch %{?systemd_requires} BuildRequires: systemd BuildRequires: libcurl-devel, fontconfig-devel, freetype-devel, openssl-devel, glibc-devel, libicu-devel # Requirements not packaged in RHEL 7 main repos, added via Makefile # https://packages.microsoft.com/rhel/7/prod/ BuildRequires: dotnet-runtime-8.0, dotnet-sdk-8.0 Requires: %{name}-server = %{version}-%{release}, %{name}-web = %{version}-%{release} %ifarch ppc64le s390x BuildRequires: clang git-core gn libpng-devel ninja-build python3 %endif %description Jellyfin is a free software media system that puts you in control of managing and streaming your media. %package server # RPMfusion free Summary: The Free Software Media System Server backend Requires(pre): shadow-utils Requires: ffmpeg Requires: libcurl, fontconfig, freetype, openssl, glibc, libicu %ifarch ppc64le s390x Requires: libpng %endif %description server The Jellyfin media server backend. %package server-lowports # RPMfusion free Summary: The Free Software Media System Server backend. Low-port binding. Requires: jellyfin-server %description server-lowports The Jellyfin media server backend low port binding package. This package enables binding to ports < 1024. You would install this if you want the Jellyfin server to bind to ports 80 and/or 443 for example. %prep %autosetup -N -n jellyfin-server-%{version} -b 0 %build export DOTNET_CLI_TELEMETRY_OPTOUT=1 export PATH=$PATH:/usr/local/bin tar zxf %{SOURCE1} tar zxf %{SOURCE2} dotnet nuget add source jellyfin-dependencies-%{version} -n jellyfin-dependencies dotnet nuget add source jellyfin-nupkg-%{version} -n jellyfin-nupkg dotnet nuget disable source nuget # cannot use --output due to https://github.com/dotnet/sdk/issues/22220 dotnet publish --configuration Release --self-contained --runtime %{runtime_dist}-%{runtime_arch} \ -p:DebugSymbols=false -p:DebugType=none --packages jellyfin-dependencies-%{version} Jellyfin.Server %ifarch ppc64le s390x tar zxf %{SOURCE16} cd skia-v2.88.3 %ifarch s390x patch -p1 < %{PATCH0} %endif sed -i '10 i #include ' src/utils/SkParseColor.cpp sed -i 's/python /python3 /g' gn/toolchain/BUILD.gn find ./gn -name "*.py" -exec sed -i 's/env python$/env python3/g' {} + echo 'script_executable = "python3"' >> .gn gn gen 'out/linux/%{runtime_arch}' --args=' is_official_build=true skia_enable_tools=false target_os="linux" target_cpu="%{runtime_arch}" skia_use_icu=false skia_use_sfntly=false skia_use_piex=true skia_use_system_expat=false skia_use_system_freetype2=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=true skia_use_system_libwebp=false skia_use_system_zlib=false skia_enable_gpu=true extra_cflags=[ "-DSKIA_C_DLL" ] linux_soname_version="88.1.0"' ninja 'SkiaSharp' -C 'out/linux/%{runtime_arch}' %endif %install # Jellyfin files %{__mkdir} -p %{buildroot}%{_libdir}/jellyfin %{buildroot}%{_bindir} %{__cp} -r Jellyfin.Server/bin/Release/net8.0/%{runtime_dist}-%{runtime_arch}/publish/* %{buildroot}%{_libdir}/jellyfin %ifarch ppc64le s390x %{__cp} skia-v2.88.3/out/linux/%{runtime_arch}/libSkiaSharp.so.88.1.0 %{buildroot}%{_libdir}/jellyfin/libSkiaSharp.so %endif %{__install} -D %{SOURCE10} %{buildroot}%{_bindir}/jellyfin sed -i -e 's|/usr/lib64|%{_libdir}|g' %{buildroot}%{_bindir}/jellyfin # Jellyfin config %{__install} -D Jellyfin.Server/Resources/Configuration/logging.json %{buildroot}%{_sysconfdir}/jellyfin/logging.json %{__install} -D %{SOURCE12} %{buildroot}%{_sysconfdir}/sysconfig/jellyfin # system config %{__install} -D %{SOURCE14} %{buildroot}%{_prefix}/lib/firewalld/services/jellyfin.xml %{__install} -D %{SOURCE13} %{buildroot}%{_sysconfdir}/systemd/system/jellyfin.service.d/override.conf %{__install} -D %{SOURCE11} %{buildroot}%{_unitdir}/jellyfin.service # empty directories %{__mkdir} -p %{buildroot}%{_sharedstatedir}/jellyfin %{__mkdir} -p %{buildroot}%{_sysconfdir}/jellyfin %{__mkdir} -p %{buildroot}%{_var}/cache/jellyfin %{__mkdir} -p %{buildroot}%{_var}/log/jellyfin # jellyfin-server-lowports subpackage %{__install} -D -m 0644 %{SOURCE15} %{buildroot}%{_unitdir}/jellyfin.service.d/jellyfin-server-lowports.conf %files # empty as this is just a meta-package %files server %defattr(644,root,root,755) # Jellyfin files %{_bindir}/jellyfin # Needs 755 else only root can run it since binary build by dotnet is 722 %attr(755,root,root) %{_libdir}/jellyfin/jellyfin %{_libdir}/jellyfin/* %attr(755,root,root) %{_bindir}/jellyfin # Jellyfin config %config(noreplace) %attr(644,jellyfin,jellyfin) %{_sysconfdir}/jellyfin/logging.json %config %{_sysconfdir}/sysconfig/jellyfin # system config %{_prefix}/lib/firewalld/services/jellyfin.xml %{_unitdir}/jellyfin.service %config(noreplace) %{_sysconfdir}/systemd/system/jellyfin.service.d/override.conf # empty directories %attr(750,jellyfin,jellyfin) %dir %{_sharedstatedir}/jellyfin %attr(755,jellyfin,jellyfin) %dir %{_sysconfdir}/jellyfin %attr(750,jellyfin,jellyfin) %dir %{_var}/cache/jellyfin %attr(-, jellyfin,jellyfin) %dir %{_var}/log/jellyfin %license LICENSE %files server-lowports %{_unitdir}/jellyfin.service.d/jellyfin-server-lowports.conf %pre server getent group jellyfin >/dev/null || groupadd -r jellyfin getent passwd jellyfin >/dev/null || \ useradd -r -g jellyfin -d %{_sharedstatedir}/jellyfin -s /sbin/nologin \ -c "Jellyfin default user" jellyfin # Add jellyfin to the render and video groups for hwa. [ ! -z "$(getent group render)" ] && usermod -aG render jellyfin >/dev/null 2>&1 [ ! -z "$(getent group video)" ] && usermod -aG video jellyfin >/dev/null 2>&1 exit 0 %post server # Move existing configuration cache and logs to their new locations and symlink them. if [ $1 -gt 1 ] ; then service_state=$(systemctl is-active jellyfin.service) if [ "${service_state}" = "active" ]; then systemctl stop jellyfin.service fi if [ ! -L %{_sharedstatedir}/jellyfin/config ]; then mv %{_sharedstatedir}/jellyfin/config/* %{_sysconfdir}/jellyfin/ rmdir %{_sharedstatedir}/jellyfin/config ln -sf %{_sysconfdir}/jellyfin %{_sharedstatedir}/jellyfin/config fi if [ ! -L %{_sharedstatedir}/jellyfin/logs ]; then mv %{_sharedstatedir}/jellyfin/logs/* %{_var}/log/jellyfin rmdir %{_sharedstatedir}/jellyfin/logs ln -sf %{_var}/log/jellyfin %{_sharedstatedir}/jellyfin/logs fi if [ ! -L %{_sharedstatedir}/jellyfin/cache ]; then mv %{_sharedstatedir}/jellyfin/cache/* %{_var}/cache/jellyfin rmdir %{_sharedstatedir}/jellyfin/cache ln -sf %{_var}/cache/jellyfin %{_sharedstatedir}/jellyfin/cache fi if [ "${service_state}" = "active" ]; then systemctl start jellyfin.service fi fi %systemd_post jellyfin.service %preun server %systemd_preun jellyfin.service %postun server %systemd_postun_with_restart jellyfin.service %changelog * Fri Mar 22 2024 Jason Montleon - 10.9.0-9 - Enable offline building * Fri Mar 22 2024 Jason Montleon - 10.9.0-8 - Stop cloning skia during build * Fri Mar 22 2024 Jason Montleon - 10.9.0-7 - Add a patch of dubious quality for s390x skia build * Thu Mar 21 2024 Jason Montleon - 10.9.0-6 - Allow Big Endian build of skia * Thu Mar 21 2024 Jason Montleon - 10.9.0-5 - Handle different dists better - Remove python-unversioned-command dep - Fill out support for more architectures - Conditionalize Skia build * Thu Mar 21 2024 Jason Montleon - 10.9.0-4 - change rhel runtime_dist * Wed Mar 20 2024 Jason Montleon - 10.9.0-3 - Packaging improvements * Thu Feb 29 2024 Jason Montleon - 10.9.0-2 - Use system libpng for skia to fix scanning issue * Thu Feb 29 2024 Jason Montleon - 10.9.0-1 - change x64 / x86_64 -> ppc64le, linux-x86 runtime to fedora.39-ppc64le - libSkiaSharp.so doesn't get built or installed correctly, so workaround * Wed Jul 13 2022 Jellyfin Packaging Team - New upstream version 10.9.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.9.0 * Mon Nov 29 2021 Brian J. Murrell - Add jellyfin-server-lowports.service drop-in in a server-lowports subpackage to allow binding to low ports * Fri Dec 04 2020 Jellyfin Packaging Team - Forthcoming stable release * Mon Jul 27 2020 Jellyfin Packaging Team - Forthcoming stable release * Mon Mar 23 2020 Jellyfin Packaging Team - Forthcoming stable release * Fri Oct 11 2019 Jellyfin Packaging Team - New upstream version 10.5.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.5.0 * Sat Aug 31 2019 Jellyfin Packaging Team - New upstream version 10.4.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.4.0 * Wed Jul 24 2019 Jellyfin Packaging Team - New upstream version 10.3.7; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.7 * Sat Jul 06 2019 Jellyfin Packaging Team - New upstream version 10.3.6; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.6 * Sun Jun 09 2019 Jellyfin Packaging Team - New upstream version 10.3.5; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.5 * Thu Jun 06 2019 Jellyfin Packaging Team - New upstream version 10.3.4; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.4 * Fri May 17 2019 Jellyfin Packaging Team - New upstream version 10.3.3; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.3 * Tue Apr 30 2019 Jellyfin Packaging Team - New upstream version 10.3.2; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.2 * Sat Apr 20 2019 Jellyfin Packaging Team - New upstream version 10.3.1; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.1 * Fri Apr 19 2019 Jellyfin Packaging Team - New upstream version 10.3.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.0