#!/usr/bin/make -f

%:
	dh $@ --parallel --with elpa

override_dh_auto_build:
	$(MAKE) info

# CHANGES.org is a bit outdated, but probably still of interest.  If
# you think otherwise, I do not object.
# -- Dmitry Bogatov <KAction@gnu.org> Wed Jun 22 14:13:06 MSK 2016
override_dh_installchangelogs:
	dh_installchangelogs CHANGES.org

# Since we can't expect to have tty, tests are executed in dtached
# state.  When debian/elpa-test.sock disappears, we can check result
# of test invocation.
#
# dh_elpa_test wishlist bug for it to do this for us: #829170
override_dh_elpa_test:
	dtach -n debian/elpa-test.sock sh -c '$(MAKE) test && touch debian/elpa-test.ok'
	timeout 180 sh -c 'while [ -S debian/elpa-test.sock ] ; do sleep 1 ; done'
	test -f debian/elpa-test.ok
	rm -f debian/elpa-test.ok

override_dh_elpa:
	dh_elpa
	sed -i 's#"evil-core"#"evil"#g' \
	    debian/elpa-evil/usr/share/emacs/site-lisp/elpa-src/evil-*/evil-autoloads.el
