#!/usr/bin/make -f
# -*- makefile -*-

include /usr/share/dpkg/pkg-info.mk
export SOURCE_DATE_EPOCH

%:
	dh $@ --buildsystem=octave

ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
execute_before_dh_auto_build:
	[ ! -f doc/Makefile ] || make -C doc html pdf info

execute_after_dh_auto_build:
	# This problem was detected by Lintian (info-document-missing-image-file).
	# The image files are shared now by the HTML and INFO forms of
	# documentation.
	sed -i -e 's:src="\(.*\.png\)":src="/usr/share/doc/octave-queueing/\1":' doc/queueing.info
endif

execute_after_dh_installdeb:
	rm -rf $$(find debian -name doc -type d -empty)

execute_before_dh_auto_clean:
	[ ! -f doc/Makefile ] || make -C doc clean
