2018-08-08 05:18:59 +00:00
|
|
|
#! /usr/bin/make -f
|
2018-08-10 01:59:53 +00:00
|
|
|
CONFIG := Release
|
|
|
|
TERM := xterm
|
2018-08-08 05:18:59 +00:00
|
|
|
SHELL := /bin/bash
|
2019-10-20 16:13:15 +00:00
|
|
|
WEB_TARGET := $(CURDIR)/MediaBrowser.WebDashboard/jellyfin-web
|
|
|
|
WEB_VERSION := $(shell sed -n -e 's/^version: "\(.*\)"/\1/p' $(CURDIR)/build.yaml)
|
2019-02-24 01:07:05 +00:00
|
|
|
|
|
|
|
HOST_ARCH := $(shell arch)
|
|
|
|
BUILD_ARCH := ${DEB_HOST_MULTIARCH}
|
|
|
|
ifeq ($(HOST_ARCH),x86_64)
|
2019-04-29 04:56:17 +00:00
|
|
|
# Building AMD64
|
|
|
|
DOTNETRUNTIME := debian-x64
|
2019-02-24 01:07:05 +00:00
|
|
|
ifeq ($(BUILD_ARCH),arm-linux-gnueabihf)
|
|
|
|
# Cross-building ARM on AMD64
|
|
|
|
DOTNETRUNTIME := debian-arm
|
2019-04-29 04:56:17 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(BUILD_ARCH),aarch64-linux-gnu)
|
|
|
|
# Cross-building ARM on AMD64
|
|
|
|
DOTNETRUNTIME := debian-arm64
|
2019-02-24 01:07:05 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifeq ($(HOST_ARCH),armv7l)
|
|
|
|
# Building ARM
|
|
|
|
DOTNETRUNTIME := debian-arm
|
|
|
|
endif
|
2019-04-29 04:56:17 +00:00
|
|
|
ifeq ($(HOST_ARCH),arm64)
|
|
|
|
# Building ARM
|
|
|
|
DOTNETRUNTIME := debian-arm64
|
|
|
|
endif
|
2019-02-24 01:07:05 +00:00
|
|
|
|
2018-08-08 05:18:59 +00:00
|
|
|
export DH_VERBOSE=1
|
2018-12-12 15:00:32 +00:00
|
|
|
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
2018-08-08 05:18:59 +00:00
|
|
|
|
|
|
|
%:
|
2018-08-10 01:59:53 +00:00
|
|
|
dh $@
|
2018-08-08 05:18:59 +00:00
|
|
|
|
|
|
|
# disable "make check"
|
|
|
|
override_dh_auto_test:
|
|
|
|
|
|
|
|
# disable stripping debugging symbols
|
|
|
|
override_dh_clistrip:
|
|
|
|
|
|
|
|
override_dh_auto_build:
|
2019-10-20 16:13:15 +00:00
|
|
|
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
|
2019-02-25 04:20:04 +00:00
|
|
|
dotnet publish --configuration $(CONFIG) --output='$(CURDIR)/usr/lib/jellyfin/bin' --self-contained --runtime $(DOTNETRUNTIME) \
|
|
|
|
"-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" Jellyfin.Server
|
2018-08-08 05:18:59 +00:00
|
|
|
|
|
|
|
override_dh_auto_clean:
|
2019-01-10 18:45:21 +00:00
|
|
|
dotnet clean -maxcpucount:1 --configuration $(CONFIG) Jellyfin.Server || true
|
2019-10-20 16:13:15 +00:00
|
|
|
rm -f '$(CURDIR)/web-src.tgz'
|
2018-12-15 02:21:48 +00:00
|
|
|
rm -rf '$(CURDIR)/usr'
|
2019-10-20 16:13:15 +00:00
|
|
|
rm -rf '$(CURDIR)/web'
|
|
|
|
rm -rf '$(WEB_TARGET)'
|
2019-07-15 03:11:17 +00:00
|
|
|
|
|
|
|
# Force the service name to jellyfin even if we're building jellyfin-nightly
|
|
|
|
override_dh_installinit:
|
|
|
|
dh_installinit --name=jellyfin
|