#!/usr/bin/make -f
# -*- makefile -*-
#
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

# This has to be exported to make some magic below work.
export DH_OPTIONS


override_dh_auto_build:
	if [ -x /usr/bin/ocamlopt ]; then\
		make -C math texvc;\
	else\
		make -C math texvc.bc;\
		mv math/texvc.bc math/texvc;\
	fi
	cd debian && xsltproc -nonet -o texvc.1 /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl texvc.xml

override_dh_auto_clean:
	cd math && make clean
	dh_auto_clean

override_dh_auto_install:

override_dh_shlibdeps:
	# This is merely the most sensible place to do this
	# otherwise dh_prep nobbles it
	dh_shlibdeps
	if [ ! -x /usr/bin/ocamlopt ]; then \
		echo "interpreter:Depends=ocaml-base-nox" >> debian/texvc.substvars;\
	fi

%:
	dh $@ 
