#!/usr/bin/make -f
# The previous build system was using pmake
# The current autoconf. That makes our life way easier

export DH_VERBOSE=1

devi := $(shell lsb_release -r -s | cut -d '.'  -f1)
#eval = $(shell if [ $(1) -gt $(2) ] ; then echo gt ; else echo lt ; fi)
ifeq ($(shell if [ $(devi) -gt 8 ] ; then echo gt ; else echo lt ; fi),gt)
   DEBVE=yes
else
   DEBVE=no
endif

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- --enable-examples

override_dh_strip:
ifeq ($(DEBVE2),no)
	dh_strip --dbgsym-migration='libedit2-dbg (<< 3.1-20180525-2~)'
else
	dh_strip -- 
endif


# XXX: Can be removed when switching to debhelper compat 12.
override_dh_compress:
	dh_compress -X.c -XMakefile.in -XMakefile.am

override_dh_clean:
	dh_clean
	# Remove Apple time machine files
	rm -f `find . -iname '._*'`

#override_dh_manpages:
#	dh_installman --sourcedir=debian/tmp