#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

ifneq (,$(findstring amd64,$(DEB_HOST_ARCH)))
DEB_CONFIGURE_FLAGS_EXTRA=--enable-arch=amd64
endif

export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed
export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- $(DEB_CONFIGURE_FLAGS_EXTRA)

override_dh_auto_install:
	dh_auto_install
	cd $(CURDIR)/debian/phasex/usr/share/phasex && \
		rm compile depcomp install-sh missing version-sh
	cd $(CURDIR)/debian/phasex/usr/share/doc/phasex && \
		rm LICENSE ChangeLog GPL-3.0.txt

override_dh_strip:
	dh_strip --dbgsym-migration='phasex-dbg (<< 0.14.97-3~)'
