#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#DH_VERBOSE = 1


# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append LDFLAGS
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed


# main packaging script based on dh7 syntax
%:
	dh $@  --with autoreconf,gnome

override_dh_auto_configure:
	dh_auto_configure -- --enable-gtk-doc --enable-gtk-doc-html --enable-vala

# Disable tests, that require D-Bus and will not work well under fakeroot or
# without a session bus.
override_dh_auto_test:

override_dh_installchangelogs:
	dh_installchangelogs NEWS

override_dh_autoreconf:
	dh_autoreconf --as-needed

override_dh_auto_build:
	# Upstream Makefile has docs/reference/gspell-1.0-sections.txt:
	# 1. incorrectly generated by gtkdoc-scangobj ;
	# 2. correctly regenerated by copying docs/reference/gspell-sections.txt.in.
	#
	# Unfortunately, that second step relies on high resolution mtime (~< .1s),
	# which is not the case on kFreeBSD (= 1s), which makes the build fail.
	#
	# We therefore correctly copy it from docs/reference/gspell-sections.txt.in.
	# Later, when gtkdoc-scangobj is called, and sees this file, it will
	# not regenerate it.
	cp docs/reference/gspell-sections.txt.in docs/reference/gspell-1.0-sections.txt
	dh_auto_build
