#!/usr/bin/make -f

# Allow to find debhelper7 on Maemo
# Install from Extras repository
PATH := /usr/bin/dh7:$(PATH)
export PATH

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

override_dh_auto_configure:
	dh_auto_configure -- -DINSTALL_TESTS=True

override_dh_strip:
	dh_strip --dbg-package=libapiextractor-dbg

override_dh_install:
	mkdir -p debian/tmp/usr/share/apiextractor-tests/
	cp debian/tests.xml debian/tmp/usr/share/apiextractor-tests/
	dh_install --list-missing

override_dh_auto_test:
	## Don't run the tests, they fail for now.
	## Upstream explanation:
	## [15:10] <hugopl> OdyX, theses tests show bugs not fixed in
	##         apiextractor, we'll fix these bugs asap, but we need to do
	##         it carefull, because any changes in apiextractor can break
	##         the entire binding
	## [15:10] <hugopl> so, we postponed the bug fixing for a while
	## [15:11] <hugopl> in other words... is normal just 1 unit test pass
	##         (for now...)

override_dh_compress:
	dh_compress -X.js

binary: binary-arch binary-indep;

binary-indep:
	dh binary-indep --until dh_auto_build
	dh_auto_build -i -- doc
	dh binary-indep --after dh_auto_build
