From 469a17b3ca6e4e9a032cfe66010e65cc66d27f33 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Wed, 20 Feb 2019 20:36:49 -0500 Subject: [PATCH 01/12] Install the dotnet runtime too This is needed since /usr/bin/dotnet doesn't exist in the SDK package for whatever reason as of Feb 18 2019. --- deployment/fedora-package-x64/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/fedora-package-x64/Dockerfile b/deployment/fedora-package-x64/Dockerfile index 8bb1d527d..397c944ea 100644 --- a/deployment/fedora-package-x64/Dockerfile +++ b/deployment/fedora-package-x64/Dockerfile @@ -13,7 +13,7 @@ RUN dnf update -y \ && dnf install -y @buildsys-build rpmdevtools dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel \ && dnf copr enable -y @dotnet-sig/dotnet \ && rpmdev-setuptree \ - && dnf install -y dotnet-sdk-${SDK_VERSION} \ + && dnf install -y dotnet-sdk-${SDK_VERSION} dotnet-runtime-${SDK_VERSION} \ && ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh \ && mkdir -p ${SOURCE_DIR}/SPECS \ && ln -s ${PLATFORM_DIR}/pkg-src/jellyfin.spec ${SOURCE_DIR}/SPECS/jellyfin.spec \ From 1bc2b12ee3cdb6180cd6159840255fa32d23824f Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Thu, 21 Feb 2019 01:30:51 -0500 Subject: [PATCH 02/12] dotnet-runtime is needed in Fedora RPM build also --- deployment/fedora-package-x64/pkg-src/jellyfin.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin.spec b/deployment/fedora-package-x64/pkg-src/jellyfin.spec index 146486428..451a304b7 100644 --- a/deployment/fedora-package-x64/pkg-src/jellyfin.spec +++ b/deployment/fedora-package-x64/pkg-src/jellyfin.spec @@ -8,7 +8,7 @@ Name: jellyfin Version: 10.2.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Free Software Media Browser License: GPLv2 URL: https://jellyfin.media @@ -27,7 +27,7 @@ BuildRequires: libcurl-devel, fontconfig-devel, freetype-devel, openssl-devel, Requires: libcurl, fontconfig, freetype, openssl, glibc libicu # Requirements not packaged in main repos # COPR @dotnet-sig/dotnet -BuildRequires: dotnet-sdk-2.2 +BuildRequires: dotnet-runtime-2.2, dotnet-sdk-2.2 # RPMfusion free Requires: ffmpeg @@ -140,6 +140,9 @@ fi %systemd_postun_with_restart jellyfin.service %changelog +* Thu Feb 21 2019 Brian J. Murrell +- jellyfin: +- dotnet seems to have moved to dotnet-runtime * Wed Feb 20 2019 Jellyfin Packaging Team - jellyfin: - PR920 Fix cachedir missing from Docker container From f03e279382e9767d8d2702ad69a8e729a85d26f1 Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Thu, 14 Feb 2019 22:07:46 -0500 Subject: [PATCH 03/12] COPR auto building This adds enhancements so that Fedora/EL packages can be automatically built in COPR when a webhook is received. A typical webhook could be for tagging events for example or even a "Release" webhook to only build releases. --- .copr/Makefile | 8 +++ .../fedora-package-x64/create_tarball.sh | 55 +++++++++++++++++++ deployment/fedora-package-x64/package.sh | 47 +--------------- .../fedora-package-x64/pkg-src/jellyfin.spec | 1 + 4 files changed, 65 insertions(+), 46 deletions(-) create mode 100644 .copr/Makefile create mode 100755 deployment/fedora-package-x64/create_tarball.sh diff --git a/.copr/Makefile b/.copr/Makefile new file mode 100644 index 000000000..84b98a011 --- /dev/null +++ b/.copr/Makefile @@ -0,0 +1,8 @@ +srpm: + dnf -y install git + git submodule update --init --recursive + cd deployment/fedora-package-x64; \ + ./create_tarball.sh; \ + rpmbuild -bs pkg-src/jellyfin.spec \ + --define "_sourcedir $$PWD/pkg-src/" \ + --define "_srcrpmdir $(outdir)" diff --git a/deployment/fedora-package-x64/create_tarball.sh b/deployment/fedora-package-x64/create_tarball.sh new file mode 100755 index 000000000..e8301c989 --- /dev/null +++ b/deployment/fedora-package-x64/create_tarball.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash + +# shellcheck disable=SC1091 +source ../common.build.sh + +WORKDIR="$( pwd )" +VERSION="$( sed -ne '/^Version:/s/.* *//p' "${WORKDIR}"/pkg-src/jellyfin.spec )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +pkg_src_dir="${WORKDIR}/pkg-src" + +GNU_TAR=1 +echo "Bundling all sources for RPM build." +tar \ +--transform "s,^\.,jellyfin-${VERSION}," \ +--exclude='.git*' \ +--exclude='**/.git' \ +--exclude='**/.hg' \ +--exclude='**/.vs' \ +--exclude='**/.vscode' \ +--exclude='deployment' \ +--exclude='**/bin' \ +--exclude='**/obj' \ +--exclude='**/.nuget' \ +--exclude='*.deb' \ +--exclude='*.rpm' \ +-czf "$pkg_src_dir/jellyfin-${VERSION}.tar.gz" \ +-C "../.." ./ || GNU_TAR=0 + +if [ $GNU_TAR -eq 0 ]; then + echo "The installed tar binary did not support --transform. Using workaround." + mkdir -p "${package_temporary_dir}/jellyfin"{,-"${VERSION}"} + # Not GNU tar + tar \ + --exclude='.git*' \ + --exclude='**/.git' \ + --exclude='**/.hg' \ + --exclude='**/.vs' \ + --exclude='**/.vscode' \ + --exclude='deployment' \ + --exclude='**/bin' \ + --exclude='**/obj' \ + --exclude='**/.nuget' \ + --exclude='*.deb' \ + --exclude='*.rpm' \ + -zcf \ + "${package_temporary_dir}/jellyfin/jellyfin-${VERSION}.tar.gz" \ + -C "../.." ./ + echo "Extracting filtered package." + tar -xzf "${package_temporary_dir}/jellyfin/jellyfin-${VERSION}.tar.gz" -C "${package_temporary_dir}/jellyfin-${VERSION}" + echo "Removing filtered package." + rm -f "${package_temporary_dir}/jellyfin/jellyfin-${VERSION}.tar.gz" + echo "Repackaging package into final tarball." + tar -czf "${pkg_src_dir}/jellyfin-${VERSION}.tar.gz" -C "${package_temporary_dir}" "jellyfin-${VERSION}" +fi diff --git a/deployment/fedora-package-x64/package.sh b/deployment/fedora-package-x64/package.sh index 74586417d..eed29aef3 100755 --- a/deployment/fedora-package-x64/package.sh +++ b/deployment/fedora-package-x64/package.sh @@ -21,52 +21,7 @@ else docker_sudo="" fi -# Create RPM source archive -GNU_TAR=1 -mkdir -p "${package_temporary_dir}" -echo "Bundling all sources for RPM build." -tar \ ---transform "s,^\.,jellyfin-${VERSION}," \ ---exclude='.git*' \ ---exclude='**/.git' \ ---exclude='**/.hg' \ ---exclude='**/.vs' \ ---exclude='**/.vscode' \ ---exclude='deployment' \ ---exclude='**/bin' \ ---exclude='**/obj' \ ---exclude='**/.nuget' \ ---exclude='*.deb' \ ---exclude='*.rpm' \ --czf "${pkg_src_dir}/jellyfin-${VERSION}.tar.gz" \ --C "../.." ./ || GNU_TAR=0 - -if [ $GNU_TAR -eq 0 ]; then - echo "The installed tar binary did not support --transform. Using workaround." - mkdir -p "${package_temporary_dir}/jellyfin" - # Not GNU tar - tar \ - --exclude='.git*' \ - --exclude='**/.git' \ - --exclude='**/.hg' \ - --exclude='**/.vs' \ - --exclude='**/.vscode' \ - --exclude='deployment' \ - --exclude='**/bin' \ - --exclude='**/obj' \ - --exclude='**/.nuget' \ - --exclude='*.deb' \ - --exclude='*.rpm' \ - -zcf \ - "${package_temporary_dir}/jellyfin/jellyfin-${VERSION}.tar.gz" \ - -C "../.." ./ - echo "Extracting filtered package." - tar -xzf "${package_temporary_dir}/jellyfin/jellyfin-${VERSION}.tar.gz" -C "${package_temporary_dir}/jellyfin-${VERSION}" - echo "Removing filtered package." - rm -f "${package_temporary_dir}/jellyfin/jellyfin-${VERSION}.tar.gz" - echo "Repackaging package into final tarball." - tar -czf "${pkg_src_dir}/jellyfin-${VERSION}.tar.gz" -C "${package_temporary_dir}" "jellyfin-${VERSION}" -fi +./create_tarball.sh # Set up the build environment Docker image ${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin.spec b/deployment/fedora-package-x64/pkg-src/jellyfin.spec index 451a304b7..cfe4212a0 100644 --- a/deployment/fedora-package-x64/pkg-src/jellyfin.spec +++ b/deployment/fedora-package-x64/pkg-src/jellyfin.spec @@ -143,6 +143,7 @@ fi * Thu Feb 21 2019 Brian J. Murrell - jellyfin: - dotnet seems to have moved to dotnet-runtime +- COPR auto-build * Wed Feb 20 2019 Jellyfin Packaging Team - jellyfin: - PR920 Fix cachedir missing from Docker container From c2e57aba27e883e0418c9c50fc9323380e67aa33 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 23 Feb 2019 20:07:05 -0500 Subject: [PATCH 04/12] Add Debian armhf (Rasberry Pi) build plus crossbuild --- .../debian-package-armhf/Dockerfile.amd64 | 42 +++++++++++++++++++ .../debian-package-armhf/Dockerfile.armhf | 34 +++++++++++++++ deployment/debian-package-armhf/clean.sh | 29 +++++++++++++ .../debian-package-armhf/dependencies.txt | 1 + .../debian-package-armhf/docker-build.sh | 20 +++++++++ deployment/debian-package-armhf/package.sh | 42 +++++++++++++++++++ deployment/debian-package-armhf/pkg-src | 1 + deployment/debian-package-x64/pkg-src/rules | 18 +++++++- 8 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 deployment/debian-package-armhf/Dockerfile.amd64 create mode 100644 deployment/debian-package-armhf/Dockerfile.armhf create mode 100755 deployment/debian-package-armhf/clean.sh create mode 100644 deployment/debian-package-armhf/dependencies.txt create mode 100755 deployment/debian-package-armhf/docker-build.sh create mode 100755 deployment/debian-package-armhf/package.sh create mode 120000 deployment/debian-package-armhf/pkg-src diff --git a/deployment/debian-package-armhf/Dockerfile.amd64 b/deployment/debian-package-armhf/Dockerfile.amd64 new file mode 100644 index 000000000..0d62352e0 --- /dev/null +++ b/deployment/debian-package-armhf/Dockerfile.amd64 @@ -0,0 +1,42 @@ +FROM debian:9 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-armhf +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=2.2 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/69937b49-a877-4ced-81e6-286620b390ab/8ab938cf6f5e83b2221630354160ef21/dotnet-sdk-2.2.104-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Prepare the cross-toolchain +RUN dpkg --add-architecture armhf \ + && apt-get update \ + && apt-get install -y cross-gcc-dev \ + && TARGET_LIST="armhf" cross-gcc-gensource 6 \ + && cd cross-gcc-packages-amd64/cross-gcc-6-armhf \ + && apt-get install -y gcc-6-source libstdc++6-armhf-cross binutils-arm-linux-gnueabihf bison flex libtool gdb sharutils netbase libcloog-isl-dev libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:armhf linux-libc-dev:armhf libgcc1:armhf libcurl4-openssl-dev:armhf libfontconfig1-dev:armhf libfreetype6-dev:armhf liblttng-ust0:armhf libstdc++6:armhf + +# Link to docker-build script +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh + +# Link to Debian source dir; mkdir needed or it fails, can't force dest +RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/debian-package-armhf/Dockerfile.armhf b/deployment/debian-package-armhf/Dockerfile.armhf new file mode 100644 index 000000000..eb4152116 --- /dev/null +++ b/deployment/debian-package-armhf/Dockerfile.armhf @@ -0,0 +1,34 @@ +FROM debian:9 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-armhf +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=2.2 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=armhf + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev liblttng-ust0 + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d9f37b73-df8d-4dfa-a905-b7648d3401d0/6312573ac13d7a8ddc16e4058f7d7dc5/dotnet-sdk-2.2.104-linux-arm.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Link to docker-build script +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh + +# Link to Debian source dir; mkdir needed or it fails, can't force dest +RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/debian-package-armhf/clean.sh b/deployment/debian-package-armhf/clean.sh new file mode 100755 index 000000000..3898110af --- /dev/null +++ b/deployment/debian-package-armhf/clean.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +keep_artifacts="${1}" + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-debian_armhf-build" + +rm -rf "${package_temporary_dir}" &>/dev/null \ + || sudo rm -rf "${package_temporary_dir}" &>/dev/null + +rm -rf "${output_dir}" &>/dev/null \ + || sudo rm -rf "${output_dir}" &>/dev/null + +if [[ ${keep_artifacts} == 'n' ]]; then + docker_sudo="" + if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo=sudo + fi + ${docker_sudo} docker image rm ${image_name} --force +fi diff --git a/deployment/debian-package-armhf/dependencies.txt b/deployment/debian-package-armhf/dependencies.txt new file mode 100644 index 000000000..bdb967096 --- /dev/null +++ b/deployment/debian-package-armhf/dependencies.txt @@ -0,0 +1 @@ +docker diff --git a/deployment/debian-package-armhf/docker-build.sh b/deployment/debian-package-armhf/docker-build.sh new file mode 100755 index 000000000..45e68f0c6 --- /dev/null +++ b/deployment/debian-package-armhf/docker-build.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Builds the DEB inside the Docker container + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Remove build-dep for dotnet-sdk-2.2, since it's not a package in this image +sed -i '/dotnet-sdk-2.2,/d' debian/control + +# Build DEB +export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} +dpkg-buildpackage -us -uc -aarmhf + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/deb +mv /jellyfin_* ${ARTIFACT_DIR}/deb/ diff --git a/deployment/debian-package-armhf/package.sh b/deployment/debian-package-armhf/package.sh new file mode 100755 index 000000000..0ec0dc95c --- /dev/null +++ b/deployment/debian-package-armhf/package.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +ARCH="$( arch )" +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-debian_armhf-build" + +# Determine if sudo should be used for Docker +if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo="sudo" +else + docker_sudo="" +fi + +# Determine which Dockerfile to use +case $ARCH in + 'x86_64') + DOCKERFILE="Dockerfile.amd64" + ;; + 'armv7l') + DOCKERFILE="Dockerfile.armhf" + ;; +esac + +# Set up the build environment Docker image +${docker_sudo} docker build ../.. -t "${image_name}" -f ./${DOCKERFILE} +# Build the DEBs and copy out to ${package_temporary_dir} +${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" +# Correct ownership on the DEBs (as current user, then as root if that fails) +chown -R "${current_user}" "${package_temporary_dir}" &>/dev/null \ + || sudo chown -R "${current_user}" "${package_temporary_dir}" &>/dev/null +# Move the DEBs to the output directory +mkdir -p "${output_dir}" +mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/debian-package-armhf/pkg-src b/deployment/debian-package-armhf/pkg-src new file mode 120000 index 000000000..4c695fea1 --- /dev/null +++ b/deployment/debian-package-armhf/pkg-src @@ -0,0 +1 @@ +../debian-package-x64/pkg-src \ No newline at end of file diff --git a/deployment/debian-package-x64/pkg-src/rules b/deployment/debian-package-x64/pkg-src/rules index ce98cb8f8..15cbefa4e 100644 --- a/deployment/debian-package-x64/pkg-src/rules +++ b/deployment/debian-package-x64/pkg-src/rules @@ -2,7 +2,23 @@ CONFIG := Release TERM := xterm SHELL := /bin/bash -DOTNETRUNTIME := debian-x64 + +HOST_ARCH := $(shell arch) +BUILD_ARCH := ${DEB_HOST_MULTIARCH} +ifeq ($(HOST_ARCH),x86_64) + ifeq ($(BUILD_ARCH),arm-linux-gnueabihf) + # Cross-building ARM on AMD64 + DOTNETRUNTIME := debian-arm + else + # Building AMD64 + DOTNETRUNTIME := debian-x64 + endif +endif +ifeq ($(HOST_ARCH),armv7l) + # Building ARM + DOTNETRUNTIME := debian-arm +endif + export DH_VERBOSE=1 export DOTNET_CLI_TELEMETRY_OPTOUT=1 From da61998ad611bf25d5644223a82eed1cf2e3d835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCttner?= Date: Fri, 22 Feb 2019 13:52:32 +0100 Subject: [PATCH 05/12] Build releases without debug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Büttner --- Dockerfile | 1 + Dockerfile.arm | 1 + Dockerfile.arm64 | 1 + deployment/common.build.sh | 4 ++-- deployment/debian-package-x64/pkg-src/rules | 3 ++- deployment/fedora-package-x64/pkg-src/jellyfin.spec | 4 ++-- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 978b0d540..af570ba65 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 RUN dotnet publish \ --configuration release \ --output /jellyfin \ + "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" \ Jellyfin.Server FROM jellyfin/ffmpeg as ffmpeg diff --git a/Dockerfile.arm b/Dockerfile.arm index 9d1c30619..9316245c5 100644 --- a/Dockerfile.arm +++ b/Dockerfile.arm @@ -21,6 +21,7 @@ RUN dotnet publish \ -r linux-arm \ --configuration release \ --output /jellyfin \ + "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" \ Jellyfin.Server diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index e61aaa167..5c67f85c9 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -22,6 +22,7 @@ RUN dotnet publish \ -r linux-arm64 \ --configuration release \ --output /jellyfin \ + "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" \ Jellyfin.Server diff --git a/deployment/common.build.sh b/deployment/common.build.sh index c191ec2a1..5bffa1a73 100755 --- a/deployment/common.build.sh +++ b/deployment/common.build.sh @@ -36,9 +36,9 @@ build_jellyfin() 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}" + dotnet publish "${ROOT}" --configuration "${CONFIG}" --output="${OUTPUT_DIR}" "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" else - dotnet publish "${ROOT}" --configuration "${CONFIG}" --output="${OUTPUT_DIR}" --self-contained --runtime ${DOTNETRUNTIME} + dotnet publish "${ROOT}" --configuration "${CONFIG}" --output="${OUTPUT_DIR}" --self-contained --runtime ${DOTNETRUNTIME} "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" fi EXIT_CODE=$? if [ $EXIT_CODE -eq 0 ]; then diff --git a/deployment/debian-package-x64/pkg-src/rules b/deployment/debian-package-x64/pkg-src/rules index ce98cb8f8..646f3621f 100644 --- a/deployment/debian-package-x64/pkg-src/rules +++ b/deployment/debian-package-x64/pkg-src/rules @@ -16,7 +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) Jellyfin.Server + 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 diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin.spec b/deployment/fedora-package-x64/pkg-src/jellyfin.spec index 451a304b7..35045ee66 100644 --- a/deployment/fedora-package-x64/pkg-src/jellyfin.spec +++ b/deployment/fedora-package-x64/pkg-src/jellyfin.spec @@ -49,7 +49,8 @@ Jellyfin is a free software media system that puts you in control of managing an %install export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 -dotnet publish --configuration Release --output='%{buildroot}%{_libdir}/jellyfin' --self-contained --runtime %{dotnet_runtime} Jellyfin.Server +dotnet publish --configuration Release --output='%{buildroot}%{_libdir}/jellyfin' --self-contained --runtime %{dotnet_runtime} \ + "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" Jellyfin.Server %{__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 Jellyfin.Server/Resources/Configuration/logging.json %{buildroot}%{_sysconfdir}/%{name}/logging.json @@ -73,7 +74,6 @@ EOF %{_libdir}/%{name}/jellyfin-web/* %attr(755,root,root) %{_bindir}/%{name} %{_libdir}/%{name}/*.json -%{_libdir}/%{name}/*.pdb %{_libdir}/%{name}/*.dll %{_libdir}/%{name}/*.so %{_libdir}/%{name}/*.a From 38ec68c488c0c8e88989dc7c3fdc0824cfe71343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCttner?= Date: Sun, 24 Feb 2019 11:17:39 +0100 Subject: [PATCH 06/12] use common.build.sh for docker image builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Büttner --- Dockerfile | 7 ++----- Dockerfile.arm | 8 ++------ Dockerfile.arm64 | 8 ++------ deployment/common.build.sh | 3 +-- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index af570ba65..356268841 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,11 +4,8 @@ FROM microsoft/dotnet:${DOTNET_VERSION}-sdk as builder WORKDIR /repo COPY . . ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 -RUN dotnet publish \ - --configuration release \ - --output /jellyfin \ - "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" \ - Jellyfin.Server +RUN bash -c "source deployment/common.build.sh && \ + build_jellyfin Jellyfin.Server Release linux-x64 /jellyfin" FROM jellyfin/ffmpeg as ffmpeg FROM microsoft/dotnet:${DOTNET_VERSION}-runtime diff --git a/Dockerfile.arm b/Dockerfile.arm index 9316245c5..69c5d446e 100644 --- a/Dockerfile.arm +++ b/Dockerfile.arm @@ -17,12 +17,8 @@ RUN find . -type f -exec sed -i 's/netcoreapp2.1/netcoreapp3.0/g' {} \; # Discard objs - may cause failures if exists RUN find . -type d -name obj | xargs -r rm -r # Build -RUN dotnet publish \ - -r linux-arm \ - --configuration release \ - --output /jellyfin \ - "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" \ - Jellyfin.Server +RUN bash -c "source deployment/common.build.sh && \ + build_jellyfin Jellyfin.Server Release linux-arm /jellyfin" FROM microsoft/dotnet:${DOTNET_VERSION}-runtime-stretch-slim-arm32v7 diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index 5c67f85c9..b85f8735b 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -18,12 +18,8 @@ RUN find . -type f -exec sed -i 's/netcoreapp2.1/netcoreapp3.0/g' {} \; # Discard objs - may cause failures if exists RUN find . -type d -name obj | xargs -r rm -r # Build -RUN dotnet publish \ - -r linux-arm64 \ - --configuration release \ - --output /jellyfin \ - "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" \ - Jellyfin.Server +RUN bash -c "source deployment/common.build.sh && \ + build_jellyfin Jellyfin.Server Release linux-arm64 /jellyfin" FROM microsoft/dotnet:${DOTNET_VERSION}-runtime-stretch-slim-arm64v8 diff --git a/deployment/common.build.sh b/deployment/common.build.sh index 5bffa1a73..d028e3a66 100755 --- a/deployment/common.build.sh +++ b/deployment/common.build.sh @@ -15,7 +15,6 @@ 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` DEFAULT_ARCHIVE_CMD="tar -xvzf" # Parse the version from the AssemblyVersion @@ -53,7 +52,7 @@ build_jellyfin_docker() ( BUILD_CONTEXT=${1-$DEFAULT_BUILD_CONTEXT} DOCKERFILE=${2-$DEFAULT_DOCKERFILE} - IMAGE_TAG=${3-$DEFAULT_IMAGE_TAG} + IMAGE_TAG=${3-"jellyfin:$(git rev-parse --abbrev-ref HEAD)"} echo -e "${CYAN}Building jellyfin docker image in '${BUILD_CONTEXT}' with Dockerfile '${DOCKERFILE}' and tag '${IMAGE_TAG}'.${NC}" docker build -t ${IMAGE_TAG} -f ${DOCKERFILE} ${BUILD_CONTEXT} From 2e9a3d45c2a03f930856d038867a7caff01f208f Mon Sep 17 00:00:00 2001 From: Claus Vium Date: Sun, 24 Feb 2019 16:16:53 +0100 Subject: [PATCH 07/12] Fix slow local image validation (#990) * Check for local image directory existence to avoid tons of exceptions --- MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs | 7 +++++++ MediaBrowser.Providers/Manager/MetadataService.cs | 5 +---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs b/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs index 1a7654bfd..7c330ad86 100644 --- a/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs +++ b/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Globalization; +using System.IO; using System.Linq; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Audio; @@ -65,6 +66,12 @@ namespace MediaBrowser.LocalMetadata.Images var path = item.ContainingFolderPath; + // Exit if the cache dir does not exist, alternative solution is to create it, but that's a lot of empty dirs... + if (!Directory.Exists(path)) + { + return Array.Empty(); + } + if (includeDirectories) { return directoryService.GetFileSystemEntries(path) diff --git a/MediaBrowser.Providers/Manager/MetadataService.cs b/MediaBrowser.Providers/Manager/MetadataService.cs index 77028e526..f0716f201 100644 --- a/MediaBrowser.Providers/Manager/MetadataService.cs +++ b/MediaBrowser.Providers/Manager/MetadataService.cs @@ -92,10 +92,7 @@ namespace MediaBrowser.Providers.Manager catch (Exception ex) { localImagesFailed = true; - if (!(item is IItemByName)) - { - Logger.LogError(ex, "Error validating images for {0}", item.Path ?? item.Name ?? "Unknown name"); - } + Logger.LogError(ex, "Error validating images for {0}", item.Path ?? item.Name ?? "Unknown name"); } var metadataResult = new MetadataResult From aafed63c3f635ccac82be41b5a8f272121397b79 Mon Sep 17 00:00:00 2001 From: Claus Vium Date: Sun, 24 Feb 2019 16:33:05 +0100 Subject: [PATCH 08/12] Set EnableRaisingEvents to true for processes that require it --- MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index d922f1068..7f29c06b4 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -694,7 +694,8 @@ namespace MediaBrowser.MediaEncoding.Encoder FileName = FFMpegPath, Arguments = args, IsHidden = true, - ErrorDialog = false + ErrorDialog = false, + EnableRaisingEvents = true }); _logger.LogDebug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments); @@ -816,7 +817,8 @@ namespace MediaBrowser.MediaEncoding.Encoder FileName = FFMpegPath, Arguments = args, IsHidden = true, - ErrorDialog = false + ErrorDialog = false, + EnableRaisingEvents = true }); _logger.LogInformation(process.StartInfo.FileName + " " + process.StartInfo.Arguments); From dac2c98d8aebe9e18c7b6631921bba7676f74daf Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sun, 24 Feb 2019 23:20:04 -0500 Subject: [PATCH 09/12] Disable documentation and debug in build --- deployment/debian-package-x64/pkg-src/rules | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deployment/debian-package-x64/pkg-src/rules b/deployment/debian-package-x64/pkg-src/rules index 15cbefa4e..62f75bc6b 100644 --- a/deployment/debian-package-x64/pkg-src/rules +++ b/deployment/debian-package-x64/pkg-src/rules @@ -32,7 +32,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) Jellyfin.Server + 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 From 5054a77dcf73f829178009c73fef7b96de644607 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Mon, 25 Feb 2019 00:41:34 -0500 Subject: [PATCH 10/12] Fix the ffmpeg compatibility Doing this the other way was just complex. No longer try to override the system ffmpeg, just put ours somewhere else and depend on that package. --- deployment/debian-package-x64/pkg-src/conf/jellyfin | 6 +++--- deployment/debian-package-x64/pkg-src/control | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deployment/debian-package-x64/pkg-src/conf/jellyfin b/deployment/debian-package-x64/pkg-src/conf/jellyfin index b052b2ec6..58fe79332 100644 --- a/deployment/debian-package-x64/pkg-src/conf/jellyfin +++ b/deployment/debian-package-x64/pkg-src/conf/jellyfin @@ -21,9 +21,9 @@ JELLYFIN_CACHE_DIRECTORY="/var/cache/jellyfin" # Restart script for in-app server control JELLYFIN_RESTART_OPT="--restartpath=/usr/lib/jellyfin/restart.sh" -# [OPTIONAL] ffmpeg binary paths, overriding the UI-configured values -#JELLYFIN_FFMPEG_OPT="--ffmpeg=/usr/bin/ffmpeg" -#JELLYFIN_FFPROBE_OPT="--ffprobe=/usr/bin/ffprobe" +# ffmpeg binary paths, overriding the system values +JELLYFIN_FFMPEG_OPT="--ffmpeg=/usr/share/jellyfin-ffmpeg/ffmpeg" +JELLYFIN_FFPROBE_OPT="--ffprobe=/usr/share/jellyfin-ffmpeg/ffprobe" # [OPTIONAL] run Jellyfin as a headless service #JELLYFIN_SERVICE_OPT="--service" diff --git a/deployment/debian-package-x64/pkg-src/control b/deployment/debian-package-x64/pkg-src/control index 88d10438b..d96660590 100644 --- a/deployment/debian-package-x64/pkg-src/control +++ b/deployment/debian-package-x64/pkg-src/control @@ -20,7 +20,7 @@ Conflicts: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server Architecture: any Depends: at, libsqlite3-0, - ffmpeg (<7:4.1) | jellyfin-ffmpeg, + jellyfin-ffmpeg, libfontconfig1, libfreetype6, libssl1.0.0 | libssl1.0.2 From 1d1e6dede94596dc4e613a59c1561fe96447581c Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Wed, 27 Feb 2019 20:56:50 -0500 Subject: [PATCH 11/12] Set ffmpeg+ffprobe paths in Docker container Will always ensure containers use correct path. Yes - the arm images have a different path than the amd64 one. This is caused by the amd64 image using ffmpeg from jellyfin/ffmpeg while the others use ffmpeg from their distro's repos. --- Dockerfile | 6 +++++- Dockerfile.arm | 6 +++++- Dockerfile.arm64 | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 356268841..e2d424df7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,4 +22,8 @@ COPY --from=ffmpeg / / COPY --from=builder /jellyfin /jellyfin EXPOSE 8096 VOLUME /cache /config /media -ENTRYPOINT dotnet /jellyfin/jellyfin.dll --datadir /config --cachedir /cache +ENTRYPOINT dotnet /jellyfin/jellyfin.dll \ + --datadir /config \ + --cachedir /cache \ + --ffmpeg /usr/local/bin/ffmpeg \ + --ffprobe /usr/local/bin/ffprobe diff --git a/Dockerfile.arm b/Dockerfile.arm index 69c5d446e..d220763a2 100644 --- a/Dockerfile.arm +++ b/Dockerfile.arm @@ -30,4 +30,8 @@ RUN apt-get update \ COPY --from=builder /jellyfin /jellyfin EXPOSE 8096 VOLUME /cache /config /media -ENTRYPOINT dotnet /jellyfin/jellyfin.dll --datadir /config --cachedir /cache +ENTRYPOINT dotnet /jellyfin/jellyfin.dll \ + --datadir /config \ + --cachedir /cache \ + --ffmpeg /usr/bin/ffmpeg \ + --ffprobe /usr/bin/ffprobe diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index b85f8735b..243b841e9 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -31,4 +31,8 @@ RUN apt-get update \ COPY --from=builder /jellyfin /jellyfin EXPOSE 8096 VOLUME /cache /config /media -ENTRYPOINT dotnet /jellyfin/jellyfin.dll --datadir /config --cachedir /cache +ENTRYPOINT dotnet /jellyfin/jellyfin.dll \ + --datadir /config \ + --cachedir /cache \ + --ffmpeg /usr/bin/ffmpeg \ + --ffprobe /usr/bin/ffprobe From 58e5931a3287f2f50a58bcc1e2991375fc06c93f Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Thu, 28 Feb 2019 15:34:08 -0500 Subject: [PATCH 12/12] Bump version to 10.2.2 --- SharedVersion.cs | 4 ++-- .../debian-package-x64/pkg-src/changelog | 17 +++++++++++++++++ .../fedora-package-x64/pkg-src/jellyfin.spec | 19 ++++++++++++++----- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index 41eda393a..785ba9301 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,4 +1,4 @@ using System.Reflection; -[assembly: AssemblyVersion("10.2.1")] -[assembly: AssemblyFileVersion("10.2.1")] +[assembly: AssemblyVersion("10.2.2")] +[assembly: AssemblyFileVersion("10.2.2")] diff --git a/deployment/debian-package-x64/pkg-src/changelog b/deployment/debian-package-x64/pkg-src/changelog index 7b7efff27..349e8787f 100644 --- a/deployment/debian-package-x64/pkg-src/changelog +++ b/deployment/debian-package-x64/pkg-src/changelog @@ -1,3 +1,20 @@ +jellyfin (10.2.2-1) unstable; urgency=medium + + * jellyfin: + * PR968 Release 10.2.z copr autobuild + * PR964 Install the dotnet runtime package in Fedora build + * PR979 Build Package releases without debug turned on + * PR990 Fix slow local image validation + * PR991 Fix the ffmpeg compatibility + * PR992 Add Debian armhf (Raspberry Pi) build plus crossbuild + * PR998 Set EnableRaisingEvents to true for processes that require it + * PR1017 Set ffmpeg+ffprobe paths in Docker container + * jellyfin-web: + * PR152 Go back on Media stop + * PR156 Fix volume slider not working on nowplayingbar + + -- Jellyfin Packaging Team Thu, 28 Feb 2019 15:32:16 -0500 + jellyfin (10.2.1-1) unstable; urgency=medium * jellyfin: diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin.spec b/deployment/fedora-package-x64/pkg-src/jellyfin.spec index 68e0529cf..e24bd2fcb 100644 --- a/deployment/fedora-package-x64/pkg-src/jellyfin.spec +++ b/deployment/fedora-package-x64/pkg-src/jellyfin.spec @@ -7,8 +7,8 @@ %endif Name: jellyfin -Version: 10.2.1 -Release: 2%{?dist} +Version: 10.2.2 +Release: 1%{?dist} Summary: The Free Software Media Browser License: GPLv2 URL: https://jellyfin.media @@ -140,10 +140,19 @@ fi %systemd_postun_with_restart jellyfin.service %changelog -* Thu Feb 21 2019 Brian J. Murrell +* Thu Feb 28 2019 Jellyfin Packaging Team - jellyfin: -- dotnet seems to have moved to dotnet-runtime -- COPR auto-build +- PR968 Release 10.2.z copr autobuild +- PR964 Install the dotnet runtime package in Fedora build +- PR979 Build Package releases without debug turned on +- PR990 Fix slow local image validation +- PR991 Fix the ffmpeg compatibility +- PR992 Add Debian armhf (Raspberry Pi) build plus crossbuild +- PR998 Set EnableRaisingEvents to true for processes that require it +- PR1017 Set ffmpeg+ffprobe paths in Docker container +- jellyfin-web: +- PR152 Go back on Media stop +- PR156 Fix volume slider not working on nowplayingbar * Wed Feb 20 2019 Jellyfin Packaging Team - jellyfin: - PR920 Fix cachedir missing from Docker container