#!/usr/bin/make -f

export DEB_BUILD_HARDENING=1

%:
	dh $@ --buildsystem=qmake

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
INPUT_DOT_PRO = $(shell find fitPlugins/ -name "*.pro.in")

override_dh_auto_configure:
	for f in $(INPUT_DOT_PRO); do \
	  g=$$(echo $$f| sed 's/\.in$$//'); \
	  echo $$g; \
	  sed 's%.*libsuff=64.*%libsuff=/$(DEB_HOST_MULTIARCH)%' $$f > $$g; \
	done
	dh_auto_configure

override_dh_auto_build:
	docbook-to-man man/manpage.sgml > debian/scidavis.1
	dh_auto_build

override_dh_makeshlibs:
	dh_makeshlibs --no-act

override_dh_clean:
	rm -rf scidavis/translations/scidavis_*.qm
	rm -rf tmp/
	find fitPlugins/ -name "*.pro" | xargs rm -f
	dh_clean

