Improve Fedora spec and add metapackage

This commit is contained in:
Joshua M. Boniface 2020-04-09 11:17:38 -04:00
parent 49da8766d8
commit 9eab678487

View File

@ -6,10 +6,10 @@
%global dotnet_runtime centos-x64 %global dotnet_runtime centos-x64
%endif %endif
Name: jellyfin-server Name: jellyfin
Version: 10.6.0 Version: 10.6.0
Release: 1%{?dist} Release: 1%{?dist}
Summary: The Free Software Media System Server backend and API Summary: The Free Software Media System
License: GPLv3 License: GPLv3
URL: https://jellyfin.media URL: https://jellyfin.media
# Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `v%{version}.tar.gz` # Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `v%{version}.tar.gz`
@ -23,22 +23,27 @@ Source16: jellyfin-firewalld.xml
%{?systemd_requires} %{?systemd_requires}
BuildRequires: systemd BuildRequires: systemd
Requires(pre): shadow-utils
BuildRequires: libcurl-devel, fontconfig-devel, freetype-devel, openssl-devel, glibc-devel, libicu-devel BuildRequires: libcurl-devel, fontconfig-devel, freetype-devel, openssl-devel, glibc-devel, libicu-devel
Requires: libcurl, fontconfig, freetype, openssl, glibc libicu
# Requirements not packaged in main repos # Requirements not packaged in main repos
# COPR @dotnet-sig/dotnet or # COPR @dotnet-sig/dotnet or
# https://packages.microsoft.com/rhel/7/prod/ # https://packages.microsoft.com/rhel/7/prod/
BuildRequires: dotnet-runtime-3.1, dotnet-sdk-3.1 BuildRequires: dotnet-runtime-3.1, dotnet-sdk-3.1
# RPMfusion free Requires: %{name}-server = %{version}-%{release}, %{name}-web >= 1, %{name}-web < 2
Requires: ffmpeg
# Disable Automatic Dependency Processing # Disable Automatic Dependency Processing
AutoReqProv: no AutoReqProv: no
%description %description
Jellyfin is a free software media system that puts you in control of managing and streaming your media. 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
%description server
The Jellyfin media server backend.
%prep %prep
%autosetup -n jellyfin-server-%{version} -b 0 %autosetup -n jellyfin-server-%{version} -b 0
@ -69,7 +74,7 @@ EOF
%{__install} -D -m 0755 %{SOURCE14} %{buildroot}%{_libexecdir}/jellyfin/restart.sh %{__install} -D -m 0755 %{SOURCE14} %{buildroot}%{_libexecdir}/jellyfin/restart.sh
%{__install} -D -m 0644 %{SOURCE16} %{buildroot}%{_prefix}/lib/firewalld/services/jellyfin.xml %{__install} -D -m 0644 %{SOURCE16} %{buildroot}%{_prefix}/lib/firewalld/services/jellyfin.xml
%files %files server
%attr(755,root,root) %{_bindir}/jellyfin %attr(755,root,root) %{_bindir}/jellyfin
%{_libdir}/jellyfin/*.json %{_libdir}/jellyfin/*.json
%{_libdir}/jellyfin/*.dll %{_libdir}/jellyfin/*.dll
@ -92,14 +97,14 @@ EOF
%attr(750,jellyfin,jellyfin) %dir %{_var}/cache/jellyfin %attr(750,jellyfin,jellyfin) %dir %{_var}/cache/jellyfin
%{_datadir}/licenses/jellyfin/LICENSE %{_datadir}/licenses/jellyfin/LICENSE
%pre %pre server
getent group jellyfin >/dev/null || groupadd -r jellyfin getent group jellyfin >/dev/null || groupadd -r jellyfin
getent passwd jellyfin >/dev/null || \ getent passwd jellyfin >/dev/null || \
useradd -r -g jellyfin -d %{_sharedstatedir}/jellyfin -s /sbin/nologin \ useradd -r -g jellyfin -d %{_sharedstatedir}/jellyfin -s /sbin/nologin \
-c "Jellyfin default user" jellyfin -c "Jellyfin default user" jellyfin
exit 0 exit 0
%post %post server
# Move existing configuration cache and logs to their new locations and symlink them. # Move existing configuration cache and logs to their new locations and symlink them.
if [ $1 -gt 1 ] ; then if [ $1 -gt 1 ] ; then
service_state=$(systemctl is-active jellyfin.service) service_state=$(systemctl is-active jellyfin.service)
@ -127,10 +132,10 @@ if [ $1 -gt 1 ] ; then
fi fi
%systemd_post jellyfin.service %systemd_post jellyfin.service
%preun %preun server
%systemd_preun jellyfin.service %systemd_preun jellyfin.service
%postun %postun server
%systemd_postun_with_restart jellyfin.service %systemd_postun_with_restart jellyfin.service
%changelog %changelog