#!/usr/bin/make -f

CLOSQL_VER = $(shell apt-cache showsrc closql-el | grep "Version:" | sort -r | head -n1 | cut -f2 -d ' ' | cut -f1 -d '-')
MAGIT_VER = $(shell apt-cache showsrc magit | grep "Version:" | sort -r | head -n1 | cut -f2 -d ' ' | cut -f1 -d '-')

LPATH =  -L /usr/share/emacs/site-lisp/elpa-src/closql-$(CLOSQL_VER)
LPATH += -L /usr/share/emacs/site-lisp/elpa-src/magit-$(MAGIT_VER)

%:
	dh $@ --with elpa

override_dh_auto_build:
	make LOAD_PATH=$(LPATH)
