#!/usr/bin/make -f

export CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
export CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
export CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
export LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)

%:
	dh $@ --parallel

override_dh_auto_clean:
	if test -d icons.orig; then rm -Rf icons; mv icons.orig icons; fi
	if test -d svg.orig; then rm -Rf svg; mv svg.orig svg; fi
	dh_auto_clean
	# clean stray .qm files that are not handled by clean rule in upstream Makefile
	rm -Rf x2goclient_*.qm

override_dh_auto_build:
	if ! test -d icons.orig; then cp -a icons icons.orig; cp -a debian/icons/* icons/; fi
	if ! test -d svg.orig; then cp -a svg svg.orig; cp -a debian/svg/x2go-logo.svg svg/x2gologo.svg; fi
	dh_auto_build

override_dh_auto_install:
