#!/usr/bin/make -f

export DEB_CXXFLAGS_MAINT_APPEND = -DQT_NO_DEBUG_OUTPUT -DQT_NO_WARNING_OUTPUT
export DEB_VERSION = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')

ifeq ($(DEB_HOST_ARCH),ppc64el)
  export DEB_CXXFLAGS_MAINT_APPEND = -O2
endif

%:
	dh $@ --buildsystem=cmake

# Also implicitly: -DHAVE_VISUALISATIONS=OFF -DVISUALISATIONS=OFF
override_dh_auto_configure:
	dh_auto_configure -- \
	    -DBUNDLE_PROJECTM_PRESETS=OFF \
	    -DFORCE_GIT_REVISION=$(DEB_VERSION)

override_dh_auto_clean:
	rm -fv dist/Info.plist
	rm -fv dist/clementine.spec
	rm -fv dist/maketarball.sh
	rm -fv dist/windows/clementine.nsi
	rm -fv dist/windows/clementine-portable.nsi
	rm -fv src/translations/translations.pot
	dh_auto_clean

override_dh_installchangelogs:
	dh_installchangelogs Changelog

override_dh_auto_test:
