The Free Software Media System - Server Backend & API
Enable self-contained binary mode (#160)
Joshua M. Bonifacea73d255f51f1
diff --git a/Dockerfile.debian_package b/Dockerfile.debian_packageindex 31505b978b..c5c631b71a 100644--- a/Dockerfile.debian_package+++ b/Dockerfile.debian_package@@ -2,20 +2,20 @@ FROM debian:9# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-currentRUN apt-get update \- && apt-get install -y apt-transport-https debhelper gnupg wget \+ && apt-get install -y apt-transport-https debhelper gnupg wget devscripts \&& wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg \&& mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ \&& wget -q https://packages.microsoft.com/config/debian/9/prod.list \&& mv prod.list /etc/apt/sources.list.d/microsoft-prod.list \&& chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg \&& chown root:root /etc/apt/sources.list.d/microsoft-prod.list \- && apt-get update \- && apt-get install -y dotnet-sdk-2.2+ && apt-get updateWORKDIR /repoCOPY . .-RUN dpkg-buildpackage -us -uc \+RUN yes|mk-build-deps -i \+ && dpkg-buildpackage -us -uc \&& mkdir /dist \&& mv /jellyfin*deb /distdiff --git a/debian/conf/jellyfin b/debian/conf/jellyfinindex 5c26d12c3e..fb00e7f65c 100644--- a/debian/conf/jellyfin+++ b/debian/conf/jellyfin@@ -15,8 +15,6 @@# General options#-# Path to the jellyfin.dll executable-JELLYFIN_EXE="/usr/lib/jellyfin/bin/jellyfin.dll"# Data directoryJELLYFIN_DATA="/var/lib/jellyfin"# Restart script for in-app server control@@ -30,7 +28,5 @@ JELLYFIN_ADD_OPTS=""# Application usernameJELLYFIN_USER="jellyfin"-# .NET Core runtime binary-JELLYFIN_DOTNET="/usr/bin/dotnet"# Full application command-JELLYFIN_COMMAND="$JELLYFIN_EXE -programdata $JELLYFIN_DATA -restartpath $JELLYFIN_RESTART_SCRIPT $JELLYFIN_ADD_OPTS"+JELLYFIN_ARGS="-programdata $JELLYFIN_DATA -restartpath $JELLYFIN_RESTART_SCRIPT $JELLYFIN_ADD_OPTS"diff --git a/debian/control b/debian/controlindex bc5e05daa7..c00988f3e6 100644--- a/debian/control+++ b/debian/control@@ -4,14 +4,15 @@ Priority: optionalMaintainer: Vasily <[email protected]>Build-Depends: debhelper (>= 9),dotnet-sdk-2.2,- libc6-dev+ libc6-dev,+ libcurl4-openssl-devStandards-Version: 3.9.4Package: jellyfinReplaces: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-serverBreaks: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-serverConflicts: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server-Architecture: all-Depends: ${shlibs:Depends}, ${misc:Depends}, at, libsqlite3-0, dotnet-runtime-2.2, ffmpeg+Architecture: any+Depends: ${shlibs:Depends}, ${misc:Depends}, at, libsqlite3-0, ffmpegDescription: Jellyfin is a home media server.It is built on top of other popular open source technologies such as Service Stack, jQuery, jQuery mobile, and Mono. It features a REST-based api with built-in documentation to facilitate client development. We also have client libraries for our api to enable rapid development.diff --git a/debian/jellyfin.init b/debian/jellyfin.initindex 18c7d02a10..d103fb0f12 100644--- a/debian/jellyfin.init+++ b/debian/jellyfin.init@@ -9,14 +9,17 @@### END INIT INFO# Carry out specific functions when asked to by the system-pid=`ps -fA|grep dotnet|grep jellyfin|awk '{print $2}'| tr -d '\n'`++pidfile="/var/run/jellyfin.pid"+pid=`cat $pidfile`case "$1" instart)if [ "$pid" == "" ]; thenecho "Starting Jellyfin...". /etc/default/jellyfin- nohup su -u $JELLYFIN_USER -c $JELLYFIN_DOTNET $JELLYFIN_COMMAND+ nohup su -u $JELLYFIN_USER -c /usr/bin/jellyfin $JELLYFIN_ARGS+ echo ?? > $pidfileelseecho "Jellyfin already running"fi@@ -26,6 +29,7 @@ case "$1" inecho "Stopping Jellyfin..."kill $pidsleep 2+ rm -f $pidfileelseecho "Jellyfin not running"fidiff --git a/debian/jellyfin.service b/debian/jellyfin.serviceindex 982608a7e0..d5a999cf53 100644--- a/debian/jellyfin.service+++ b/debian/jellyfin.service@@ -6,7 +6,7 @@ After = network.targetType = simpleEnvironmentFile = /etc/default/jellyfinUser = jellyfin-ExecStart = /usr/bin/dotnet ${JELLYFIN_EXE} -programdata ${JELLYFIN_DATA} -restartpath ${JELLYFIN_RESTART_SCRIPT} ${JELLYFIN_ADD_OPTS}+ExecStart = /usr/bin/jellyfin -programdata ${JELLYFIN_DATA} -restartpath ${JELLYFIN_RESTART_SCRIPT} ${JELLYFIN_ADD_OPTS}Restart = on-abortTimeoutSec = 20diff --git a/debian/jellyfin.upstart b/debian/jellyfin.upstartindex ebbceaf578..ef5bc9bcaf 100644--- a/debian/jellyfin.upstart+++ b/debian/jellyfin.upstart@@ -16,5 +16,5 @@ script# Log filelogger -t "$0" "DEBUG: `set`". /etc/default/jellyfin- exec su -u $JELLYFIN_USER -c $JELLYFIN_DOTNET $JELLYFIN_COMMAND+ exec su -u $JELLYFIN_USER -c /usr/bin/jellyfin $JELLYFIN_ARGSend scriptdiff --git a/debian/postinst b/debian/postinstindex ad7363db43..502bba3422 100644--- a/debian/postinst+++ b/debian/postinst@@ -37,6 +37,9 @@ case "$1" inchmod +x ${JELLYFIN_DIR}/restart.sh > /dev/null 2>&1 || true+ # Install jellyfin symlink into /usr/bin+ ln -sf /usr/lib/jellyfin/bin/jellyfin /usr/bin/jellyfin+;;abort-upgrade|abort-remove|abort-deconfigure);;diff --git a/debian/rules b/debian/rulesindex 17e7d506c2..0b790f2e45 100755--- a/debian/rules+++ b/debian/rules@@ -15,8 +15,8 @@ override_dh_auto_test:override_dh_clistrip:override_dh_auto_build:- dotnet publish --configuration $(CONFIG) $(CURDIR)/MediaBrowser.sln --output='$(CURDIR)/usr/lib/jellyfin/bin'+ dotnet publish --configuration $(CONFIG) $(CURDIR)/MediaBrowser.sln --output='$(CURDIR)/usr/lib/jellyfin/bin' --self-contained --runtime linux-x64override_dh_auto_clean:dotnet clean -maxcpucount:1 --configuration $(CONFIG) $(CURDIR)/MediaBrowser.sln || true- rm -rf '$(CURDIR)/usr/lib/jellyfin'+ rm -rf '$(CURDIR)/usr'