#!/usr/bin/make -f
#location of stxxl's built-in jquery
JQUERY_STXXL_TARGET=/usr/share/doc/libstxxl-doc/html/html/jquery.js
#Location of debian jquery
JQUERY_SYS_TARGET=/usr/share/javascript/jquery/jquery.js
%:
	dh $@

override_dh_auto_install:
	dh_auto_install
	#Don't want this, so delete it
	rm -rf $$(pwd)/debian/tmp/usr/lib/cmake/
	
override_dh_install:
	dh_install
	#Relink jquery to system provided copy.
	rm -f $$(pwd)/debian/libstxxl-doc/$(JQUERY_STXXL_TARGET)
	mkdir -p $$(pwd)/debian/libstxxl-doc/$$(dirname $(JQUERY_STXXL_TARGET) )
	#Symlink to system value
	ln -s $(JQUERY_SYS_TARGET) $$(pwd)/debian/libstxxl-doc/$(JQUERY_STXXL_TARGET)

override_dh_auto_build:
	dh_auto_build
	#Build doxygen HTML docs
	cd doc && doxygen .
	#Build PDF from doxygen generated latex files
	#cd doc/latex && make
	
override_dh_auto_clean:
	dh_auto_clean
	rm -rf doc/html/ doc/latex/
