#!/usr/bin/make -f

#export DH_VERBOSE=1

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH).

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CXXFLAGS_MAINT_APPEND  = -fPIE
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -fPIE -pie

override_dh_auto_configure:
	dh_auto_configure -- --enable-clutter \
		--enable-libwebp \
		--disable-silent-rules

override_dh_installchangelogs:
	dh_installchangelogs NEWS

ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
override_dh_strip:
	dh_strip
	find . -name '*.a' \( \! -name '*_g.a' \) \
	-exec strip --strip-debug \
	--remove-section=.comment \
	--remove-section=.note {} \;
endif

%:
	dh $@ --with autoreconf
