#!/usr/bin/make -f
export DH_VERBOSE=1

# examples/Makefile is autogenerated before being shipped; we want to
# make sure it picks a standard shell for reproducibility
export SHELL = /bin/sh

override_dh_auto_configure:
	dh_auto_configure -- \
		$(shell dpkg-buildflags --export=configure) \
		--enable-vala \
		--enable-gtk-doc \
		--disable-rpath \
		--enable-largefile \
		--enable-smime \
		--enable-introspection \
		CSC=/usr/bin/mono-csc

# https://bugs.debian.org/806033 -- dh_clideps expects to see
# dh_makeshlibs called before it, but dh_makeshlibs is never called
# when building only arch-indep packages.  So we force the issue by
# making a phony shlibs.local file that dh_clideps will accept, if no
# others exist:
override_dh_clideps:
	if ! grep -q . debian/*/DEBIAN/shlibs; then echo libgmime-2.6 0 libgmime-2.6-0 > debian/shlibs.local; fi
	dh_clideps
	rm -f debian/shlibs.local

override_dh_auto_build-indep: 
	dh_auto_build
	mdoc update -o $(CURDIR)/mono/monodocer $(CURDIR)/mono/gmime-sharp.dll
	mdoc assemble -o $(CURDIR)/mono/gmime-sharp-2.6 $(CURDIR)/mono/monodocer

%:
	dh $@ --with=autoreconf,gir,cli
