#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean
	rm -rf inc
	rm -f *.qm

override_dh_auto_configure:
	mkdir -p inc/
	ln -s /usr/include/vlc inc
	mkdir -p inc/zlib
	ln -s /usr/include/zlib.h inc/zlib
	export QT_SELECT=5; dh_auto_configure
	lrelease -qt5 PreviSat.pro

override_dh_dwz:
	@echo not running dh_dwz because it fails unexpectedly

DESTDIR = $(CURDIR)/debian/previsat

override_dh_auto_install:
	dh_auto_install
	# add a symlink to the manpage
	install -d $(DESTDIR)/usr/share/man/man1
	ln -s previsat.1.gz $(DESTDIR)/usr/share/man/man1/PreviSat.1.gz
	# don't know why, this hack is necessary:
	install -d $(DESTDIR)/usr/bin
	install -m 755 PreviSat $(DESTDIR)/usr/bin
	install -d $(DESTDIR)/usr/share/Astropedia/PreviSat
	install -m 644 *.qm $(DESTDIR)/usr/share/Astropedia/PreviSat
