#! /usr/bin/make -f

export DH_OPTIONS		+= -O-Bbuild
export DEB_BUILD_MAINT_OPTIONS	 = hardening=-fortify

override_dh_auto_configure:
	rm -f configure configure.ac
	dh_auto_configure -- -DENABLE_ESD=1 -DENABLE_OPENAL=1 -DENABLE_SDL=1 -DENABLE_RPATH=0

override_dh_installman:
	sed 's/@VERSION@/$(shell grep SET.VERSION CMakeLists.txt | cut -d\" -f2)/g' < docs/libmikmod-config.1.in > build/docs/libmikmod-config.1
	dh_installman

override_dh_installinfo:
	dh_installinfo docs/mikmod.info*

override_dh_installchangelogs:
	dh_installchangelogs -a NEWS

%:
	dh $@
