Move Debian folder to root of repo

This commit is contained in:
Joshua M. Boniface 2020-03-22 16:01:33 -04:00
parent 28f7df6520
commit 8b620ed26a
23 changed files with 792 additions and 0 deletions

59
debian/changelog vendored Normal file
View File

@ -0,0 +1,59 @@
jellyfin (10.5.0-1) unstable; urgency=medium
* New upstream version 10.5.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.5.0
-- Jellyfin Packaging Team <packaging@jellyfin.org> Fri, 11 Oct 2019 20:12:38 -0400
jellyfin (10.4.0-1) unstable; urgency=medium
* New upstream version 10.4.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.4.0
-- Jellyfin Packaging Team <packaging@jellyfin.org> Sat, 31 Aug 2019 21:38:56 -0400
jellyfin (10.3.7-1) unstable; urgency=medium
* New upstream version 10.3.7; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.7
-- Jellyfin Packaging Team <packaging@jellyfin.org> Wed, 24 Jul 2019 10:48:28 -0400
jellyfin (10.3.6-1) unstable; urgency=medium
* New upstream version 10.3.6; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.6
-- Jellyfin Packaging Team <packaging@jellyfin.org> Sat, 06 Jul 2019 13:34:19 -0400
jellyfin (10.3.5-1) unstable; urgency=medium
* New upstream version 10.3.5; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.5
-- Jellyfin Packaging Team <packaging@jellyfin.org> Sun, 09 Jun 2019 21:47:35 -0400
jellyfin (10.3.4-1) unstable; urgency=medium
* New upstream version 10.3.4; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.4
-- Jellyfin Packaging Team <packaging@jellyfin.org> Thu, 06 Jun 2019 22:45:31 -0400
jellyfin (10.3.3-1) unstable; urgency=medium
* New upstream version 10.3.3; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.3
-- Jellyfin Packaging Team <packaging@jellyfin.org> Fri, 17 May 2019 23:12:08 -0400
jellyfin (10.3.2-1) unstable; urgency=medium
* New upstream version 10.3.2; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.2
-- Jellyfin Packaging Team <packaging@jellyfin.org> Tue, 30 Apr 2019 20:18:44 -0400
jellyfin (10.3.1-1) unstable; urgency=medium
* New upstream version 10.3.1; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.1
-- Jellyfin Packaging Team <packaging@jellyfin.org> Sat, 20 Apr 2019 14:24:07 -0400
jellyfin (10.3.0-1) unstable; urgency=medium
* New upstream version 10.3.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.0
-- Jellyfin Packaging Team <packaging@jellyfin.org> Fri, 19 Apr 2019 14:24:29 -0400

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
8

40
debian/conf/jellyfin vendored Normal file
View File

@ -0,0 +1,40 @@
# Jellyfin default configuration options
# This is a POSIX shell fragment
# Use this file to override the default configurations; add additional
# options with JELLYFIN_ADD_OPTS.
# Under systemd, use
# /etc/systemd/system/jellyfin.service.d/jellyfin.service.conf
# to override the user or this config file's location.
#
# General options
#
# Program directories
JELLYFIN_DATA_DIR="/var/lib/jellyfin"
JELLYFIN_CONFIG_DIR="/etc/jellyfin"
JELLYFIN_LOG_DIR="/var/log/jellyfin"
JELLYFIN_CACHE_DIR="/var/cache/jellyfin"
# Restart script for in-app server control
JELLYFIN_RESTART_OPT="--restartpath=/usr/lib/jellyfin/restart.sh"
# ffmpeg binary paths, overriding the system values
JELLYFIN_FFMPEG_OPT="--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg"
# [OPTIONAL] run Jellyfin as a headless service
#JELLYFIN_SERVICE_OPT="--service"
# [OPTIONAL] run Jellyfin without the web app
#JELLYFIN_NOWEBAPP_OPT="--noautorunwebapp"
#
# SysV init/Upstart options
#
# Application username
JELLYFIN_USER="jellyfin"
# Full application command
JELLYFIN_ARGS="$JELLYFIN_RESTART_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLFIN_NOWEBAPP_OPT"

37
debian/conf/jellyfin-sudoers vendored Normal file
View File

