%ifarch aarch64 %define output_arch arm64 %else %define output_arch x64 %endif Name: Sonarr Version: 4.0.5.1719 Release: 2%{?dist} Summary: Smart PVR for newsgroup and bittorrent users. License: GPL-3.0 URL: https://sonarr.tv Source0: https://github.com/Sonarr/Sonarr/archive/v%{version}/%{name}-%{version}.tar.gz Source1: %{name}.service Source2: %{name}-firewalld.xml %{?systemd_requires} BuildRequires: dotnet-sdk-6.0 BuildRequires: yarnpkg BuildRequires: nodejs BuildRequires: systemd-rpm-macros BuildRequires: gawk BuildRequires: sed BuildRequires: firewalld-filesystem Requires: servarr-user Requires: dotnet-runtime-6.0 Requires: aspnetcore-runtime-6.0 Requires: %{name}-firewalld %global __requires_exclude ^liblttng-ust.so.0 %global _build_id_links none %description Smart PVR for newsgroup and bittorrent users. %package firewalld Summary: firewalld configuration for Sonarr %description firewalld firewalld configuration for Sonarr %global debug_package %{nil} %prep %setup -q export DOTNET_VERSION=$(dotnet --list-sdks | grep 6.0 | awk '{print $1}' | tail -1) sed -i "s/\"version\": \".*\"/\"version\": \"$DOTNET_VERSION\"/" global.json # Fix error on vulnerability found sed -i 's/true/false/' src/Directory.Build.props %build export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 ./build.sh --backend --frontend %install mkdir -p %{buildroot}%{_libdir}/%{name} cp -ar _output/net6.0/linux-%{output_arch}/* %{buildroot}%{_libdir}/%{name} mkdir -p %{buildroot}%{_libdir}/%{name}/Sonarr.Update cp -ar _output/Sonarr.Update/net6.0/linux-%{output_arch}/* %{buildroot}%{_libdir}/%{name}/Sonarr.Update mkdir -p %{buildroot}%{_libdir}/%{name}/UI cp -ar _output/UI/* %{buildroot}%{_libdir}/%{name}/UI mkdir -p %{buildroot}%{_unitdir} cp %{SOURCE1} %{buildroot}%{_unitdir} mkdir -p %{buildroot}%{_sharedstatedir}/%{name} mkdir -p %{buildroot}%{_bindir} tee %{buildroot}%{_bindir}/%{name} << EOF #!/bin/sh exec %{_libdir}/%{name}/Sonarr \${@} EOF chmod +x %{buildroot}%{_bindir}/%{name} # firewalld install -p -m 644 -D %{SOURCE2} %{buildroot}%{_prefix}/lib/firewalld/services/%{name}.xml %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun %{name}.service %files %{_bindir}/%{name} %attr(755,servarr,servarr) %{_libdir}/%{name} %{_unitdir}/%{name}.service %attr(750,servarr,servarr) %dir %{_sharedstatedir}/%{name} %files firewalld %{_prefix}/lib/firewalld/services/%{name}.xml %post firewalld %firewalld_reload %changelog * Fri Jun 07 2024 Jonas Hucklenbroich 4.0.5.1719-2 - Fix Sonarr permissions (jonas@hucklenbroich.org) * Mon Jun 03 2024 Jonas Hucklenbroich 4.0.5.1719-1 - Update Sonarr to version 4.0.5.1719 (jonas@hucklenbroich.org) * Thu May 30 2024 Jonas Hucklenbroich 4.0.5.1710-1 - Update Sonarr to 4.0.5.1710 (jonas@hucklenbroich.org) * Fri May 24 2024 Jonas Hucklenbroich 4.0.4.1699-13 - Update Sonarr to 4.0.4.1699 (jonas@hucklenbroich.org) * Thu May 23 2024 Jonas Hucklenbroich 4.0.4.1695-12 - Update Sonarr version to 4.0.4.1695 (jonas@hucklenbroich.org) * Tue May 21 2024 Jonas Hucklenbroich 4.0.4.1668-11 - Fix build-id collision (jonas@hucklenbroich.org) * Tue May 21 2024 Jonas Hucklenbroich 4.0.4.1668-10 - Fix wrong exe (jonas@hucklenbroich.org) * Tue May 21 2024 Jonas Hucklenbroich 4.0.4.1668-9 - Fix sonarr service (jonas@hucklenbroich.org) * Tue May 21 2024 Jonas Hucklenbroich 4.0.4.1668-8 - Fix systemd service file * Tue May 21 2024 Jonas Hucklenbroich 4.0.4.1668-7 - Fix path * Tue May 21 2024 Jonas Hucklenbroich 4.0.4.1668-6 - Fix firewall cfg path * Tue May 21 2024 Jonas Hucklenbroich 4.0.4.1668-5 - Add Sonarr firewall config (jonas@hucklenbroich.org) * Tue May 21 2024 Jonas Hucklenbroich 4.0.4.1668-3 - Fix sonarr release (jonas@hucklenbroich.org) - Fix selinux error (jonas@hucklenbroich.org) * Mon May 20 2024 Jonas Hucklenbroich 4.0.4.1668-1 - new package built with tito