#!/usr/bin/make -f

export MAKE_VERBOSE = 1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# FTBFS only on i386 when PIE hardening is used (#843979), so disable PIE there
ifeq (i386,$(DEB_BUILD_ARCH_CPU))
export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie
endif

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

%:
	dh $@

override_dh_auto_configure:
	cp debian/config.state .
	echo | ./build.sh uqm config

override_dh_auto_build:
	./build.sh uqm

override_dh_auto_clean:
	./build.sh uqm clean
	rm -rf obj uqm uqm-debug

override_dh_auto_install:
	DESTDIR=${CURDIR}/debian/uqm ./build.sh uqm install

override_dh_installchangelogs:
	dh_installchangelogs ChangeLog

.PHONY: override_dh_auto_configure override_dh_auto_build override_dh_auto_clean override_dh_auto_install override_dh_installchangelogs
