#!/usr/bin/make -f

# we set $HOME to a non-existing directory because the testsuite runs
# pdf2htmlEX which creates ~/.FontForge/ and we do not want to clutter
# the users home directory during a build
export HOME=$(CURDIR)/nonexistent

# dh build path from /usr/share/perl5/Debian/Debhelper/Buildsystem.pm
# function DEFAULT_BUILD_DIRECTORY
export PDF2HTMLEX_EXECUTABLE=$(shell pwd)/obj-$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)/pdf2htmlEX

%:
	dh $@

# using ENABLE_SVG requires CairoFontEngine, CairoRescaleBox and
# CairoOutputDev from poppler sources
override_dh_auto_configure:
	dh_auto_configure -- -DENABLE_SVG=OFF

override_dh_auto_build:
	dh_auto_build
	cd logo && ./update_png.sh

override_dh_auto_test:
	ln -s /usr/share/javascript/pdf/compatibility.js share/compatibility.js
	dh_auto_test

override_dh_auto_clean:
	dh_auto_clean
	rm -f test/test.pyc test/test_local_browser.pyc test/test_output.pyc
