#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
export QT_SELECT=qt5
include /usr/share/dpkg/buildflags.mk

%:
	dh $@

override_dh_auto_configure:
	cp ChangeLog txt/changelog
	dh_auto_configure

override_dh_auto_build:
	make PREFIX=/usr build_client
	make PREFIX=/usr build_man

override_dh_auto_install:
	make install_client DESTDIR=$(CURDIR)/$(PACKAGE) PREFIX=/usr
	make install_man DESTDIR=$(CURDIR)/$(PACKAGE) PREFIX=/usr

override_dh_auto_clean:
	dh_auto_clean
	# clean stray .qm files that are not handled by clean rule in upstream Makefile
	mkdir -p txt/
	rm -Rf res/i18n/x2goclient_*.qm
	rm -f  res/txt/changelog

override_dh_strip:
	dh_strip -p x2goclient --dbgsym-migration='x2goclient-dbg (<< 4.1.0.1-1~)'

override_dh_missing:
	dh_missing --fail-missing

get-orig-source:
	uscan --noconf --force-download --rename --download-current-version --destdir=..
