#!/usr/bin/make -f

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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

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

override_dh_auto_install:
	dh_auto_install
	find $(CURDIR)/debian -type f -name libmaxminddb.la -delete

override_dh_auto_build:
	# build manpages (needs pandoc); these are included in tarballs
	dev-bin/make-man-pages.pl
	dh_auto_build

override_dh_auto_clean:
	dh_auto_clean
	rm -rf man/

override_dh_installchangelogs:
	dh_installchangelogs Changes.md
