#!/usr/bin/make -f
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export DOCBOOK_DSL=/usr/share/sgml/docbook/stylesheet/dsssl/modular/html/docbook.dsl
export CHANGELOG_DATE=$(shell dpkg-parsechangelog -S date)

%:
	dh $@ --with autoreconf --with bash-completion

override_dh_autoreconf:
	# gnome-doc generates so many portability warnings, ignore them:
	dh_autoreconf autoreconf -- -i -f -Wno-portability

override_dh_auto_configure:
	dh_auto_configure -- --disable-silent-rules --with-unixodbc=/usr --disable-scrollkeeper

override_dh_auto_install:
	# see http://bugs.debian.org/619683
	dh_auto_install
	for file in debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.la; do \
		sed -i "/dependency_libs/ s/'.*'/''/" $$file ; \
	done

override_dh_makeshlibs:
	# see http://bugs.debian.org/205142
	# don't do ldconfig for non-standard location lib/odbc/
	dh_makeshlibs --package=odbc-mdbtools -n -- -q
	dh_makeshlibs --no-package=odbc-mdbtools

override_dh_strip:
	dh_strip --dbg-package=mdbtools-dbg
