#!/usr/bin/make -f
export V=1
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export TITAN_VERSION=11.1.0
export OPTDIR=debian/eclipse-titan-optdir-$(TITAN_VERSION)/opt/eclipse-titan-$(TITAN_VERSION)/

%:
	dh $@ --verbose --no-parallel

override_dh_shlibdeps:
	dh_shlibdeps -l$(CURDIR)/Install/lib

override_dh_auto_install:
	$(MAKE) DESTDIR=$(CURDIR)/debian/eclipse-titan prefix=/usr install
	find $(CURDIR)/Install -type d -empty -delete
	mkdir -p "$(OPTDIR)"
	for dir in bin etc include lib; do \
		mv -v Install/"$$dir" "$(OPTDIR)/$$dir"; \
	done

override_dh_gencontrol:
	dh_gencontrol -- -V'gcc:Version=$(shell dpkg-query -f '$${Version}\n' -W gcc | sed -e 's/-[^-]*$$//')'
