#!/usr/bin/make -f

DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

configure_flags += --prefix=/usr \
	--sysconfdir=/usr/share \
	--build=$(DEB_BUILD_GNU_TYPE) \
	--disable-silent-rules

ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
	configure_flags += --host=$(DEB_HOST_GNU_TYPE)
endif

include $(CURDIR)/debian/update-patches.mk

override_dh_auto_install:
	$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
	dh_install

override_dh_auto_configure:
	dh_auto_configure -- $(configure_flags)

%:
	dh $@