#!/usr/bin/make -f
# -*- makefile -*-
# Check for DISTRIB_ID in /etc/lsb-release. Ignore Errors. Empty on Debian,
# contains Ubuntu on Ubuntu systems
DISTRO := $(shell sed -n 's/DISTRIB_ID=\(.*\)/\1/p' /etc/lsb-release 2>/dev/null)

ifneq ($(DISTRO), Ubuntu)
	EXTRA = menu
endif

%:
	dh $@ --with python3

override_dh_auto_install:
	dh_auto_install
	# Use su-to-root on non-Ubuntu systems
	@if [ "$(DISTRO)" != "Ubuntu" ]; then \
		echo Using su-to-root in desktop files; \
		sed  -i 's:Exec=\(kdesu\|gksu\) \(.*\):Exec=su-to-root -X -c "\2":' \
		$(CURDIR)/debian/ndisgtk/usr/share/applications/*.desktop; \
	fi

override_dh_gencontrol:
	dh_gencontrol -u -V"distro:Depends=$(EXTRA)"

