#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

ELPA_NAME=commit-patch-buffer
export ELPA_NAME

override_dh_auto_install:
	make install PREFIX=debian/commit-patch/usr
	# dh_elpa copies the .el file to a new place
	rm debian/commit-patch/usr/share/emacs/site-lisp/commit-patch-buffer.el
	# No need for another copy of the GPL:
	rm debian/commit-patch/usr/share/doc/commit-patch/COPYING
	# Installed by dh_installchangelogs:
	rm debian/commit-patch/usr/share/doc/commit-patch/Changes
	# Set the correct debian editor
	sed -i 's/FALLBACK_EDITOR *=.*/FALLBACK_EDITOR = "editor";/' debian/commit-patch/usr/bin/commit-patch

# Skip tests. They aren't mature enough to offer any benefit during packaging.
override_dh_auto_test:
	true

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