@ -0,0 +1,37 @@
#Allow jellyfin group to start, stop and restart itself
Cmnd_Alias RESTARTSERVER_SYSV = /sbin/service jellyfin restart, /usr/sbin/service jellyfin restart
Cmnd_Alias STARTSERVER_SYSV = /sbin/service jellyfin start, /usr/sbin/service jellyfin start
Cmnd_Alias STOPSERVER_SYSV = /sbin/service jellyfin stop, /usr/sbin/service jellyfin stop
Cmnd_Alias RESTARTSERVER_SYSTEMD = /usr/bin/systemctl restart jellyfin, /bin/systemctl restart jellyfin
Cmnd_Alias STARTSERVER_SYSTEMD = /usr/bin/systemctl start jellyfin, /bin/systemctl start jellyfin
Cmnd_Alias STOPSERVER_SYSTEMD = /usr/bin/systemctl stop jellyfin, /bin/systemctl stop jellyfin
Cmnd_Alias RESTARTSERVER_INITD = /etc/init.d/jellyfin restart
Cmnd_Alias STARTSERVER_INITD = /etc/init.d/jellyfin start
Cmnd_Alias STOPSERVER_INITD = /etc/init.d/jellyfin stop
jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSV
jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSV
jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSV
jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSTEMD
jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSTEMD
jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSTEMD
jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_INITD
jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_INITD
jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_INITD
Defaults!RESTARTSERVER_SYSV !requiretty
Defaults!STARTSERVER_SYSV !requiretty
Defaults!STOPSERVER_SYSV !requiretty
Defaults!RESTARTSERVER_SYSTEMD !requiretty
Defaults!STARTSERVER_SYSTEMD !requiretty
Defaults!STOPSERVER_SYSTEMD !requiretty
Defaults!RESTARTSERVER_INITD !requiretty
Defaults!STARTSERVER_INITD !requiretty
Defaults!STOPSERVER_INITD !requiretty
#Allow the server to mount iso images
jellyfin ALL=(ALL) NOPASSWD: /bin/mount
jellyfin ALL=(ALL) NOPASSWD: /bin/umount
Defaults:jellyfin !requiretty

7
debian/conf/jellyfin.service.conf vendored Normal file
View File

@ -0,0 +1,7 @@
# Jellyfin systemd configuration options
# Use this file to override the user or environment file location.
[Service]
#User = jellyfin
#EnvironmentFile = /etc/default/jellyfin

30
debian/conf/logging.json vendored Normal file
View File

@ -0,0 +1,30 @@
{
"Serilog": {
"MinimumLevel": "Information",
"WriteTo": [
{
"Name": "Console",
"Args": {
"outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "Async",
"Args": {
"configure": [
{
"Name": "File",
"Args": {
"path": "%JELLYFIN_LOG_DIR%//jellyfin.log",
"fileSizeLimitBytes": 10485700,
"rollOnFileSizeLimit": true,
"retainedFileCountLimit": 10,
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message}{NewLine}{Exception}"
}
}
]
}
}
]
}
}

31
debian/control vendored Normal file
View File

@ -0,0 +1,31 @@
Source: jellyfin
Section: misc
Priority: optional
Maintainer: Jellyfin Team <team@jellyfin.org>
Build-Depends: debhelper (>= 9),
dotnet-sdk-3.1,
libc6-dev,
libcurl4-openssl-dev,
libfontconfig1-dev,
libfreetype6-dev,
libssl-dev,
wget,
npm | nodejs
Standards-Version: 3.9.4
Homepage: https://jellyfin.media/
Vcs-Git: https://github.org/jellyfin/jellyfin.git
Vcs-Browser: https://github.org/jellyfin/jellyfin
Package: jellyfin
Replaces: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server
Breaks: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server
Conflicts: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server
Architecture: any
Depends: at,
libsqlite3-0,
jellyfin-ffmpeg,
libfontconfig1,
libfreetype6,
libssl1.1
Description: 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.

29
debian/copyright vendored Normal file
View File

