aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.dockerignore3
-rw-r--r--.drone.yml2
-rw-r--r--.gitignore34
-rwxr-xr-xbuild-deb.sh24
-rw-r--r--debian/bin/jellyfin-sudoers37
-rw-r--r--debian/bin/restart.sh18
-rw-r--r--debian/source/options1
-rw-r--r--deployment/README.md8
-rw-r--r--deployment/build.sh23
-rw-r--r--deployment/clean.sh21
-rw-r--r--deployment/collect_all.sh20
-rw-r--r--deployment/common.build.sh108
-rw-r--r--deployment/debian-package-x64/Dockerfile (renamed from Dockerfile.debian_package)13
-rw-r--r--deployment/debian-package-x64/clean.sh7
-rw-r--r--deployment/debian-package-x64/package.sh33
-rw-r--r--deployment/debian-package-x64/pkg-src/changelog (renamed from debian/changelog)0
-rw-r--r--deployment/debian-package-x64/pkg-src/compat (renamed from debian/compat)0
-rw-r--r--deployment/debian-package-x64/pkg-src/conf/jellyfin (renamed from debian/conf/jellyfin)0
-rw-r--r--deployment/debian-package-x64/pkg-src/conf/jellyfin.service.conf (renamed from debian/conf/jellyfin.service.conf)0
-rw-r--r--deployment/debian-package-x64/pkg-src/conf/logging.json (renamed from debian/conf/logging.json)0
-rw-r--r--deployment/debian-package-x64/pkg-src/control (renamed from debian/control)0
-rw-r--r--deployment/debian-package-x64/pkg-src/copyright (renamed from debian/copyright)0
-rw-r--r--deployment/debian-package-x64/pkg-src/gbp.conf (renamed from debian/gbp.conf)2
-rw-r--r--deployment/debian-package-x64/pkg-src/install (renamed from debian/install)0
-rw-r--r--deployment/debian-package-x64/pkg-src/jellyfin.init (renamed from debian/jellyfin.init)0
-rw-r--r--deployment/debian-package-x64/pkg-src/jellyfin.service (renamed from debian/jellyfin.service)0
-rw-r--r--deployment/debian-package-x64/pkg-src/jellyfin.upstart (renamed from debian/jellyfin.upstart)0
-rw-r--r--deployment/debian-package-x64/pkg-src/po/POTFILES.in (renamed from debian/po/POTFILES.in)0
-rw-r--r--deployment/debian-package-x64/pkg-src/po/templates.pot (renamed from debian/po/templates.pot)0
-rw-r--r--deployment/debian-package-x64/pkg-src/postinst (renamed from debian/postinst)0
-rw-r--r--deployment/debian-package-x64/pkg-src/postrm (renamed from debian/postrm)0
-rw-r--r--deployment/debian-package-x64/pkg-src/preinst (renamed from debian/preinst)0
-rw-r--r--deployment/debian-package-x64/pkg-src/prerm (renamed from debian/prerm)0
-rw-r--r--[-rwxr-xr-x]deployment/debian-package-x64/pkg-src/rules (renamed from debian/rules)6
-rw-r--r--deployment/debian-package-x64/pkg-src/source.lintian-overrides (renamed from debian/source.lintian-overrides)0
-rw-r--r--deployment/debian-package-x64/pkg-src/source/format (renamed from debian/source/format)0
-rw-r--r--deployment/debian-package-x64/pkg-src/source/options11
-rw-r--r--deployment/debian-x64/build.sh7
-rw-r--r--deployment/debian-x64/clean.sh7
-rw-r--r--deployment/debian-x64/package.sh7
-rw-r--r--deployment/docker/Dockerfile (renamed from Dockerfile)4
-rw-r--r--deployment/docker/Dockerfile.aarch64 (renamed from Dockerfile.aarch64)2
-rw-r--r--deployment/docker/build.sh7
-rw-r--r--deployment/framework/build.sh8
-rw-r--r--deployment/framework/clean.sh7
-rw-r--r--deployment/framework/package.sh7
-rw-r--r--deployment/linux-x64/build.sh7
-rw-r--r--deployment/linux-x64/clean.sh7
-rw-r--r--deployment/linux-x64/package.sh7
-rw-r--r--deployment/osx-x64/build.sh7
-rw-r--r--deployment/osx-x64/clean.sh7
-rw-r--r--deployment/osx-x64/package.sh7
-rw-r--r--deployment/ubuntu-x64/build.sh7
-rw-r--r--deployment/ubuntu-x64/clean.sh7
-rw-r--r--deployment/ubuntu-x64/package.sh7
-rw-r--r--deployment/unraid/docker-templates/README.md15
-rw-r--r--deployment/unraid/docker-templates/jellyfin.xml51
-rw-r--r--deployment/win-generic/build-jellyfin.ps1 (renamed from build-jellyfin.ps1)220
-rw-r--r--deployment/win-generic/install-jellyfin.ps1 (renamed from install-jellyfin.ps1)0
-rw-r--r--deployment/win-generic/install.bat (renamed from install.bat)0
-rw-r--r--deployment/win-x64/build.sh7
-rw-r--r--deployment/win-x64/clean.sh7
-rw-r--r--deployment/win-x64/package.sh9
-rw-r--r--deployment/win-x86/build.sh7
-rw-r--r--deployment/win-x86/clean.sh7
-rw-r--r--deployment/win-x86/package.sh9
66 files changed, 605 insertions, 217 deletions
diff --git a/.dockerignore b/.dockerignore
index fc4d8ed26..54b0aa3a7 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -3,3 +3,6 @@
Dockerfile
CONTRIBUTORS.md
README.md
+deployment/*/dist
+deployment/*/pkg-dist
+deployment/collect-dist/
diff --git a/.drone.yml b/.drone.yml
index c6d41b555..98db4884b 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -9,4 +9,4 @@ steps:
- name: build
image: microsoft/dotnet:2-sdk
commands:
- - dotnet publish --configuration release --output /release
+ - dotnet publish --configuration release --output /release Jellyfin.Server
diff --git a/.gitignore b/.gitignore
index 880e63a7f..b4b928ef2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,3 @@
-!*
-
.directory
#################
@@ -49,6 +47,8 @@ ProgramData-UI*/
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
+.vs/
+
# User-specific files
*.suo
*.user
@@ -204,7 +204,6 @@ $RECYCLE.BIN/
# Mac crap
.DS_Store
-
#############
## Python
#############
@@ -234,23 +233,32 @@ pip-log.txt
#Mr Developer
.mr.developer.cfg
-/.vs
##########
# Rider
##########
.idea/
+##########
+# Visual Studio Code
+##########
+.vscode/
+
#########################
-# Debian build artifacts
+# Build artifacts
#########################
-debian/.debhelper/
-debian/*.debhelper
-debian/debhelper-build-stamp
-debian/files
-debian/jellyfin.substvars
-debian/jellyfin/
-
+# Artifacts for debian-x64
+deployment/debian-x64/pkg-src/.debhelper/
+deployment/debian-x64/pkg-src/*.debhelper
+deployment/debian-x64/pkg-src/debhelper-build-stamp
+deployment/debian-x64/pkg-src/files
+deployment/debian-x64/pkg-src/jellyfin.substvars
+deployment/debian-x64/pkg-src/jellyfin/
# Don't ignore the debian/bin folder
-!debian/bin/
+!deployment/debian-x64/pkg-src/bin/
+
+deployment/**/dist/
+deployment/**/pkg-dist/
+deployment/collect-dist/
+
diff --git a/build-deb.sh b/build-deb.sh
deleted file mode 100755
index fd14fc17d..000000000
--- a/build-deb.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env sh
-
-# Build a Jellyfin .deb file with Docker on Linux
-# Places the output .deb file in the parent directory
-
-set -o errexit
-set -o xtrace
-set -o nounset
-
-package_temporary_dir="`mktemp -d`"
-current_user="`whoami`"
-image_name="jellyfin-debuild"
-
-cleanup() {
- set +o errexit
- docker image rm $image_name --force
- rm -rf "$package_temporary_dir"
-}
-trap cleanup EXIT INT
-
-docker build . -t "$image_name" -f ./Dockerfile.debian_package
-docker run --rm -v "$package_temporary_dir:/temp" "$image_name" cp -r /dist /temp/
-sudo chown -R "$current_user" "$package_temporary_dir"
-mv "$package_temporary_dir"/dist/*.deb ../
diff --git a/debian/bin/jellyfin-sudoers b/debian/bin/jellyfin-sudoers
deleted file mode 100644
index 4eb91366b..000000000
--- a/debian/bin/jellyfin-sudoers
+++ /dev/null
@@ -1,37 +0,0 @@
-#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
diff --git a/debian/bin/restart.sh b/debian/bin/restart.sh
deleted file mode 100644
index a6f4632ba..000000000
--- a/debian/bin/restart.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-NAME=jellyfin
-
-restart_cmds=("s6-svc -t /var/run/s6/services/${NAME}" \
- "systemctl restart ${NAME}" \
- "service ${NAME} restart" \
- "/etc/init.d/${NAME} restart")
-
-for restart_cmd in "${restart_cmds[@]}"; do
- cmd=$(echo "$restart_cmd" | awk '{print $1}')
- cmd_loc=$(command -v ${cmd})
- if [[ -n "$cmd_loc" ]]; then
- restart_cmd=$(echo "$restart_cmd" | sed -e "s%${cmd}%${cmd_loc}%")
- echo "sleep 2; sudo $restart_cmd > /dev/null 2>&1" | at now > /dev/null 2>&1
- exit 0
- fi
-done
diff --git a/debian/source/options b/debian/source/options
deleted file mode 100644
index 45bef4764..000000000
--- a/debian/source/options
+++ /dev/null
@@ -1 +0,0 @@
-tar-ignore = ".git*"
diff --git a/deployment/README.md b/deployment/README.md
new file mode 100644
index 000000000..3400fd840
--- /dev/null
+++ b/deployment/README.md
@@ -0,0 +1,8 @@
+# Build scripts
+
+All `build.sh` and `package.sh` scripts are for *nix platforms (or WSL on Windows 10).
+
+After running both, check the `*/pkg-dist/` folders for the archives and packages.
+
+`build_all.sh` will invoke every build and package script.
+Use `collect_all.sh` to copy all artifact to one directory for easy uploading.
diff --git a/deployment/build.sh b/deployment/build.sh
new file mode 100644
index 000000000..0b5dae84a
--- /dev/null
+++ b/deployment/build.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+
+# Execute all build.sh and package.sh and sign.sh scripts in every folder. In that order. Script should check for artifacts themselves.
+echo "Running for platforms '$@'."
+for directory in */ ; do
+ platform=`basename "${directory}"`
+ if [[ $@ == *"$platform"* || $@ = *"all"* ]]; then
+ echo "Processing ${platform}"
+ pushd "$platform"
+ if [ -f build.sh ]; then
+ echo ./build.sh
+ fi
+ if [ -f package.sh ]; then
+ echo ./package.sh
+ fi
+ if [ -f sign.sh ]; then
+ echo ./sign.sh
+ fi
+ popd
+ else
+ echo "Skipping $platform."
+ fi
+done
diff --git a/deployment/clean.sh b/deployment/clean.sh
new file mode 100644
index 000000000..7517cf849
--- /dev/null
+++ b/deployment/clean.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -e
+
+# Execute every clean.sh scripts in every folder.
+echo "Running for platforms '$@'."
+for directory in */ ; do
+ platform=`basename "${directory}"`
+ if [[ $@ == *"$platform"* || $@ = *"all"* ]]; then
+ echo "Processing ${platform}"
+ pushd "$platform"
+ if [ -f clean.sh ]; then
+ echo ./clean.sh
+ fi
+ popd
+ else
+ echo "Skipping $platform."
+ fi
+done
+
+rm -rf ./collect-dist
diff --git a/deployment/collect_all.sh b/deployment/collect_all.sh
new file mode 100644
index 000000000..d625002db
--- /dev/null
+++ b/deployment/collect_all.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+source common.build.sh
+
+VERSION=`get_version ..`
+
+COLLECT_DIR="./collect-dist"
+
+mkdir -p ./collect-dist
+
+DIRS=`find . -type d -name "pkg-dist"`
+
+while read directory
+do
+ echo "Collecting everything from '$directory'.."
+ PLATFORM=$(basename "$(dirname "$directory")")
+ # Copy all artifacts with extensions tar.gz, deb, exe, zip, rpm and add the platform name to resolve any duplicates.
+ find $directory \( -name "jellyfin*.tar.gz" -o -name "jellyfin*.deb" -o -name "jellyfin*.rpm" -o -name "jellyfin*.zip" -o -name "jellyfin*.exe" \) -exec sh -c 'cp "$1" "'${COLLECT_DIR}'/jellyfin_'${PLATFORM}'_${1#*jellyfin_}"' _ {} \;
+
+done <<< "${DIRS}"
diff --git a/deployment/common.build.sh b/deployment/common.build.sh
new file mode 100644
index 000000000..5996a4ec9
--- /dev/null
+++ b/deployment/common.build.sh
@@ -0,0 +1,108 @@
+#!/usr/bin/env bash
+
+set -o errexit
+set -o nounset
+
+RED='\033[0;31m'
+GREEN='\033[0;32m'
+CYAN='\033[0;36m'
+NC='\033[0m' # No Color
+
+DEFAULT_BUILD_CONTEXT="../.."
+DEFAULT_ROOT="."
+DEFAULT_DOTNETRUNTIME="framework"
+DEFAULT_CONFIG="Release"
+DEFAULT_OUTPUT_DIR="dist/jellyfin-git"
+DEFAULT_PKG_DIR="pkg-dist"
+DEFAULT_DOCKERFILE="Dockerfile"
+DEFAULT_IMAGE_TAG="jellyfin:"`git rev-parse --abbrev-ref HEAD`
+
+# Run a build
+build_jellyfin()
+(
+ ROOT=${1-$DEFAULT_ROOT}
+ CONFIG=${2-$DEFAULT_CONFIG}
+ DOTNETRUNTIME=${3-$DEFAULT_DOTNETRUNTIME}
+ OUTPUT_DIR=${4-$DEFAULT_OUTPUT_DIR}
+
+ echo -e "${CYAN}Building jellyfin in '${ROOT}' for ${DOTNETRUNTIME} with configuration ${CONFIG} and output directory '${OUTPUT_DIR}'.${NC}"
+ if [[ $DOTNETRUNTIME == 'framework' ]]; then
+ dotnet publish "${ROOT}" --configuration "${CONFIG}" --output="${OUTPUT_DIR}"
+ else
+ dotnet publish "${ROOT}" --configuration "${CONFIG}" --output="${OUTPUT_DIR}" --self-contained --runtime ${DOTNETRUNTIME}
+ fi
+ EXIT_CODE=$?
+ if [ $EXIT_CODE -eq 0 ]; then
+ echo -e "${GREEN}[DONE] Build jellyfin in '${ROOT}' for ${DOTNETRUNTIME} with configuration ${CONFIG} and output directory '${OUTPUT_DIR}' complete.${NC}"
+ else
+ echo -e "${RED}[FAIL] Build jellyfin in '${ROOT}' for ${DOTNETRUNTIME} with configuration ${CONFIG} and output directory '${OUTPUT_DIR}' FAILED.${NC}"
+ fi
+)
+
+# Run a docker
+build_jellyfin_docker()
+(
+ BUILD_CONTEXT=${1-$DEFAULT_BUILD_CONTEXT}
+ DOCKERFILE=${2-$DEFAULT_DOCKERFILE}
+ IMAGE_TAG=${3-$DEFAULT_IMAGE_TAG}
+
+ echo -e "${CYAN}Building jellyfin docker image in '${ROOT}' with Dockerfile ${CONFIG} and tag '${IMAGE_TAG}'.${NC}"
+ docker build -t ${IMAGE_TAG} -f ${DOCKERFILE} ${ROOT}
+ EXIT_CODE=$?
+ if [ $EXIT_CODE -eq 0 ]; then
+ echo -e "${GREEN}[DONE] Building jellyfin docker image in '${ROOT}' with Dockerfile ${CONFIG} and tag '${IMAGE_TAG}' complete.${NC}"
+ else
+ echo -e "${RED}[FAIL] Building jellyfin docker image in '${ROOT}' with Dockerfile ${CONFIG} and tag '${IMAGE_TAG}' FAILED.${NC}"
+ fi
+)
+
+# Clean a build
+clean_jellyfin()
+(
+ local ROOT=${1-$DEFAULT_ROOT}
+ local CONFIG=${2-$DEFAULT_CONFIG}
+ local OUTPUT_DIR=${3-$DEFAULT_OUTPUT_DIR}
+ local PKG_DIR=${4-$DEFAULT_PKG_DIR}
+ echo -e "${CYAN}Cleaning jellyfin in '${ROOT}'' with configuration ${CONFIG} and output directory '${OUTPUT_DIR}'.${NC}"
+ echo -e "${CYAN}Deleting '${OUTPUT_DIR}'${NC}"
+ rm -rf "$OUTPUT_DIR"
+ echo -e "${CYAN}Deleting '${PKG_DIR}'${NC}"
+ rm -rf "$PKG_DIR"
+ dotnet clean "${ROOT}" -maxcpucount:1 --configuration ${CONFIG}
+ local EXIT_CODE=$?
+ if [ $EXIT_CODE -eq 0 ]; then
+ echo -e "${GREEN}[DONE] Clean jellyfin in '${ROOT}' with configuration ${CONFIG} and output directory '${OUTPUT_DIR}' complete.${NC}"
+ else
+ echo -e "${RED}[FAIL] Clean jellyfin in '${ROOT}' with configuration ${CONFIG} and output directory '${OUTPUT_DIR}' failed.${NC}"
+ fi
+)
+
+# Parse the version from the AssemblyVersion
+get_version()
+(
+ local ROOT=${1-$DEFAULT_ROOT}
+ grep "AssemblyVersion" ${ROOT}/SharedVersion.cs | sed -E 's/\[assembly: ?AssemblyVersion\("([0-9\.]+)"\)\]/\1/' | sed -E 's/.0$//'
+)
+
+# Packages the output folder into an archive.
+package_portable()
+(
+ local ROOT=${1-$DEFAULT_ROOT}
+ local OUTPUT_DIR=${2-$DEFAULT_OUTPUT_DIR}
+ local PKG_DIR=${3-$DEFAULT_PKG_DIR}
+ # Package portable build result
+ if [ -d ${OUTPUT_DIR} ]; then
+ echo -e "${CYAN}Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}'.${NC}"
+ mkdir -p ${PKG_DIR}
+ tar -zcvf "${PKG_DIR}/`basename "${OUTPUT_DIR}"`.portable.tar.gz" -C "`dirname "${OUTPUT_DIR}"`" "`basename "${OUTPUT_DIR}"`"
+ local EXIT_CODE=$?
+ if [ $EXIT_CODE -eq 0 ]; then
+ echo -e "${GREEN}[DONE] Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}' complete.${NC}"
+ else
+ echo -e "${RED}[FAIL] Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}' FAILED.${NC}"
+ fi
+ else
+ echo -e "${RED}[FAIL] Build artifacts do not exist for ${OUTPUT_DIR}. Run build.sh first.${NC}"
+ fi
+)
+
diff --git a/Dockerfile.debian_package b/deployment/debian-package-x64/Dockerfile
index c5c631b71..0de62f72b 100644
--- a/Dockerfile.debian_package
+++ b/deployment/debian-package-x64/Dockerfile
@@ -1,4 +1,6 @@
FROM debian:9
+ARG SOURCEDIR=/repo
+ENV DEB_BUILD_OPTIONS=noddebs
# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current
RUN apt-get update \
@@ -11,12 +13,11 @@ RUN apt-get update \
&& chown root:root /etc/apt/sources.list.d/microsoft-prod.list \
&& apt-get update
-WORKDIR /repo
+WORKDIR ${SOURCEDIR}
COPY . .
+COPY ./deployment/debian-x64/pkg-src ./debian
-RUN yes|mk-build-deps -i \
- && dpkg-buildpackage -us -uc \
- && mkdir /dist \
- && mv /jellyfin*deb /dist
+RUN yes | mk-build-deps -i debian/control \
+ && dpkg-buildpackage -us -uc
-WORKDIR /dist
+WORKDIR /
diff --git a/deployment/debian-package-x64/clean.sh b/deployment/debian-package-x64/clean.sh
new file mode 100644
index 000000000..3df2d7796
--- /dev/null
+++ b/deployment/debian-package-x64/clean.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/debian-package-x64/package.sh b/deployment/debian-package-x64/package.sh
new file mode 100644
index 000000000..7909b0a84
--- /dev/null
+++ b/deployment/debian-package-x64/package.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+# TODO get the version in the package automatically. And using the changelog to decide the debian package suffix version.
+
+# Build a Jellyfin .deb file with Docker on Linux
+# Places the output .deb file in the parent directory
+
+package_temporary_dir="`pwd`/pkg-dist-tmp"
+output_dir="`pwd`/pkg-dist"
+current_user="`whoami`"
+image_name="jellyfin-debuild"
+
+cleanup() {
+ set +o errexit
+ docker image rm $image_name --force
+ rm -rf "$package_temporary_dir"
+}
+trap cleanup EXIT INT
+
+docker build ../.. -t "$image_name" -f ./Dockerfile --build-arg SOURCEDIR="/jellyfin-${VERSION}"
+mkdir -p "$package_temporary_dir"
+mkdir -p "$output_dir"
+docker run --rm -v "$package_temporary_dir:/temp" "$image_name" sh -c 'find / -maxdepth 1 -type f -name "jellyfin*" -exec mv {} /temp \;'
+chown -R "$current_user" "$package_temporary_dir"
+if [ $? -ne 0 ]; then
+ # Some platforms need this to chown the file properly. (Platforms with native docker, not just the client)
+ sudo chown -R "$current_user" "$package_temporary_dir"
+fi
+mv "$package_temporary_dir"/* "$output_dir"
diff --git a/debian/changelog b/deployment/debian-package-x64/pkg-src/changelog
index 685d31a5e..685d31a5e 100644
--- a/debian/changelog
+++ b/deployment/debian-package-x64/pkg-src/changelog
diff --git a/debian/compat b/deployment/debian-package-x64/pkg-src/compat
index 45a4fb75d..45a4fb75d 100644
--- a/debian/compat
+++ b/deployment/debian-package-x64/pkg-src/compat
diff --git a/debian/conf/jellyfin b/deployment/debian-package-x64/pkg-src/conf/jellyfin
index 861865aae..861865aae 100644
--- a/debian/conf/jellyfin
+++ b/deployment/debian-package-x64/pkg-src/conf/jellyfin
diff --git a/debian/conf/jellyfin.service.conf b/deployment/debian-package-x64/pkg-src/conf/jellyfin.service.conf
index 1b69dd74e..1b69dd74e 100644
--- a/debian/conf/jellyfin.service.conf
+++ b/deployment/debian-package-x64/pkg-src/conf/jellyfin.service.conf
diff --git a/debian/conf/logging.json b/deployment/debian-package-x64/pkg-src/conf/logging.json
index 5d98484cd..5d98484cd 100644
--- a/debian/conf/logging.json
+++ b/deployment/debian-package-x64/pkg-src/conf/logging.json
diff --git a/debian/control b/deployment/debian-package-x64/pkg-src/control
index 74bebeaf1..74bebeaf1 100644
--- a/debian/control
+++ b/deployment/debian-package-x64/pkg-src/control
diff --git a/debian/copyright b/deployment/debian-package-x64/pkg-src/copyright
index 0d7a2a600..0d7a2a600 100644
--- a/debian/copyright
+++ b/deployment/debian-package-x64/pkg-src/copyright
diff --git a/debian/gbp.conf b/deployment/debian-package-x64/pkg-src/gbp.conf
index f131b973c..60b3d2872 100644
--- a/debian/gbp.conf
+++ b/deployment/debian-package-x64/pkg-src/gbp.conf
@@ -3,4 +3,4 @@ pristine-tar = False
cleaner = fakeroot debian/rules clean
[import-orig]
-filter = [ ".git*", ".hg*" ]
+filter = [ ".git*", ".hg*", ".vs*", ".vscode*" ]
diff --git a/debian/install b/deployment/debian-package-x64/pkg-src/install
index adaff7b26..adaff7b26 100644
--- a/debian/install
+++ b/deployment/debian-package-x64/pkg-src/install
diff --git a/debian/jellyfin.init b/deployment/debian-package-x64/pkg-src/jellyfin.init
index d103fb0f1..d103fb0f1 100644
--- a/debian/jellyfin.init
+++ b/deployment/debian-package-x64/pkg-src/jellyfin.init
diff --git a/debian/jellyfin.service b/deployment/debian-package-x64/pkg-src/jellyfin.service
index c17422029..c17422029 100644
--- a/debian/jellyfin.service
+++ b/deployment/debian-package-x64/pkg-src/jellyfin.service
diff --git a/debian/jellyfin.upstart b/deployment/debian-package-x64/pkg-src/jellyfin.upstart
index ef5bc9bca..ef5bc9bca 100644
--- a/debian/jellyfin.upstart
+++ b/deployment/debian-package-x64/pkg-src/jellyfin.upstart
diff --git a/debian/po/POTFILES.in b/deployment/debian-package-x64/pkg-src/po/POTFILES.in
index cef83a340..cef83a340 100644
--- a/debian/po/POTFILES.in
+++ b/deployment/debian-package-x64/pkg-src/po/POTFILES.in
diff --git a/debian/po/templates.pot b/deployment/debian-package-x64/pkg-src/po/templates.pot
index 2cdcae417..2cdcae417 100644
--- a/debian/po/templates.pot
+++ b/deployment/debian-package-x64/pkg-src/po/templates.pot
diff --git a/debian/postinst b/deployment/debian-package-x64/pkg-src/postinst
index 3690d20ba..3690d20ba 100644
--- a/debian/postinst
+++ b/deployment/debian-package-x64/pkg-src/postinst
diff --git a/debian/postrm b/deployment/debian-package-x64/pkg-src/postrm
index 690f5d587..690f5d587 100644
--- a/debian/postrm
+++ b/deployment/debian-package-x64/pkg-src/postrm
diff --git a/debian/preinst b/deployment/debian-package-x64/pkg-src/preinst
index 0063e0e63..0063e0e63 100644
--- a/debian/preinst
+++ b/deployment/debian-package-x64/pkg-src/preinst
diff --git a/debian/prerm b/deployment/debian-package-x64/pkg-src/prerm
index 4770c03c4..4770c03c4 100644
--- a/debian/prerm
+++ b/deployment/debian-package-x64/pkg-src/prerm
diff --git a/debian/rules b/deployment/debian-package-x64/pkg-src/rules
index 10a3a8486..ce98cb8f8 100755..100644
--- a/debian/rules
+++ b/deployment/debian-package-x64/pkg-src/rules
@@ -2,7 +2,7 @@
CONFIG := Release
TERM := xterm
SHELL := /bin/bash
-DOTNETRUNTIME := linux-x64
+DOTNETRUNTIME := debian-x64
export DH_VERBOSE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
@@ -16,8 +16,8 @@ override_dh_auto_test:
override_dh_clistrip:
override_dh_auto_build:
- dotnet publish --configuration $(CONFIG) --output='$(CURDIR)/usr/lib/jellyfin/bin' --self-contained --runtime $(DOTNETRUNTIME)
+ dotnet publish --configuration $(CONFIG) --output='$(CURDIR)/usr/lib/jellyfin/bin' --self-contained --runtime $(DOTNETRUNTIME) Jellyfin.Server
override_dh_auto_clean:
- dotnet clean -maxcpucount:1 --configuration $(CONFIG) || true
+ dotnet clean -maxcpucount:1 --configuration $(CONFIG) Jellyfin.Server || true
rm -rf '$(CURDIR)/usr'
diff --git a/debian/source.lintian-overrides b/deployment/debian-package-x64/pkg-src/source.lintian-overrides
index aeb332f13..aeb332f13 100644
--- a/debian/source.lintian-overrides
+++ b/deployment/debian-package-x64/pkg-src/source.lintian-overrides
diff --git a/debian/source/format b/deployment/debian-package-x64/pkg-src/source/format
index d3827e75a..d3827e75a 100644
--- a/debian/source/format
+++ b/deployment/debian-package-x64/pkg-src/source/format
diff --git a/deployment/debian-package-x64/pkg-src/source/options b/deployment/debian-package-x64/pkg-src/source/options
new file mode 100644
index 000000000..17b5373d5
--- /dev/null
+++ b/deployment/debian-package-x64/pkg-src/source/options
@@ -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'
diff --git a/deployment/debian-x64/build.sh b/deployment/debian-x64/build.sh
new file mode 100644
index 000000000..47cfb5327
--- /dev/null
+++ b/deployment/debian-x64/build.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+build_jellyfin ../../Jellyfin.Server Release debian-x64 `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/debian-x64/clean.sh b/deployment/debian-x64/clean.sh
new file mode 100644
index 000000000..3df2d7796
--- /dev/null
+++ b/deployment/debian-x64/clean.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/debian-x64/package.sh b/deployment/debian-x64/package.sh
new file mode 100644
index 000000000..13b943ea8
--- /dev/null
+++ b/deployment/debian-x64/package.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+package_portable ../.. `pwd`/dist/jellyfin_${VERSION}
diff --git a/Dockerfile b/deployment/docker/Dockerfile
index 75700e6f5..c32cdcf9b 100644
--- a/Dockerfile
+++ b/deployment/docker/Dockerfile
@@ -15,7 +15,7 @@ WORKDIR /repo
COPY . .
RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \
&& dotnet clean \
- && dotnet publish --configuration release --output /jellyfin
+ && dotnet publish --configuration release --output /jellyfin Jellyfin.Server
FROM microsoft/dotnet:${DOTNET_VERSION}-runtime
@@ -24,5 +24,5 @@ COPY --from=ffmpeg /ffmpeg-bin/* /usr/bin/
EXPOSE 8096
VOLUME /config /media
RUN apt update \
- && apt install -y libfontconfig1 # needed for Skia
+ && apt install -y libfontconfig1 --no-install-recommends # needed for Skia
ENTRYPOINT dotnet /jellyfin/jellyfin.dll -programdata /config
diff --git a/Dockerfile.aarch64 b/deployment/docker/Dockerfile.aarch64
index da4acc841..d1423dda2 100644
--- a/Dockerfile.aarch64
+++ b/deployment/docker/Dockerfile.aarch64
@@ -6,7 +6,7 @@ COPY . .
RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \
&& find . -type f -exec sed -i 's/netcoreapp2.1/netcoreapp3.0/g' {} \; \
&& dotnet clean \
- && dotnet publish --configuration release --output /jellyfin
+ && dotnet publish --configuration release --output /jellyfin Jellyfin.Server
FROM microsoft/dotnet:${DOTNET_VERSION}-runtime
COPY --from=builder /jellyfin /jellyfin
diff --git a/deployment/docker/build.sh b/deployment/docker/build.sh
new file mode 100644
index 000000000..b75cedc01
--- /dev/null
+++ b/deployment/docker/build.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+build_jellyfin_docker ../.. Dockerfile jellyfin:${VERSION} \ No newline at end of file
diff --git a/deployment/framework/build.sh b/deployment/framework/build.sh
new file mode 100644
index 000000000..4f2e6363e
--- /dev/null
+++ b/deployment/framework/build.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+#Magic word framework will create a non self contained build
+build_jellyfin ../../Jellyfin.Server Release framework `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/framework/clean.sh b/deployment/framework/clean.sh
new file mode 100644
index 000000000..3df2d7796
--- /dev/null
+++ b/deployment/framework/clean.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/framework/package.sh b/deployment/framework/package.sh
new file mode 100644
index 000000000..13b943ea8
--- /dev/null
+++ b/deployment/framework/package.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+package_portable ../.. `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/linux-x64/build.sh b/deployment/linux-x64/build.sh
new file mode 100644
index 000000000..1f0fb62d3
--- /dev/null
+++ b/deployment/linux-x64/build.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+build_jellyfin ../../Jellyfin.Server Release linux-x64 `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/linux-x64/clean.sh b/deployment/linux-x64/clean.sh
new file mode 100644
index 000000000..3df2d7796
--- /dev/null
+++ b/deployment/linux-x64/clean.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/linux-x64/package.sh b/deployment/linux-x64/package.sh
new file mode 100644
index 000000000..13b943ea8
--- /dev/null
+++ b/deployment/linux-x64/package.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+package_portable ../.. `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/osx-x64/build.sh b/deployment/osx-x64/build.sh
new file mode 100644
index 000000000..d6bfb9f5e
--- /dev/null
+++ b/deployment/osx-x64/build.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+build_jellyfin ../../Jellyfin.Server Release osx-x64 `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/osx-x64/clean.sh b/deployment/osx-x64/clean.sh
new file mode 100644
index 000000000..3df2d7796
--- /dev/null
+++ b/deployment/osx-x64/clean.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/osx-x64/package.sh b/deployment/osx-x64/package.sh
new file mode 100644
index 000000000..13b943ea8
--- /dev/null
+++ b/deployment/osx-x64/package.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+package_portable ../.. `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/ubuntu-x64/build.sh b/deployment/ubuntu-x64/build.sh
new file mode 100644
index 000000000..870bac780
--- /dev/null
+++ b/deployment/ubuntu-x64/build.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+build_jellyfin ../../Jellyfin.Server Release ubuntu-x64 `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/ubuntu-x64/clean.sh b/deployment/ubuntu-x64/clean.sh
new file mode 100644
index 000000000..3df2d7796
--- /dev/null
+++ b/deployment/ubuntu-x64/clean.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/ubuntu-x64/package.sh b/deployment/ubuntu-x64/package.sh
new file mode 100644
index 000000000..13b943ea8
--- /dev/null
+++ b/deployment/ubuntu-x64/package.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+package_portable ../.. `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/unraid/docker-templates/README.md b/deployment/unraid/docker-templates/README.md
new file mode 100644
index 000000000..2c268e8b3
--- /dev/null
+++ b/deployment/unraid/docker-templates/README.md
@@ -0,0 +1,15 @@
+# docker-templates
+
+### Installation:
+
+Open unRaid GUI (at least unRaid 6.5)
+
+Click on the Docker tab
+
+Add the following line under "Template Repositories"
+
+https://github.com/jellyfin/jellyfin/blob/master/deployment/unraid/docker-templates
+
+Click save than click on Add Container and select jellyfin.
+
+Adjust to your paths to your liking and off you go!
diff --git a/deployment/unraid/docker-templates/jellyfin.xml b/deployment/unraid/docker-templates/jellyfin.xml
new file mode 100644
index 000000000..be1188424
--- /dev/null
+++ b/deployment/unraid/docker-templates/jellyfin.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Containers>
+ <TemplateURL>https://raw.githubusercontent.com/jellyfin/jellyfin/deployment/unraid/docker-templates/jellyfin.xml</TemplateURL>
+ <Beta>False</Beta>
+ <Category>MediaApp:Video MediaApp:Music MediaApp:Photos MediaServer:Video MediaServer:Music MediaServer:Photos</Category>
+ <Name>JellyFin</Name>
+ <Description>
+ JellyFin is The Free Software Media Browser Converted By Community Applications Always verify this template (and values) against the dockerhub support page for the container!![br][br]
+ You can add as many mount points as needed for recordings, movies ,etc. [br][br]
+ [b][span style='color: #E80000;']Directions:[/span][/b][br]
+ [b]/config[/b] : this is where Jellyfin will store it's databases and configuration.[br][br]
+ [b]Port[/b] : This is the default port for Jellyfin. (Will add ssl port later)[br][br]
+ [b]Media[/b] : This is the mounting point of your media. When you access it in Jellyfin it will be /media or whatever you chose for a mount point
+ [b]Tip:[/b] You can add more volume mappings if you wish Jellyfin has access to it.
+ </Description>
+ <Overview>
+ Jellyfin Server is a home media server built on top of other popular open source technologies such as Service Stack, jQuery, jQuery mobile, and Mono and will remain completely free!
+ </Overview>
+ <Support>https://www.reddit.com/r/jellyfin/</Support>
+ <Registry>https://hub.docker.com/r/jellyfin/jellyfin/</Registry>
+ <GitHub>https://github.com/jellyfin/jellyfin/></GitHub>
+ <Repository>jellyfin/jellyfin</Repository>
+ <Project>https://jellyfin.media/</Project>
+ <BindTime>true</BindTime>
+ <Privileged>false</Privileged>
+ <Networking>
+ <Mode>host</Mode>
+ <Publish>
+ <Port>
+ <HostPort>8096</HostPort>
+ <ContainerPort>8096</ContainerPort>
+ <Protocol>tcp</Protocol>
+ </Port>
+ </Publish>
+ </Networking>
+ <Data>
+ <Volume>
+ <HostDir>/mnt/cache/appdata/config</HostDir>
+ <ContainerDir>/config</ContainerDir>
+ <Mode>rw</Mode>
+ </Volume>
+ <Volume>
+ <HostDir>/mnt/user</HostDir>
+ <ContainerDir>/media</ContainerDir>
+ <Mode>rw</Mode>
+ </Volume>
+ </Data>
+ <WebUI>http://[IP]:[PORT:8096]/</WebUI>
+ <Icon>https://raw.githubusercontent.com/binhex/docker-templates/master/binhex/images/emby-icon.png</Icon>
+ <ExtraParams></ExtraParams>
+</Containers>
diff --git a/build-jellyfin.ps1 b/deployment/win-generic/build-jellyfin.ps1
index 224716621..4f0f92525 100644
--- a/build-jellyfin.ps1
+++ b/deployment/win-generic/build-jellyfin.ps1
@@ -1,110 +1,110 @@
-[CmdletBinding()]
-param(
- [switch]$InstallFFMPEG,
- [switch]$InstallNSSM,
- [switch]$GenerateZip,
- [string]$InstallLocation = "$Env:AppData/Jellyfin-Server/",
- [ValidateSet('Debug','Release')][string]$BuildType = 'Release',
- [ValidateSet('Quiet','Minimal', 'Normal')][string]$DotNetVerbosity = 'Minimal',
- [ValidateSet('win','win7', 'win8','win81','win10')][string]$WindowsVersion = 'win',
- [ValidateSet('x64','x86', 'arm', 'arm64')][string]$Architecture = 'x64'
-)
-
-#PowershellCore and *nix check to make determine which temp dir to use.
-if(($PSVersionTable.PSEdition -eq 'Core') -and (-not $IsWindows)){
- $TempDir = mktemp -d
-}else{
- $TempDir = $env:Temp
-}
-
-function Build-JellyFin {
- if(($Architecture -eq 'arm64') -and ($WindowsVersion -ne 'win10')){
- Write-Error "arm64 only supported with Windows10 Version"
- exit
- }
- if(($Architecture -eq 'arm') -and ($WindowsVersion -notin @('win10','win81','win8'))){
- Write-Error "arm only supported with Windows 8 or higher"
- exit
- }
- dotnet publish -c $BuildType -r "$windowsversion-$Architecture" MediaBrowser.sln -o $InstallLocation -v $DotNetVerbosity
-}
-
-function Install-FFMPEG {
- param(
- [string]$InstallLocation,
- [string]$Architecture
- )
- Write-Verbose "Checking Architecture"
- if($Architecture -notin @('x86','x64')){
- Write-Warning "No builds available for your selected architecture of $Architecture"
- Write-Warning "FFMPEG will not be installed"
- }elseif($Architecture -eq 'x64'){
- Write-Verbose "Downloading 64 bit FFMPEG"
- Invoke-WebRequest -Uri https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-4.1-win64-static.zip -UseBasicParsing -OutFile "$tempdir/fmmpeg.zip" | Write-Verbose
- }else{
- Write-Verbose "Downloading 32 bit FFMPEG"
- Invoke-WebRequest -Uri https://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-4.1-win32-static.zip -UseBasicParsing -OutFile "$tempdir/fmmpeg.zip" | Write-Verbose
- }
-
- Expand-Archive "$tempdir/fmmpeg.zip" -DestinationPath "$tempdir/ffmpeg/" | Write-Verbose
- if($Architecture -eq 'x64'){
- Write-Verbose "Copying Binaries to Jellyfin location"
- Get-ChildItem "$tempdir/ffmpeg/ffmpeg-4.1-win64-static/bin" | ForEach-Object {
- Copy-Item $_.FullName -Destination $installLocation | Write-Verbose
- }
- }else{
- Write-Verbose "Copying Binaries to Jellyfin location"
- Get-ChildItem "$tempdir/ffmpeg/ffmpeg-4.1-win32-static/bin" | ForEach-Object {
- Copy-Item $_.FullName -Destination $installLocation | Write-Verbose
- }
- }
- Remove-Item "$tempdir/ffmpeg/" -Recurse -Force -ErrorAction Continue | Write-Verbose
- Remove-Item "$tempdir/fmmpeg.zip" -Force -ErrorAction Continue | Write-Verbose
-}
-
-function Install-NSSM {
- param(
- [string]$InstallLocation,
- [string]$Architecture
- )
- Write-Verbose "Checking Architecture"
- if($Architecture -notin @('x86','x64')){
- Write-Warning "No builds available for your selected architecture of $Architecture"
- Write-Warning "NSSM will not be installed"
- }else{
- Write-Verbose "Downloading NSSM"
- Invoke-WebRequest -Uri https://nssm.cc/ci/nssm-2.24-101-g897c7ad.zip -UseBasicParsing -OutFile "$tempdir/nssm.zip" | Write-Verbose
- }
-
- Expand-Archive "$tempdir/nssm.zip" -DestinationPath "$tempdir/nssm/" | Write-Verbose
- if($Architecture -eq 'x64'){
- Write-Verbose "Copying Binaries to Jellyfin location"
- Get-ChildItem "$tempdir/nssm/nssm-2.24-101-g897c7ad/win64" | ForEach-Object {
- Copy-Item $_.FullName -Destination $installLocation | Write-Verbose
- }
- }else{
- Write-Verbose "Copying Binaries to Jellyfin location"
- Get-ChildItem "$tempdir/nssm/nssm-2.24-101-g897c7ad/win32" | ForEach-Object {
- Copy-Item $_.FullName -Destination $installLocation | Write-Verbose
- }
- }
- Remove-Item "$tempdir/nssm/" -Recurse -Force -ErrorAction Continue | Write-Verbose
- Remove-Item "$tempdir/nssm.zip" -Force -ErrorAction Continue | Write-Verbose
-}
-
-Write-Verbose "Starting Build Process: Selected Environment is $WindowsVersion-$Architecture"
-Build-JellyFin
-if($InstallFFMPEG.IsPresent -or ($InstallFFMPEG -eq $true)){
- Write-Verbose "Starting FFMPEG Install"
- Install-FFMPEG $InstallLocation $Architecture
-}
-if($InstallNSSM.IsPresent -or ($InstallNSSM -eq $true)){
- Write-Verbose "Starting NSSM Install"
- Install-NSSM $InstallLocation $Architecture
-}
-Copy-Item .\install-jellyfin.ps1 $InstallLocation\install-jellyfin.ps1
-Copy-Item .\install.bat $InstallLocation\install.bat
-if($GenerateZip.IsPresent -or ($GenerateZip -eq $true)){
- Compress-Archive -Path $InstallLocation -DestinationPath "$InstallLocation/jellyfin.zip" -Force
-}
-Write-Verbose "Finished"
+[CmdletBinding()]
+param(
+ [switch]$InstallFFMPEG,
+ [switch]$InstallNSSM,
+ [switch]$GenerateZip,
+ [string]$InstallLocation = "$Env:AppData/Jellyfin-Server/",
+ [ValidateSet('Debug','Release')][string]$BuildType = 'Release',
+ [ValidateSet('Quiet','Minimal', 'Normal')][string]$DotNetVerbosity = 'Minimal',
+ [ValidateSet('win','win7', 'win8','win81','win10')][string]$WindowsVersion = 'win',
+ [ValidateSet('x64','x86', 'arm', 'arm64')][string]$Architecture = 'x64'
+)
+
+#PowershellCore and *nix check to make determine which temp dir to use.
+if(($PSVersionTable.PSEdition -eq 'Core') -and (-not $IsWindows)){
+ $TempDir = mktemp -d
+}else{
+ $TempDir = $env:Temp
+}
+
+function Build-JellyFin {
+ if(($Architecture -eq 'arm64') -and ($WindowsVersion -ne 'win10')){
+ Write-Error "arm64 only supported with Windows10 Version"
+ exit
+ }
+ if(($Architecture -eq 'arm') -and ($WindowsVersion -notin @('win10','win81','win8'))){
+ Write-Error "arm only supported with Windows 8 or higher"
+ exit
+ }
+ dotnet publish -c $BuildType -r "$windowsversion-$Architecture" MediaBrowser.sln -o $InstallLocation -v $DotNetVerbosity
+}
+
+function Install-FFMPEG {
+ param(
+ [string]$InstallLocation,
+ [string]$Architecture
+ )
+ Write-Verbose "Checking Architecture"
+ if($Architecture -notin @('x86','x64')){
+ Write-Warning "No builds available for your selected architecture of $Architecture"
+ Write-Warning "FFMPEG will not be installed"
+ }elseif($Architecture -eq 'x64'){
+ Write-Verbose "Downloading 64 bit FFMPEG"
+ Invoke-WebRequest -Uri https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-4.1-win64-static.zip -UseBasicParsing -OutFile "$tempdir/fmmpeg.zip" | Write-Verbose
+ }else{
+ Write-Verbose "Downloading 32 bit FFMPEG"
+ Invoke-WebRequest -Uri https://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-4.1-win32-static.zip -UseBasicParsing -OutFile "$tempdir/fmmpeg.zip" | Write-Verbose
+ }
+
+ Expand-Archive "$tempdir/fmmpeg.zip" -DestinationPath "$tempdir/ffmpeg/" | Write-Verbose
+ if($Architecture -eq 'x64'){
+ Write-Verbose "Copying Binaries to Jellyfin location"
+ Get-ChildItem "$tempdir/ffmpeg/ffmpeg-4.1-win64-static/bin" | ForEach-Object {
+ Copy-Item $_.FullName -Destination $installLocation | Write-Verbose
+ }
+ }else{
+ Write-Verbose "Copying Binaries to Jellyfin location"
+ Get-ChildItem "$tempdir/ffmpeg/ffmpeg-4.1-win32-static/bin" | ForEach-Object {
+ Copy-Item $_.FullName -Destination $installLocation | Write-Verbose
+ }
+ }
+ Remove-Item "$tempdir/ffmpeg/" -Recurse -Force -ErrorAction Continue | Write-Verbose
+ Remove-Item "$tempdir/fmmpeg.zip" -Force -ErrorAction Continue | Write-Verbose
+}
+
+function Install-NSSM {
+ param(
+ [string]$InstallLocation,
+ [string]$Architecture
+ )
+ Write-Verbose "Checking Architecture"
+ if($Architecture -notin @('x86','x64')){
+ Write-Warning "No builds available for your selected architecture of $Architecture"
+ Write-Warning "NSSM will not be installed"
+ }else{
+ Write-Verbose "Downloading NSSM"
+ Invoke-WebRequest -Uri https://nssm.cc/ci/nssm-2.24-101-g897c7ad.zip -UseBasicParsing -OutFile "$tempdir/nssm.zip" | Write-Verbose
+ }
+
+ Expand-Archive "$tempdir/nssm.zip" -DestinationPath "$tempdir/nssm/" | Write-Verbose
+ if($Architecture -eq 'x64'){
+ Write-Verbose "Copying Binaries to Jellyfin location"
+ Get-ChildItem "$tempdir/nssm/nssm-2.24-101-g897c7ad/win64" | ForEach-Object {
+ Copy-Item $_.FullName -Destination $installLocation | Write-Verbose
+ }
+ }else{
+ Write-Verbose "Copying Binaries to Jellyfin location"
+ Get-ChildItem "$tempdir/nssm/nssm-2.24-101-g897c7ad/win32" | ForEach-Object {
+ Copy-Item $_.FullName -Destination $installLocation | Write-Verbose
+ }
+ }
+ Remove-Item "$tempdir/nssm/" -Recurse -Force -ErrorAction Continue | Write-Verbose
+ Remove-Item "$tempdir/nssm.zip" -Force -ErrorAction Continue | Write-Verbose
+}
+
+Write-Verbose "Starting Build Process: Selected Environment is $WindowsVersion-$Architecture"
+Build-JellyFin
+if($InstallFFMPEG.IsPresent -or ($InstallFFMPEG -eq $true)){
+ Write-Verbose "Starting FFMPEG Install"
+ Install-FFMPEG $InstallLocation $Architecture
+}
+if($InstallNSSM.IsPresent -or ($InstallNSSM -eq $true)){
+ Write-Verbose "Starting NSSM Install"
+ Install-NSSM $InstallLocation $Architecture
+}
+Copy-Item .\install-jellyfin.ps1 $InstallLocation\install-jellyfin.ps1
+Copy-Item .\install.bat $InstallLocation\install.bat
+if($GenerateZip.IsPresent -or ($GenerateZip -eq $true)){
+ Compress-Archive -Path $InstallLocation -DestinationPath "$InstallLocation/jellyfin.zip" -Force
+}
+Write-Verbose "Finished"
diff --git a/install-jellyfin.ps1 b/deployment/win-generic/install-jellyfin.ps1
index 56c098462..56c098462 100644
--- a/install-jellyfin.ps1
+++ b/deployment/win-generic/install-jellyfin.ps1
diff --git a/install.bat b/deployment/win-generic/install.bat
index e21479a79..e21479a79 100644
--- a/install.bat
+++ b/deployment/win-generic/install.bat
diff --git a/deployment/win-x64/build.sh b/deployment/win-x64/build.sh
new file mode 100644
index 000000000..0b3046203
--- /dev/null
+++ b/deployment/win-x64/build.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+build_jellyfin ../../Jellyfin.Server Release win-x64 `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/win-x64/clean.sh b/deployment/win-x64/clean.sh
new file mode 100644
index 000000000..3df2d7796
--- /dev/null
+++ b/deployment/win-x64/clean.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/win-x64/package.sh b/deployment/win-x64/package.sh
new file mode 100644
index 000000000..e8410e8c2
--- /dev/null
+++ b/deployment/win-x64/package.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+package_portable ../.. `pwd`/dist/jellyfin_${VERSION}
+
+#TODO setup and maybe change above code to produce the Windows native zip format.
diff --git a/deployment/win-x86/build.sh b/deployment/win-x86/build.sh
new file mode 100644
index 000000000..610db356a
--- /dev/null
+++ b/deployment/win-x86/build.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+build_jellyfin ../../Jellyfin.Server Release win-x86 `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/win-x86/clean.sh b/deployment/win-x86/clean.sh
new file mode 100644
index 000000000..3df2d7796
--- /dev/null
+++ b/deployment/win-x86/clean.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION}
diff --git a/deployment/win-x86/package.sh b/deployment/win-x86/package.sh
new file mode 100644
index 000000000..e8410e8c2
--- /dev/null
+++ b/deployment/win-x86/package.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+source ../common.build.sh
+
+VERSION=`get_version ../..`
+
+package_portable ../.. `pwd`/dist/jellyfin_${VERSION}
+
+#TODO setup and maybe change above code to produce the Windows native zip format.