#!/usr/bin/make -f

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

# This has to be exported to make some magic below work.
export DH_OPTIONS=

# Avoid some error messages when running "make install"
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1

# Hack for Gnucash build system
export BUILDING_FROM_SVN=false

%:
	dh  $@

clean:
	[ ! -e Makefile ] || $(MAKE) clean
	dh_clean
	find . -type l -exec rm -v \{\} \;

override_dh_auto_configure:
	dh_auto_configure -- \
		--libdir=/usr/lib/gnucash \
		--libexecdir=/usr/lib \
		--infodir=/noinst \
		--mandir=/noinst \
		--docdir=/noinst \
		--with-gconf-schema-file-dir=/usr/share/gconf/schemas \
		--with-html-engine=webkit \
		--disable-static \
		--enable-debug \
		--enable-dbi \
		--enable-ofx \
		--enable-aqbanking \
		--enable-locale-specific-tax

install:	build
	dh install
	dh_testdir debian/gnucash-common/usr/share/applications/gnucash.desktop
	sed -i '/^Exec=/s/=/=\/usr\/bin\//' debian/gnucash-common/usr/share/applications/gnucash.desktop
	dh_gconf

override_dh_auto_test:

override_dh_strip:
	dh_strip --dbg-package=gnucash-dbg

override_dh_shlibdeps:
	dh_shlibdeps -ldebian/gnucash/usr/lib/gnucash:debian/gnucash/usr/lib/gnucash/gnucash
