#!/usr/bin/make -f

include /usr/share/dpkg/default.mk

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CONFIGURE_FLAGS += --disable-optimize
endif
ifneq (,$(filter $(DEB_HOST_ARCH),amd64 i386))
CONFIGURE_FLAGS += --enable-sse2
endif
ifneq (,$(filter $(DEB_HOST_ARCH),ppc64 ppc64el))
CONFIGURE_FLAGS += --enable-altivec
endif

%:
	dh $@ --with autoreconf --parallel

override_dh_auto_configure:
	dh_auto_configure -- $(CONFIGURE_FLAGS)

override_dh_installchangelogs:
	dh_installchangelogs CHANGE-LOG.txt

get-orig-source:
	uscan --noconf --verbose --rename --repack --compression xz --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-current-version
