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

ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
export DH_VERBOSE = 1
endif
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/pkg-info.mk

BUILDDIR = obj-$(DEB_HOST_GNU_TYPE)

ELPA_NAME=mu4e
export ELPA_NAME

%:
	dh $@ --with elpa --buildsystem=meson

#
# Insert preprocessor string into mu-cfind.1 telling groff to run tbl
#
execute_before_dh_install:
	sed -i '1 i '"'"'\\" t' $(CURDIR)/debian/tmp/usr/share/man/man1/mu-cfind.1

execute_before_dh_elpa:
	echo ';;; package description for mu4e  -*- no-byte-compile: t -*-' > $(BUILDDIR)/mu4e/mu4e-pkg.el
	echo "(define-package \"mu4e\" \"$(DEB_VERSION_UPSTREAM)\" \"the mu mail user agent\" 'nil)" >> $(BUILDDIR)/mu4e/mu4e-pkg.el

override_dh_compress:
	dh_compress --exclude=NEWS.org
