#!/usr/bin/make -f
#export DH_VERBOSE = 1

# see ENVIRONMENT in dpkg-buildflags(1)
export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

export INSTALL_DIR=debian/tmp/usr
export LIB_PATH=lib/$(DEB_HOST_MULTIARCH)

PKG_VERSION=$(shell dpkg-parsechangelog -S version | cut -d- -f1)

%:
	dh $@ 

# Fixup version number in doxygen docs and pkgconfig
override_dh_clean:
	-mv Doxyfile.orig Doxyfile
	-mv libsquish.pc.in.orig libsquish.pc.in
	dh_clean
override_dh_auto_build:
	cp Doxyfile Doxyfile.orig
	cp libsquish.pc.in libsquish.pc.in.orig
	sed -r -i -e 's/^(PROJECT_NUMBER         = ).*$$/\1$(PKG_VERSION)/' Doxyfile
	sed -r -i -e 's/^(Version: ).*$$/\1$(PKG_VERSION)/' libsquish.pc.in
	dh_auto_build