@ -0,0 +1,29 @@
Format: http://dep.debian.net/deps/dep5
Upstream-Name: jellyfin
Source: https://github.com/jellyfin/jellyfin
Files: *
Copyright: 2018 Jellyfin Team
License: GPL-2.0+
Files: debian/*
Copyright: 2018 Joshua Boniface <joshua@boniface.me>
Copyright: 2014 Carlos Hernandez <carlos@techbyte.ca>
License: GPL-2.0+
License: GPL-2.0+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".

6
debian/gbp.conf vendored Normal file
View File

@ -0,0 +1,6 @@
[DEFAULT]
pristine-tar = False
cleaner = fakeroot debian/rules clean
[import-orig]
filter = [ ".git*", ".hg*", ".vs*", ".vscode*" ]

6
debian/install vendored Normal file
View File

@ -0,0 +1,6 @@
usr/lib/jellyfin usr/lib/
debian/conf/jellyfin etc/default/
debian/conf/logging.json etc/jellyfin/
debian/conf/jellyfin.service.conf etc/systemd/system/jellyfin.service.d/
debian/conf/jellyfin-sudoers etc/sudoers.d/
debian/bin/restart.sh usr/lib/jellyfin/

61
debian/jellyfin.init vendored Normal file
View File

@ -0,0 +1,61 @@
### BEGIN INIT INFO
# Provides: Jellyfin Media Server
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Jellyfin Media Server
# Description: Runs Jellyfin Server
### END INIT INFO
set -e
# Carry out specific functions when asked to by the system
if test -f /etc/default/jellyfin; then
. /etc/default/jellyfin
fi
. /lib/lsb/init-functions
PIDFILE="/run/jellyfin.pid"
case "$1" in
start)
log_daemon_msg "Starting Jellyfin Media Server" "jellyfin" || true
if start-stop-daemon --start --quiet --oknodo --background --pidfile $PIDFILE --make-pidfile --user $JELLYFIN_USER --chuid $JELLYFIN_USER --exec /usr/bin/jellyfin -- $JELLYFIN_ARGS; then
log_end_msg 0 || true
else
log_end_msg 1 || true
fi
;;
stop)
log_daemon_msg "Stopping Jellyfin Media Server" "jellyfin" || true
if start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --remove-pidfile; then
log_end_msg 0 || true
else
log_end_msg 1 || true
fi
;;
restart)
log_daemon_msg "Restarting Jellyfin Media Server" "jellyfin" || true
start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $PIDFILE --remove-pidfile
if start-stop-daemon --start --quiet --oknodo --background --pidfile $PIDFILE --make-pidfile --user $JELLYFIN_USER --chuid $JELLYFIN_USER --exec /usr/bin/jellyfin -- $JELLYFIN_ARGS; then
log_end_msg 0 || true
else
log_end_msg 1 || true
fi
;;
status)
status_of_proc -p $PIDFILE /usr/bin/jellyfin jellyfin && exit 0 || exit $?
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac

14
debian/jellyfin.service vendored Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description = Jellyfin Media Server
After = network.target
[Service]
Type = simple
EnvironmentFile = /etc/default/jellyfin
User = jellyfin
ExecStart = /usr/bin/jellyfin ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT}
Restart = on-failure
TimeoutSec = 15
[Install]
WantedBy = multi-user.target

20
debian/jellyfin.upstart vendored Normal file
View File

@ -0,0 +1,20 @@
description "jellyfin daemon"
start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [!2345]
console log
respawn
respawn limit 10 5
kill timeout 20
script
set -x
echo "Starting $UPSTART_JOB"
# Log file
logger -t "$0" "DEBUG: `set`"
. /etc/default/jellyfin
exec su -u $JELLYFIN_USER -c /usr/bin/jellyfin $JELLYFIN_ARGS
end script

1
debian/po/POTFILES.in vendored Normal file
View File

@ -0,0 +1 @@
[type: gettext/rfc822deb] templates

57
debian/po/templates.pot vendored Normal file
View File

@ -0,0 +1,57 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: jellyfin-server\n"
"Report-Msgid-Bugs-To: jellyfin-server@packages.debian.org\n"
"POT-Creation-Date: 2015-06-12 20:51-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#. Type: note
#. Description
#: ../templates:1001
msgid "Jellyfin permission info:"
msgstr ""
#. Type: note
#. Description
#: ../templates:1001
msgid ""
"Jellyfin by default runs under a user named \"jellyfin\". Please ensure that the "
"user jellyfin has read and write access to any folders you wish to add to your "
"library. Otherwise please run jellyfin under a different user."
msgstr ""
#. Type: string
#. Description
#: ../templates:2001
msgid "Username to run Jellyfin as:"
msgstr ""
#. Type: string
#. Description
#: ../templates:2001
msgid "The user that jellyfin will run as."
msgstr ""
#. Type: note
#. Description
#: ../templates:3001
msgid "Jellyfin still running"
msgstr ""
#. Type: note
#. Description
#: ../templates:3001
msgid "Jellyfin is currently running. Please close it and try again."
msgstr ""

92
debian/postinst vendored Normal file
View File

@ -0,0 +1,92 @@
#!/bin/bash
set -e
NAME=jellyfin
DEFAULT_FILE=/etc/default/${NAME}
# Source Jellyfin default configuration
if [[ -f $DEFAULT_FILE ]]; then
. $DEFAULT_FILE
fi
# Data directories for program data (cache, db), configs, and logs
PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME}
CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME}
LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME}
CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME}
case "$1" in
configure)
# create jellyfin group if it does not exist
if [[ -z "$(getent group jellyfin)" ]]; then
addgroup --quiet --system jellyfin > /dev/null 2>&1
fi
# create jellyfin user if it does not exist
if [[ -z "$(getent passwd jellyfin)" ]]; then
adduser --system --ingroup jellyfin --shell /bin/false jellyfin --no-create-home --home ${PROGRAMDATA} \
--gecos "Jellyfin default user" > /dev/null 2>&1
fi
# ensure $PROGRAMDATA exists
if [[ ! -d $PROGRAMDATA ]]; then
mkdir $PROGRAMDATA
fi
# ensure $CONFIGDATA exists
if [[ ! -d $CONFIGDATA ]]; then
mkdir $CONFIGDATA
fi
# ensure $LOGDATA exists
if [[ ! -d $LOGDATA ]]; then
mkdir $LOGDATA
fi
# ensure $CACHEDATA exists
if [[ ! -d $CACHEDATA ]]; then
mkdir $CACHEDATA
fi
# Ensure permissions are correct on all config directories
chown -R jellyfin $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA
chgrp adm $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA
chmod 0750 $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA
chmod +x /usr/lib/jellyfin/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)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER
if [[ -x "/usr/bin/deb-systemd-helper" ]]; then
# Manual init script handling
deb-systemd-helper unmask jellyfin.service >/dev/null || true
# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled jellyfin.service; then
# Enables the unit on first installation, creates new
# symlinks on upgrades if the unit file has changed.
deb-systemd-helper enable jellyfin.service >/dev/null || true
else
# Update the statefile to add new symlinks (if any), which need to be
# cleaned up on purge. Also remove old symlinks.
deb-systemd-helper update-state jellyfin.service >/dev/null || true
fi
fi
# End automatically added section
# Automatically added by dh_installinit
if [[ "$1" == "configure" ]] || [[ "$1" == "abort-upgrade" ]]; then
if [[ -d "/run/systemd/systemd" ]]; then
systemctl --system daemon-reload >/dev/null || true
deb-systemd-invoke start jellyfin >/dev/null || true
elif [[ -x "/etc/init.d/jellyfin" ]] || [[ -e "/etc/init/jellyfin.conf" ]]; then
update-rc.d jellyfin defaults >/dev/null
invoke-rc.d jellyfin start || exit $?
fi
fi
exit 0

81
debian/postrm vendored Normal file
View File

@ -0,0 +1,81 @@
#!/bin/bash
set -e
NAME=jellyfin
DEFAULT_FILE=/etc/default/${NAME}
# Source Jellyfin default configuration
if [[ -f $DEFAULT_FILE ]]; then
. $DEFAULT_FILE
fi
# Data directories for program data (cache, db), configs, and logs
PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME}
CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME}
LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME}
CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME}
# In case this system is running systemd, we make systemd reload the unit files
# to pick up changes.
if [[ -d /run/systemd/system ]] ; then
systemctl --system daemon-reload >/dev/null || true
fi
case "$1" in
purge)
echo PURGE | debconf-communicate $NAME > /dev/null 2>&1 || true
if [[ -x "/etc/init.d/jellyfin" ]] || [[ -e "/etc/init/jellyfin.connf" ]]; then
update-rc.d jellyfin remove >/dev/null 2>&1 || true
fi
if [[ -x "/usr/bin/deb-systemd-helper" ]]; then
deb-systemd-helper purge jellyfin.service >/dev/null
deb-systemd-helper unmask jellyfin.service >/dev/null
fi
# Remove user and group
userdel jellyfin > /dev/null 2>&1 || true
delgroup --quiet jellyfin > /dev/null 2>&1 || true
# Remove config dir
if [[ -d $CONFIGDATA ]]; then
rm -rf $CONFIGDATA
fi
# Remove log dir
if [[ -d $LOGDATA ]]; then
rm -rf $LOGDATA
fi
# Remove cache dir
if [[ -d $CACHEDATA ]]; then
rm -rf $CACHEDATA
fi
# Remove program data dir
if [[ -d $PROGRAMDATA ]]; then
rm -rf $PROGRAMDATA
fi
# Remove binary symlink
[[ -f /usr/bin/jellyfin ]] && rm /usr/bin/jellyfin
# Remove sudoers config
[[ -f /etc/sudoers.d/jellyfin-sudoers ]] && rm /etc/sudoers.d/jellyfin-sudoers
# Remove anything at the default locations; catches situations where the user moved the defaults
[[ -e /etc/jellyfin ]] && rm -rf /etc/jellyfin
[[ -e /var/log/jellyfin ]] && rm -rf /var/log/jellyfin
[[ -e /var/cache/jellyfin ]] && rm -rf /var/cache/jellyfin
[[ -e /var/lib/jellyfin ]] && rm -rf /var/lib/jellyfin
;;
remove)
if [[ -x "/usr/bin/deb-systemd-helper" ]]; then
deb-systemd-helper mask jellyfin.service >/dev/null
fi
;;
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

78
debian/preinst vendored Normal file
View File

@ -0,0 +1,78 @@
#!/bin/bash
set -e
NAME=jellyfin
DEFAULT_FILE=/etc/default/${NAME}
# Source Jellyfin default configuration
if [[ -f $DEFAULT_FILE ]]; then
. $DEFAULT_FILE
fi
# Data directories for program data (cache, db), configs, and logs
PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME}
CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME}
LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME}
CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME}
# In case this system is running systemd, we make systemd reload the unit files
# to pick up changes.
if [[ -d /run/systemd/system ]] ; then
systemctl --system daemon-reload >/dev/null || true
fi
case "$1" in
install|upgrade)
# try graceful termination;
if [[ -d /run/systemd/system ]]; then
deb-systemd-invoke stop ${NAME}.service > /dev/null 2>&1 || true
elif [ -x "/etc/init.d/${NAME}" ] || [ -e "/etc/init/${NAME}.conf" ]; then
invoke-rc.d ${NAME} stop > /dev/null 2>&1 || true
fi
# try and figure out if jellyfin is running
PIDFILE=$(find /var/run/ -maxdepth 1 -mindepth 1 -name "jellyfin*.pid" -print -quit)
[[ -n "$PIDFILE" ]] && [[ -s "$PIDFILE" ]] && JELLYFIN_PID=$(cat ${PIDFILE})
# if its running, let's stop it
if [[ -n "$JELLYFIN_PID" ]]; then
echo "Stopping Jellyfin!"
# if jellyfin is still running, kill it
if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then
CPIDS=$(pgrep -P $JELLYFIN_PID)
sleep 2 && kill -KILL $CPIDS
kill -TERM $CPIDS > /dev/null 2>&1
fi
sleep 1
# if it's still running, show error
if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then
echo "Could not successfully stop JellyfinServer, please do so before uninstalling."
exit 1
else
[[ -f $PIDFILE ]] && rm $PIDFILE
fi
fi
# Clean up old Emby cruft that can break the user's system
[[ -f /etc/sudoers.d/emby ]] && rm -f /etc/sudoers.d/emby
# If we have existing config, log, or cache dirs in /var/lib/jellyfin, move them into the right place
if [[ -d $PROGRAMDATA/config ]]; then
mv $PROGRAMDATA/config $CONFIGDATA
fi
if [[ -d $PROGRAMDATA/logs ]]; then
mv $PROGRAMDATA/logs $LOGDATA
fi
if [[ -d $PROGRAMDATA/logs ]]; then
mv $PROGRAMDATA/cache $CACHEDATA
fi
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

61
debian/prerm vendored Normal file
View File

@ -0,0 +1,61 @@
#!/bin/bash
set -e
NAME=jellyfin
DEFAULT_FILE=/etc/default/${NAME}
# Source Jellyfin default configuration
if [[ -f $DEFAULT_FILE ]]; then
. $DEFAULT_FILE
fi
# Data directories for program data (cache, db), configs, and logs
PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME}
CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME}
LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME}
CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME}
case "$1" in
remove|upgrade|deconfigure)
echo "Stopping Jellyfin!"
# try graceful termination;
if [[ -d /run/systemd/system ]]; then
deb-systemd-invoke stop ${NAME}.service > /dev/null 2>&1 || true
elif [ -x "/etc/init.d/${NAME}" ] || [ -e "/etc/init/${NAME}.conf" ]; then
invoke-rc.d ${NAME} stop > /dev/null 2>&1 || true
fi
# Ensure that it is shutdown
PIDFILE=$(find /var/run/ -maxdepth 1 -mindepth 1 -name "jellyfin*.pid" -print -quit)
[[ -n "$PIDFILE" ]] && [[ -s "$PIDFILE" ]] && JELLYFIN_PID=$(cat ${PIDFILE})
# if its running, let's stop it
if [[ -n "$JELLYFIN_PID" ]]; then
# if jellyfin is still running, kill it
if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then
CPIDS=$(pgrep -P $JELLYFIN_PID)
sleep 2 && kill -KILL $CPIDS
kill -TERM $CPIDS > /dev/null 2>&1
fi
sleep 1
# if it's still running, show error
if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then
echo "Could not successfully stop Jellyfin, please do so before uninstalling."
exit 1
else
[[ -f $PIDFILE ]] && rm $PIDFILE
fi
fi
if [[ -f /usr/lib/jellyfin/bin/MediaBrowser.Server.Mono.exe.so ]]; then
rm /usr/lib/jellyfin/bin/MediaBrowser.Server.Mono.exe.so
fi
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

66
debian/rules vendored Executable file
View File

@ -0,0 +1,66 @@
#! /usr/bin/make -f
CONFIG := Release
TERM := xterm
SHELL := /bin/bash
WEB_TARGET := $(CURDIR)/MediaBrowser.WebDashboard/jellyfin-web
WEB_VERSION := $(shell sed -n -e 's/^version: "\(.*\)"/\1/p' $(CURDIR)/build.yaml)
HOST_ARCH := $(shell arch)
BUILD_ARCH := ${DEB_HOST_MULTIARCH}
ifeq ($(HOST_ARCH),x86_64)
# Building AMD64
DOTNETRUNTIME := debian-x64
ifeq ($(BUILD_ARCH),arm-linux-gnueabihf)
# Cross-building ARM on AMD64
DOTNETRUNTIME := debian-arm
endif
ifeq ($(BUILD_ARCH),aarch64-linux-gnu)
# Cross-building ARM on AMD64
DOTNETRUNTIME := debian-arm64
endif
endif
ifeq ($(HOST_ARCH),armv7l)
# Building ARM
DOTNETRUNTIME := debian-arm
endif
ifeq ($(HOST_ARCH),arm64)
# Building ARM
DOTNETRUNTIME := debian-arm64
endif
export DH_VERBOSE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
%:
dh $@
# disable "make check"
override_dh_auto_test:
# disable stripping debugging symbols
override_dh_clistrip:
override_dh_auto_build:
echo $(WEB_VERSION)
# Clone down and build Web frontend
mkdir -p $(WEB_TARGET)
wget -O web-src.tgz https://github.com/jellyfin/jellyfin-web/archive/v$(WEB_VERSION).tar.gz || wget -O web-src.tgz https://github.com/jellyfin/jellyfin-web/archive/master.tar.gz
mkdir -p $(CURDIR)/web
tar -xzf web-src.tgz -C $(CURDIR)/web/ --strip 1
cd $(CURDIR)/web/ && npm install yarn
cd $(CURDIR)/web/ && node_modules/yarn/bin/yarn install
mv $(CURDIR)/web/dist/* $(WEB_TARGET)/
# Build the application
dotnet publish --configuration $(CONFIG) --output='$(CURDIR)/usr/lib/jellyfin/bin' --self-contained --runtime $(DOTNETRUNTIME) \
"-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" Jellyfin.Server
override_dh_auto_clean:
dotnet clean -maxcpucount:1 --configuration $(CONFIG) Jellyfin.Server || true
rm -f '$(CURDIR)/web-src.tgz'
rm -rf '$(CURDIR)/usr'
rm -rf '$(CURDIR)/web'
rm -rf '$(WEB_TARGET)'
# Force the service name to jellyfin even if we're building jellyfin-nightly
override_dh_installinit:
dh_installinit --name=jellyfin

3
debian/source.lintian-overrides vendored Normal file
View File

@ -0,0 +1,3 @@
# This is an override for the following lintian errors:
jellyfin source: license-problem-md5sum-non-free-file Emby.Drawing/ImageMagick/fonts/webdings.ttf*
jellyfin source: source-is-missing

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
1.0

11
debian/source/options vendored Normal file
View File

@ -0,0 +1,11 @@
tar-ignore='.git*'
tar-ignore='**/.git'
tar-ignore='**/.hg'
tar-ignore='**/.vs'
tar-ignore='**/.vscode'
tar-ignore='deployment'
tar-ignore='**/bin'
tar-ignore='**/obj'
tar-ignore='**/.nuget'
tar-ignore='*.deb'
tar-ignore='ThirdParty'