rules 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 := linux-x64
  10. ifeq ($(BUILD_ARCH),arm-linux-gnueabihf)
  11. # Cross-building ARM on AMD64
  12. DOTNETRUNTIME := linux-arm
  13. endif
  14. ifeq ($(BUILD_ARCH),aarch64-linux-gnu)
  15. # Cross-building ARM on AMD64
  16. DOTNETRUNTIME := linux-arm64
  17. endif
  18. endif
  19. ifeq ($(HOST_ARCH),armv7l)
  20. # Building ARM
  21. DOTNETRUNTIME := linux-arm
  22. endif
  23. ifeq ($(HOST_ARCH),arm64)
  24. # Building ARM
  25. DOTNETRUNTIME := linux-arm64
  26. endif
  27. ifeq ($(HOST_ARCH),aarch64)
  28. # Building ARM
  29. DOTNETRUNTIME := linux-arm64
  30. endif
  31. export DH_VERBOSE=1
  32. export DOTNET_CLI_TELEMETRY_OPTOUT=1
  33. %:
  34. dh $@
  35. # disable "make check"
  36. override_dh_auto_test:
  37. # disable stripping debugging symbols
  38. override_dh_clistrip:
  39. override_dh_auto_build:
  40. dotnet publish -maxcpucount:1 --configuration $(CONFIG) --output='$(CURDIR)/usr/lib/jellyfin/bin' --self-contained --runtime $(DOTNETRUNTIME) \
  41. -p:DebugSymbols=false -p:DebugType=none Jellyfin.Server
  42. override_dh_auto_clean:
  43. dotnet clean -maxcpucount:1 --configuration $(CONFIG) Jellyfin.Server || true
  44. rm -rf '$(CURDIR)/usr'
  45. # Force the service name to jellyfin even if we're building jellyfin-nightly
  46. override_dh_installinit:
  47. dh_installinit --name=jellyfin