#!/usr/bin/make -f
# export DH_VERBOSE=1

include /usr/share/dpkg/default.mk

LIBDIR_MULTIARCH = /usr/lib/$(DEB_HOST_MULTIARCH)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- \
	  --with-ffmpeg=$(LIBDIR_MULTIARCH) \
	  --with-mysql-lib=$(LIBDIR_MULTIARCH) \
	  --with-pgsql-lib=$(LIBDIR_MULTIARCH) \
	  --without-optimizecpu
	# stop #795002 from recurring
	grep -q 'HAVE_FFMPEG 1' config.h

override_dh_auto_install:
	dh_auto_install
	cd debian/motion/etc/motion && mv motion-dist.conf motion.conf

override_dh_auto_clean:
	rm -f po/*.gmo po/motion.pot po/stamp-po
	dh_auto_clean --
