#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		--without-vm-dir \
		--docdir='$${datarootdir}/doc/bbdb3' \
		--with-lispdir='$${datadir}/emacs/site-lisp/bbdb3'

override_dh_auto_build:
	dh_auto_build -- pkgdatadir='$${datarootdir}/bbdb3'

override_dh_auto_install:
	dh_auto_install -- pkgdatadir='$${datarootdir}/bbdb3'
	@echo "Deleting compiled elisp from installation tree, as compilation"
	@echo "is done at install time by the emacsen infrastructure."
	find debian/bbdb3 -name '*.elc' -print -delete
	@echo Info file not ready. # when it is, create debian/bbdb3.info
	-rm --verbose debian/bbdb3/usr/share/info/bbdb.info
	-rm --verbose debian/bbdb3/usr/share/info/dir
	-rmdir --verbose debian/bbdb3/usr/share/info
	@echo PDF manual is just reformatted info file, not ready.
	-rm --verbose debian/bbdb3/usr/share/doc/bbdb3/bbdb.pdf
	@echo dh_installchangelog installs this later with standard name
	-rm --verbose debian/bbdb3/usr/share/doc/bbdb3/ChangeLog
	@echo copy of GPLv3 is not needed due to pointer in .../copyright
	-rm --verbose debian/bbdb3/usr/share/doc/bbdb3/COPYING
