#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

DEB_MAKE_INSTALL_TARGET =

DEB_CONFIGURE_EXTRA_FLAGS = --enable-gc=system --with-latex=/usr/share/texmf/tex/latex --with-context=/usr/share/texmf/tex/context/third

DEB_COMPRESS_EXCLUDE = .pdf

common-build-arch::
	make asy man

common-install-arch::
	make install-asy DESTDIR=$(CURDIR)/debian/tmp
	dh_installtex -pasymptote

# this needs to be run before any of the binary-install/asymptote-doc stuff
# from cdbs
common-install-prehook-indep::
	make all html

clean::
	rm --force doc/latexusage.pdf doc/latexusage.dvi doc/TeXShopAndAsymptote.dvi doc/CAD.dvi
	rm --force doc/*.aux doc/*.cp doc/*.cps doc/*.idx doc/*.ins doc/*.log doc/*.toc asy.list
	rm --force doc/asyRefCard.pdf doc/asyRefCard.dvi

binary-predeb/asymptote::
	chmod +x debian/$(cdbs_curpkg)/usr/share/asymptote/asy-kate.sh # script-not-executable
