rules 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #! /usr/bin/make -f
  2. CONFIG := Release
  3. TERM := xterm
  4. SHELL := /bin/bash
  5. HOST_ARCH := $(shell arch)
  6. BUILD_ARCH := ${DEB_HOST_MULTIARCH}
  7. ifeq ($(HOST_ARCH),x86_64)
  8. # Building AMD64
  9. DOTNETRUNTIME := debian-x64
  10. ifeq ($(BUILD_ARCH),arm-linux-gnueabihf)
  11. # Cross-building ARM on AMD64
  12. DOTNETRUNTIME := debian-arm
  13. endif
  14. ifeq ($(BUILD_ARCH),aarch64-linux-gnu)
  15. # Cross-building ARM on AMD64
  16. DOTNETRUNTIME := debian-arm64
  17. endif
  18. endif
  19. ifeq ($(HOST_ARCH),armv7l)
  20. # Building ARM
  21. DOTNETRUNTIME := debian-arm
  22. endif
  23. ifeq ($(HOST_ARCH),arm64)
  24. # Building ARM
  25. DOTNETRUNTIME := debian-arm64
  26. endif
  27. export DH_VERBOSE=1
  28. export DOTNET_CLI_TELEMETRY_OPTOUT=1
  29. %:
  30. dh $@
  31. # disable "make check"
  32. override_dh_auto_test:
  33. # disable stripping debugging symbols
  34. override_dh_clistrip:
  35. override_dh_auto_build:
  36. dotnet publish -maxcpucount:1 --configuration $(CONFIG) --output='$(CURDIR)/usr/lib/jellyfin/bin' --self-contained --runtime $(DOTNETRUNTIME) \
  37. "-p:DebugSymbols=false;DebugType=none" Jellyfin.Server
  38. override_dh_auto_clean:
  39. dotnet clean -maxcpucount:1 --configuration $(CONFIG) Jellyfin.Server || true
  40. rm -rf '$(CURDIR)/usr'
  41. # Force the service name to jellyfin even if we're building jellyfin-nightly
  42. override_dh_installinit:
  43. dh_installinit --name=jellyfin