#!/usr/bin/make -f

%:
	dh $@

override_dh_auto_build:
	# Override incorrect (for debian) values in upstream Makefile:
	make QT4DIR=/usr/share/qt4 \
	     QT4MOC=/usr/share/qt4/bin/moc \
	     QT4CFLAGS='"-I/usr/include/qt4/Qt -I/usr/include/qt4 -pipe -O2"'

override_dh_install:
	dh_install rlplot exprlp usr/bin
	dh_install RLPlot.xpm usr/share/pixmaps
	# Shouldn't be executable:
	chmod a-x debian/rlplot/usr/share/pixmaps/RLPlot.xpm
	dh_install debian/rlplot.desktop usr/share/applications

override_dh_installman:
	dh_installman debian/rlplot.1
	dh_link usr/share/man/man1/rlplot.1 usr/share/man/man1/exprlp.1

override_dh_auto_clean:
	# Upstream's Makefile tries to rm moc_QT_Spec.cpp without -f in "clean"
	# which will fail if that file doesn't exist, so just reimplement it
	# here and also remove the binaries:
	rm -f *.o *~ moc_QT_Spec.cpp rlplot exprlp
