mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-08 04:18:06 +02:00
Merge pull request #800 from Wuerfelbecher/update-rpm
Add CentOS and update rpm spec for the cachedir option
This commit is contained in:
commit
c4c0894b29
7 changed files with 39 additions and 17 deletions
|
@ -68,8 +68,7 @@ new_version="$1"
|
||||||
# Parse the version from the AssemblyVersion
|
# Parse the version from the AssemblyVersion
|
||||||
old_version="$(
|
old_version="$(
|
||||||
grep "AssemblyVersion" ${shared_version_file} \
|
grep "AssemblyVersion" ${shared_version_file} \
|
||||||
| sed -E 's/\[assembly: ?AssemblyVersion\("([0-9\.]+)"\)\]/\1/' \
|
| sed -E 's/\[assembly: ?AssemblyVersion\("([0-9\.]+)"\)\]/\1/'
|
||||||
| sed -E 's/.0$//'
|
|
||||||
)"
|
)"
|
||||||
|
|
||||||
# Set the shared version to the specified new_version
|
# Set the shared version to the specified new_version
|
||||||
|
|
15
deployment/centos-package-x64/Dockerfile
Normal file
15
deployment/centos-package-x64/Dockerfile
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
FROM centos:7
|
||||||
|
ARG HOME=/build
|
||||||
|
RUN mkdir /build && \
|
||||||
|
yum install -y @buildsys-build rpmdevtools yum-plugins-core && \
|
||||||
|
rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm && \
|
||||||
|
rpmdev-setuptree
|
||||||
|
|
||||||
|
WORKDIR /build/rpmbuild
|
||||||
|
COPY ./deployment/centos-package-x64/pkg-src/jellyfin.spec SPECS
|
||||||
|
COPY ./deployment/centos-package-x64/pkg-src/ SOURCES
|
||||||
|
|
||||||
|
RUN spectool -g -R SPECS/jellyfin.spec && \
|
||||||
|
rpmbuild -bs SPECS/jellyfin.spec && \
|
||||||
|
yum-builddep -y SRPMS/jellyfin-*.src.rpm && \
|
||||||
|
rpmbuild -bb SPECS/jellyfin.spec;
|
1
deployment/centos-package-x64/clean.sh
Symbolic link
1
deployment/centos-package-x64/clean.sh
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../fedora-package-x64/clean.sh
|
1
deployment/centos-package-x64/package.sh
Symbolic link
1
deployment/centos-package-x64/package.sh
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../fedora-package-x64/package.sh
|
1
deployment/centos-package-x64/pkg-src
Symbolic link
1
deployment/centos-package-x64/pkg-src
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../fedora-package-x64/pkg-src
|
|
@ -21,7 +21,7 @@
|
||||||
JELLYFIN_DATA_DIRECTORY="/var/lib/jellyfin"
|
JELLYFIN_DATA_DIRECTORY="/var/lib/jellyfin"
|
||||||
JELLYFIN_CONFIG_DIRECTORY="/etc/jellyfin"
|
JELLYFIN_CONFIG_DIRECTORY="/etc/jellyfin"
|
||||||
JELLYFIN_LOG_DIRECTORY="/var/log/jellyfin"
|
JELLYFIN_LOG_DIRECTORY="/var/log/jellyfin"
|
||||||
JELLYFIN_CACHE_DIRECTORY="/var/log/jellyfin"
|
JELLYFIN_CACHE_DIRECTORY="/var/cache/jellyfin"
|
||||||
# In-App service control
|
# In-App service control
|
||||||
JELLYFIN_RESTART_OPT="--restartpath /usr/libexec/jellyfin/restart.sh"
|
JELLYFIN_RESTART_OPT="--restartpath /usr/libexec/jellyfin/restart.sh"
|
||||||
# Additional options for the binary
|
# Additional options for the binary
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
%global debug_package %{nil}
|
%global debug_package %{nil}
|
||||||
# jellyfin tag to package
|
# Set the dotnet runtime
|
||||||
%global gittag v10.1.0
|
%if 0%{?fedora}
|
||||||
# Taglib-sharp commit of the submodule since github archive doesn't include submodules
|
%global dotnet_runtime fedora-x64
|
||||||
%global taglib_commit ee5ab21742b71fd1b87ee24895582327e9e04776
|
%else
|
||||||
%global taglib_shortcommit %(c=%{taglib_commit}; echo ${c:0:7})
|
%global dotnet_runtime centos-x64
|
||||||
|
%endif
|
||||||
|
|
||||||
AutoReq: no
|
|
||||||
Name: jellyfin
|
Name: jellyfin
|
||||||
Version: 10.1.0
|
Version: 10.1.0
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
|
@ -31,13 +31,11 @@ BuildRequires: dotnet-sdk-2.2
|
||||||
# RPMfusion free
|
# RPMfusion free
|
||||||
Requires: ffmpeg
|
Requires: ffmpeg
|
||||||
|
|
||||||
# For the update-db-paths.sh script to fix emby paths to jellyfin
|
|
||||||
%{?fedora:Recommends: sqlite}
|
|
||||||
|
|
||||||
# Fedora has openssl1.1 which is incompatible with dotnet
|
# Fedora has openssl1.1 which is incompatible with dotnet
|
||||||
%{?fedora:Requires: compat-openssl10}
|
%{?fedora:Requires: compat-openssl10}
|
||||||
# Disable Automatic Dependency Processing for Centos
|
|
||||||
%{?el7:AutoReqProv: no}
|
# Disable Automatic Dependency Processing
|
||||||
|
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.
|
||||||
|
@ -51,7 +49,7 @@ Jellyfin is a free software media system that puts you in control of managing an
|
||||||
%install
|
%install
|
||||||
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||||
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
||||||
dotnet publish --configuration Release --output='%{buildroot}%{_libdir}/jellyfin' --self-contained --runtime fedora-x64 Jellyfin.Server
|
dotnet publish --configuration Release --output='%{buildroot}%{_libdir}/jellyfin' --self-contained --runtime %{dotnet_runtime} Jellyfin.Server
|
||||||
%{__install} -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/%{name}/LICENSE
|
%{__install} -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/%{name}/LICENSE
|
||||||
%{__install} -D -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/override.conf
|
%{__install} -D -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/override.conf
|
||||||
%{__install} -D -m 0644 Jellyfin.Server/Resources/Configuration/logging.json %{buildroot}%{_sysconfdir}/%{name}/logging.json
|
%{__install} -D -m 0644 Jellyfin.Server/Resources/Configuration/logging.json %{buildroot}%{_sysconfdir}/%{name}/logging.json
|
||||||
|
@ -63,6 +61,7 @@ EOF
|
||||||
%{__mkdir} -p %{buildroot}%{_sharedstatedir}/jellyfin
|
%{__mkdir} -p %{buildroot}%{_sharedstatedir}/jellyfin
|
||||||
%{__mkdir} -p %{buildroot}%{_sysconfdir}/%{name}
|
%{__mkdir} -p %{buildroot}%{_sysconfdir}/%{name}
|
||||||
%{__mkdir} -p %{buildroot}%{_var}/log/jellyfin
|
%{__mkdir} -p %{buildroot}%{_var}/log/jellyfin
|
||||||
|
%{__mkdir} -p %{buildroot}%{_var}/cache/jellyfin
|
||||||
|
|
||||||
%{__install} -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
|
%{__install} -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
|
||||||
%{__install} -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
|
%{__install} -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
|
||||||
|
@ -90,8 +89,9 @@ EOF
|
||||||
%config(noreplace) %attr(600,root,root) %{_sysconfdir}/sudoers.d/%{name}-sudoers
|
%config(noreplace) %attr(600,root,root) %{_sysconfdir}/sudoers.d/%{name}-sudoers
|
||||||
%config(noreplace) %{_sysconfdir}/systemd/system/%{name}.service.d/override.conf
|
%config(noreplace) %{_sysconfdir}/systemd/system/%{name}.service.d/override.conf
|
||||||
%config(noreplace) %attr(644,jellyfin,jellyfin) %{_sysconfdir}/%{name}/logging.json
|
%config(noreplace) %attr(644,jellyfin,jellyfin) %{_sysconfdir}/%{name}/logging.json
|
||||||
%attr(-,jellyfin,jellyfin) %dir %{_sharedstatedir}/jellyfin
|
%attr(750,jellyfin,jellyfin) %dir %{_sharedstatedir}/jellyfin
|
||||||
%attr(-,jellyfin,jellyfin) %dir %{_var}/log/jellyfin
|
%attr(-,jellyfin,jellyfin) %dir %{_var}/log/jellyfin
|
||||||
|
%attr(750,jellyfin,jellyfin) %dir %{_var}/cache/jellyfin
|
||||||
%if 0%{?fedora}
|
%if 0%{?fedora}
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%else
|
%else
|
||||||
|
@ -106,7 +106,7 @@ getent passwd jellyfin >/dev/null || \
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
%post
|
%post
|
||||||
# Move existing configuration to /etc/jellyfin and symlink config to /etc/jellyfin
|
# 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)
|
||||||
if [ "${service_state}" = "active" ]; then
|
if [ "${service_state}" = "active" ]; then
|
||||||
|
@ -122,6 +122,11 @@ if [ $1 -gt 1 ] ; then
|
||||||
rmdir %{_sharedstatedir}/%{name}/logs
|
rmdir %{_sharedstatedir}/%{name}/logs
|
||||||
ln -sf %{_var}/log/jellyfin %{_sharedstatedir}/%{name}/logs
|
ln -sf %{_var}/log/jellyfin %{_sharedstatedir}/%{name}/logs
|
||||||
fi
|
fi
|
||||||
|
if [ ! -L %{_sharedstatedir}/%{name}/cache ]; then
|
||||||
|
mv %{_sharedstatedir}/%{name}/cache/* %{_var}/cache/jellyfin
|
||||||
|
rmdir %{_sharedstatedir}/%{name}/cache
|
||||||
|
ln -sf %{_var}/cache/jellyfin %{_sharedstatedir}/%{name}/cache
|
||||||
|
fi
|
||||||
if [ "${service_state}" = "active" ]; then
|
if [ "${service_state}" = "active" ]; then
|
||||||
systemctl start jellyfin.service
|
systemctl start jellyfin.service
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue