#!/usr/bin/make -f
#export DH_VERBOSE=1
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

SLVERSION=$(shell dpkg-parsechangelog | sed -n 's/^Version: //p' | cut -f1 -d'-')

PROGDIR := $(CURDIR)/debian/tmp

%:
	dh $@ --parallel --buildsystem=cmake

override_dh_auto_configure:
	dh_auto_configure -- \
		-DSPRINGLOBBY_REV:STRING=$(SLVERSION) \
		-DCMAKE_BUILD_TYPE=RELWITHDEBINFO

override_dh_auto_build:
	dh_auto_build
	$(MAKE) -C debian/manpages

override_dh_auto_install:
	dh_auto_install
	cd $(PROGDIR)/usr/share/doc/springlobby && \
	rm -fv COPYING AUTHORS

override_dh_strip:
	dh_strip --dbg-package=springlobby-dbg

override_dh_auto_clean:
	dh_auto_clean
	$(MAKE) -C debian/manpages clean
