#!/usr/bin/make -f

export DH_VERBOSE=1

%:
	dh $@

override_dh_auto_build:
	dh_auto_build
	make -C help/C html pdf
	make -C guide/C html pdf

# The CONFIG_CLEAN_FILES variable is explicitly set to an empty value, in order
# to prevent the cleaning of `gnucash-docs.spec' (generated file, but present
# in upstream source tarball)
override_dh_auto_clean:
	[ ! -f Makefile ] || make distclean CONFIG_CLEAN_FILES=
	rm -rf help/C/gnucash-help guide/C/gnucash-guide

# OMF files are installed to the wrong place by upstream installer (see #464587)
override_dh_auto_install:
	dh_auto_install
	for omfbase in gnucash-guide gnucash-help; do \
		mkdir debian/gnucash-docs/usr/share/omf/$$omfbase; \
		mv debian/gnucash-docs/usr/share/omf/gnucash-docs/$$omfbase* debian/gnucash-docs/usr/share/omf/$$omfbase; \
	done
	rmdir debian/gnucash-docs/usr/share/omf/gnucash-docs

get-orig-source:
	uscan --force-download --rename --destdir .
.PHONY: get-orig-source
