#!/usr/bin/make -f
# You must remove unused comment lines for the released package.
export DH_VERBOSE = 1

-include /etc/os-release
OS_AND_VERSION=$(patsubst "%",%,$(ID))-$(patsubst "%",%,$(VERSION_ID))

ifeq ($(OS_AND_VERSION),debian-10)
	# Debian Buster: gpac available, but wikisuite-unoserver not (Python 3.7 < 3.8)
	SUBSTVARS = -Vdist:Depends="gpac"
else ifeq ($(OS_AND_VERSION),debian-12)
	# Debian Bookworm: gpac not available, wikisuite-unoserver available
	SUBSTVARS = -Vdist:Depends="wikisuite-unoserver"
else
	# All others (Debian 11, Ubuntu 20.04/22.04/24.04): both available
	SUBSTVARS = -Vdist:Depends="gpac, wikisuite-unoserver"
endif

%:
	dh $@

override_dh_gencontrol:
	dh_gencontrol -- $(SUBSTVARS)
