#!/usr/bin/make -f

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

include /usr/share/ocaml/ocamlvars.mk
DESTDIR := $(CURDIR)/debian/tmp
export OCAMLFIND_DESTDIR=$(OCAML_STDLIB_DIR)
export OCAMLFIND_LDCONF=ignore

%:
	dh $@ --with ocaml

override_dh_auto_clean:
	[ ! -f config.make ] || $(MAKE) clean

override_dh_auto_configure:
	dh_auto_configure -- --with-gtkspell --with-gtksourceview3

override_dh_auto_build:
	$(MAKE) world

override_dh_missing:
	dh_missing --list-missing

override_dh_installexamples:
	dh_installexamples
	if [ -d debian/liblablgtk3-ocaml-doc/usr/share/doc/liblablgtk3-ocaml/examples ]; \
	then \
	  find debian/liblablgtk3-ocaml-doc/usr/share/doc/liblablgtk3-ocaml/examples \
	    -name .cvsignore \
	    -delete ;\
	fi

