From 4e616e09485b41f283e8cc4b6258b32ed740844f Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sun, 25 May 2025 17:52:14 +1000 Subject: [PATCH] feat: add jellyfin packages - building using spec files - add jellyfin-server 10.10.7 - add jellyfin-web 10.10.7 - add jellyfin-ffmpeg 7.1.1 --- rpms/jellyfin-ffmpeg-bin/7.1.1/release | 1 + rpms/jellyfin-ffmpeg-bin/Dockerfile | 23 ++++ .../resources/jellyfin-ffmpeg-bin_7.1.1.spec | 65 +++++++++ rpms/jellyfin-server/10.10.7/release | 1 + rpms/jellyfin-server/Dockerfile | 26 ++++ .../resources/fix-envfile-path.patch | 11 ++ .../resources/jellyfin-server_10.10.7.spec | 127 ++++++++++++++++++ rpms/jellyfin-server/resources/tmpfiles.conf | 1 + rpms/jellyfin-web/10.10.7/release | 1 + rpms/jellyfin-web/Dockerfile | 25 ++++ .../resources/jellyfin-web_10.10.7.spec | 43 ++++++ 11 files changed, 324 insertions(+) create mode 100644 rpms/jellyfin-ffmpeg-bin/7.1.1/release create mode 100644 rpms/jellyfin-ffmpeg-bin/Dockerfile create mode 100644 rpms/jellyfin-ffmpeg-bin/resources/jellyfin-ffmpeg-bin_7.1.1.spec create mode 100644 rpms/jellyfin-server/10.10.7/release create mode 100644 rpms/jellyfin-server/Dockerfile create mode 100644 rpms/jellyfin-server/resources/fix-envfile-path.patch create mode 100644 rpms/jellyfin-server/resources/jellyfin-server_10.10.7.spec create mode 100644 rpms/jellyfin-server/resources/tmpfiles.conf create mode 100644 rpms/jellyfin-web/10.10.7/release create mode 100644 rpms/jellyfin-web/Dockerfile create mode 100644 rpms/jellyfin-web/resources/jellyfin-web_10.10.7.spec diff --git a/rpms/jellyfin-ffmpeg-bin/7.1.1/release b/rpms/jellyfin-ffmpeg-bin/7.1.1/release new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/rpms/jellyfin-ffmpeg-bin/7.1.1/release @@ -0,0 +1 @@ +1 diff --git a/rpms/jellyfin-ffmpeg-bin/Dockerfile b/rpms/jellyfin-ffmpeg-bin/Dockerfile new file mode 100644 index 0000000..59707e8 --- /dev/null +++ b/rpms/jellyfin-ffmpeg-bin/Dockerfile @@ -0,0 +1,23 @@ +# Start with the AlmaLinux 8.10 base image +FROM git.query.consul/unkin/almalinux8-rpmbuilder:latest + +# Create output directory for RPMs +RUN mkdir -p /app/dist + +# Set working directory +WORKDIR /app + +ARG PACKAGE_RELEASE +ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} +ARG PACKAGE_VERSION +ENV PACKAGE_VERSION=${PACKAGE_VERSION} + +# Copy nfpm.yaml from the context into the container +COPY nfpm.yaml /app/nfpm.yaml +COPY resources /app/resources + +# Download the required files +RUN spectool -g -R /app/resources/jellyfin-ffmpeg-bin_${PACKAGE_VERSION}.spec && \ + rpmbuild -ba /app/resources/jellyfin-ffmpeg-bin_${PACKAGE_VERSION}.spec && \ + cp /root/rpmbuild/RPMS/x86_64/jellyfin-ffmpeg-bin-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.*.rpm /app/dist/ && \ + cp /root/rpmbuild/SRPMS/jellyfin-ffmpeg-bin-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.*.rpm /app/dist diff --git a/rpms/jellyfin-ffmpeg-bin/resources/jellyfin-ffmpeg-bin_7.1.1.spec b/rpms/jellyfin-ffmpeg-bin/resources/jellyfin-ffmpeg-bin_7.1.1.spec new file mode 100644 index 0000000..27f59e5 --- /dev/null +++ b/rpms/jellyfin-ffmpeg-bin/resources/jellyfin-ffmpeg-bin_7.1.1.spec @@ -0,0 +1,65 @@ +%global debug_package %{nil} +%define _missing_build_ids_terminate_build 0 +%global jellyfin_release 1 + + +Name: jellyfin-ffmpeg-bin +Version: 7.1.1 +Release: %{jellyfin_release}%{?dist} +Summary: FFmpeg for Jellyfin with custom extensions and enhancements + + +License: GPL-3.0-only +URL: https://github.com/jellyfin/jellyfin-ffmpeg +Source0: https://github.com/jellyfin/jellyfin-ffmpeg/releases/download/v%{version}-%{jellyfin_release}/jellyfin-ffmpeg_%{version}-%{jellyfin_release}_portable_linux64-gpl.tar.xz +Source1: https://github.com/jellyfin/jellyfin-ffmpeg/releases/download/v%{version}-%{jellyfin_release}/jellyfin-ffmpeg_%{version}-%{jellyfin_release}_portable_linuxarm64-gpl.tar.xz +Source2: https://raw.githubusercontent.com/jellyfin/jellyfin-ffmpeg/v%{version}-%{jellyfin_release}/LICENSE.md +Source3: https://raw.githubusercontent.com/jellyfin/jellyfin-ffmpeg/v%{version}-%{jellyfin_release}/README.md + + +ExclusiveArch: x86_64 aarch64 + + +Requires: glibc >= 2.23 + + +Recommends: intel-media-driver +Recommends: intel-mediasdk +Recommends: oneVPL-intel-gpu +Recommends: intel-compute-runtime +Recommends: libva-intel-driver +Recommends: mesa-va-drivers +Recommends: rocm-opencl +Recommends: mesa-vulkan-drivers + + +Conflicts: jellyfin-ffmpeg + + +%description +%{summary}. + +%prep + +%ifarch x86_64 +%setup -c -b 0 +%endif + +%ifarch aarch64 +%setup -c -b 1 +%endif + +cp %{SOURCE2} "%{_builddir}/%{name}-%{version}/" +cp %{SOURCE3} "%{_builddir}/%{name}-%{version}/" + + +%install +install -D --mode=755 ffmpeg "%{buildroot}%{_exec_prefix}/lib/jellyfin-ffmpeg/ffmpeg" +install -D --mode=755 ffprobe "%{buildroot}%{_exec_prefix}/lib/jellyfin-ffmpeg/ffprobe" + + +%files +%license LICENSE.md +%doc README.md +%{_exec_prefix}/lib/jellyfin-ffmpeg/ffmpeg +%{_exec_prefix}/lib/jellyfin-ffmpeg/ffprobe diff --git a/rpms/jellyfin-server/10.10.7/release b/rpms/jellyfin-server/10.10.7/release new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/rpms/jellyfin-server/10.10.7/release @@ -0,0 +1 @@ +1 diff --git a/rpms/jellyfin-server/Dockerfile b/rpms/jellyfin-server/Dockerfile new file mode 100644 index 0000000..901c54b --- /dev/null +++ b/rpms/jellyfin-server/Dockerfile @@ -0,0 +1,26 @@ +# Start with the AlmaLinux 8.10 base image +FROM git.query.consul/unkin/almalinux8-rpmbuilder:latest + +# Create output directory for RPMs +RUN mkdir -p /app/dist + +# Set working directory +WORKDIR /app + +ARG PACKAGE_RELEASE +ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} +ARG PACKAGE_VERSION +ENV PACKAGE_VERSION=${PACKAGE_VERSION} + +# Copy nfpm.yaml from the context into the container +COPY nfpm.yaml /app/nfpm.yaml +COPY resources /app/resources + +# Download the required files +RUN dnf install dotnet-sdk-8.0 -y && \ + spectool -g -R /app/resources/jellyfin-server_${PACKAGE_VERSION}.spec && \ + cp /app/resources/fix-envfile-path.patch /root/rpmbuild/SOURCES/fix-envfile-path.patch && \ + cp /app/resources/tmpfiles.conf /root/rpmbuild/SOURCES/tmpfiles.conf && \ + rpmbuild -ba /app/resources/jellyfin-server_${PACKAGE_VERSION}.spec && \ + cp /root/rpmbuild/RPMS/x86_64/jellyfin-server-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.x86_64.rpm /app/dist/ && \ + cp /root/rpmbuild/SRPMS/jellyfin-server-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.src.rpm /app/dist/ diff --git a/rpms/jellyfin-server/resources/fix-envfile-path.patch b/rpms/jellyfin-server/resources/fix-envfile-path.patch new file mode 100644 index 0000000..deec5f4 --- /dev/null +++ b/rpms/jellyfin-server/resources/fix-envfile-path.patch @@ -0,0 +1,11 @@ +--- a/debian/conf/jellyfin.service ++++ b/debian/conf/jellyfin.service +@@ -4,7 +4,7 @@ After = network-online.target + + [Service] + Type = simple +-EnvironmentFile = /etc/default/jellyfin ++EnvironmentFile = /etc/jellyfin/jellyfin.env + User = jellyfin + Group = jellyfin + WorkingDirectory = /var/lib/jellyfin diff --git a/rpms/jellyfin-server/resources/jellyfin-server_10.10.7.spec b/rpms/jellyfin-server/resources/jellyfin-server_10.10.7.spec new file mode 100644 index 0000000..adb96cb --- /dev/null +++ b/rpms/jellyfin-server/resources/jellyfin-server_10.10.7.spec @@ -0,0 +1,127 @@ +%global debug_package %{nil} + +%global jellyfin_version 10.10.7 +%global jellyfin_packaging_timestamp 202504051515 +%global jellyfin_packaging_version %{jellyfin_version}-%{jellyfin_packaging_timestamp} + +%global dotnet_runtime %( \ + if [ "%{_arch}" = "x86_64" ]; then \ + echo -n "linux-x64"; \ + elif [ "%{_arch}" = "aarch64" ]; then \ + echo -n "linux-arm64"; \ + else \ + echo "Unsupported architecture: %{_arch}"; \ + exit 1; \ + fi \ +) + +Name: jellyfin-server +Version: %{jellyfin_version} +Release: 1 +Summary: The Free Software Media System - Server Backend & API + + +License: GPL-2.0-or-later +URL: https://github.com/jellyfin/jellyfin +Source0: https://github.com/jellyfin/jellyfin/archive/refs/tags/v%{version}.tar.gz +Source1: https://github.com/jellyfin/jellyfin-packaging/archive/refs/tags/v%{jellyfin_packaging_version}.tar.gz +Source2: tmpfiles.conf +Patch0: fix-envfile-path.patch + + +ExclusiveArch: x86_64 aarch64 + + +BuildRequires: dotnet-sdk-8.0 +BuildRequires: git +BuildRequires: systemd-rpm-macros + + +Requires: aspnetcore-runtime-8.0 +Requires: bash +Requires: fontconfig +Requires: jellyfin-ffmpeg-bin +Requires: sqlite + + +Recommends: jellyfin-web +Recommends: google-noto-fonts-common + + +%description +%{summary}. + + +%prep +tar --extract --file="%{SOURCE1}" --directory="%{_builddir}" +pushd %{_builddir}/jellyfin-packaging-%{jellyfin_packaging_version} +patch -p1 -i "%{PATCH0}" +popd +%setup -q -n jellyfin-%{version} + + +%build +DOTNET_CLI_TELEMETRY_OPTOUT=1 \ +DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 \ +DOTNET_NOLOGO=1 \ +dotnet \ + publish \ + Jellyfin.Server \ + --configuration Release \ + --output builddir \ + --self-contained false \ + --runtime %{dotnet_runtime} \ + -p:DebugSymbols=false \ + -p:DebugType=none + + +%install +install --directory "%{buildroot}%{_libdir}" +cp --recursive builddir "%{buildroot}%{_libdir}/jellyfin" + +install --directory "%{buildroot}%{_bindir}" +ln --symbolic --force "%{_libdir}/jellyfin/jellyfin" "%{buildroot}%{_bindir}/jellyfin" + +pushd %{_builddir}/jellyfin-packaging-%{jellyfin_packaging_version}/debian/conf +install -D --mode=644 jellyfin.service "%{buildroot}%{_unitdir}/jellyfin.service" +install -D --mode=640 jellyfin "%{buildroot}%{_sysconfdir}/jellyfin/jellyfin.env" +popd + +install -D --mode=0644 "%{SOURCE2}" "%{buildroot}%{_tmpfilesdir}/jellyfin.conf" + +install --directory --mode=750 "%{buildroot}%{_localstatedir}/cache/jellyfin" +install --directory --mode=750 "%{buildroot}%{_sharedstatedir}/jellyfin" +find %{buildroot} + + +%files +%license LICENSE +%{_bindir}/jellyfin +%{_libdir}/jellyfin +%{_tmpfilesdir}/jellyfin.conf +%{_unitdir}/jellyfin.service +%defattr(640,jellyfin,jellyfin,750) +%dir %{_localstatedir}/cache/jellyfin +%dir %{_sharedstatedir}/jellyfin +%dir %{_sysconfdir}/jellyfin +%config(noreplace) %{_sysconfdir}/jellyfin/jellyfin.env + + +%pre +getent group jellyfin > /dev/null || groupadd --system jellyfin +getent passwd jellyfin > /dev/null || \ + useradd --system --home-dir "%{_sharedstatedir}/jellyfin" --gid jellyfin \ + -s /sbin/nologin -c "jellyfin daemon" jellyfin +exit 0 + + +%post +%systemd_post jellyfin.service + + +%preun +%systemd_preun jellyfin.service + + +%postun +%systemd_postun jellyfin.service diff --git a/rpms/jellyfin-server/resources/tmpfiles.conf b/rpms/jellyfin-server/resources/tmpfiles.conf new file mode 100644 index 0000000..4af67c5 --- /dev/null +++ b/rpms/jellyfin-server/resources/tmpfiles.conf @@ -0,0 +1 @@ +d /var/log/jellyfin 0750 jellyfin jellyfin diff --git a/rpms/jellyfin-web/10.10.7/release b/rpms/jellyfin-web/10.10.7/release new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/rpms/jellyfin-web/10.10.7/release @@ -0,0 +1 @@ +1 diff --git a/rpms/jellyfin-web/Dockerfile b/rpms/jellyfin-web/Dockerfile new file mode 100644 index 0000000..c0884c7 --- /dev/null +++ b/rpms/jellyfin-web/Dockerfile @@ -0,0 +1,25 @@ +# Start with the AlmaLinux 8.10 base image +FROM git.query.consul/unkin/almalinux8-rpmbuilder:latest + +# Create output directory for RPMs +RUN mkdir -p /app/dist + +# Set working directory +WORKDIR /app + +ARG PACKAGE_RELEASE +ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} +ARG PACKAGE_VERSION +ENV PACKAGE_VERSION=${PACKAGE_VERSION} + +# Copy nfpm.yaml from the context into the container +COPY nfpm.yaml /app/nfpm.yaml +COPY resources /app/resources + +# Download the required files +RUN dnf module enable nodejs:20 -y && \ + dnf install nodejs npm -y && \ + spectool -g -R /app/resources/jellyfin-web_${PACKAGE_VERSION}.spec && \ + rpmbuild -ba /app/resources/jellyfin-web_${PACKAGE_VERSION}.spec && \ + cp /root/rpmbuild/RPMS/noarch/jellyfin-web-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.noarch.rpm /app/dist/ && \ + cp /root/rpmbuild/SRPMS/jellyfin-web-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.src.rpm /app/dist/ diff --git a/rpms/jellyfin-web/resources/jellyfin-web_10.10.7.spec b/rpms/jellyfin-web/resources/jellyfin-web_10.10.7.spec new file mode 100644 index 0000000..5f92e40 --- /dev/null +++ b/rpms/jellyfin-web/resources/jellyfin-web_10.10.7.spec @@ -0,0 +1,43 @@ +%global jellyfin_version 10.10.7 + + +Name: jellyfin-web +Version: %{jellyfin_version} +Release: 1 +Summary: The Free Software Media System - Official Web Client + + +License: GPL-2.0-or-later +URL: https://github.com/jellyfin/jellyfin-web +Source0: https://github.com/jellyfin/jellyfin-web/archive/refs/tags/v%{version}.tar.gz + + +BuildArch: noarch + + +BuildRequires: git +BuildRequires: nodejs +BuildRequires: npm + + +%description +%{summary}. + + +%prep +%setup -q -n jellyfin-web-%{version} + + +%build +SKIP_PREPARE=1 npm ci --no-audit --no-fund --no-update-notifier +npm run build:production + + +%install +install --directory "%{buildroot}%{_datadir}/jellyfin/web" +cp --recursive dist/* "%{buildroot}%{_datadir}/jellyfin/web" + + +%files +%license LICENSE +%{_datadir}/jellyfin/web