#!/usr/bin/make -f

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	DEBUG += --enable-debug
endif

%:
	dh $@  --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- \
		--includedir="\$${prefix}/include/$(DEB_HOST_MULTIARCH)" \
		$(DEBUG)

override_dh_auto_build:
	# build manpages (needs pandoc); these are included in tarballs
	if [ -x "$$(which pandoc 2>/dev/null)" ]; then \
		dev-bin/make-man-pages.pl; \
	fi
	dh_auto_build

override_dh_auto_clean:
	dh_auto_clean
	rm -rf man/

override_dh_strip:
	dh_strip --dbg-package=libmaxminddb-dbg

override_dh_installchangelogs:
	dh_installchangelogs Changes.md
