#!/usr/bin/make -f

DOCS = debian/libsaml2-doc/usr/share/doc/libsaml2-doc

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
    DEBUG = --enable-debug
else
    DEBUG =
endif

override_dh_auto_configure:
	dh_auto_configure -- --disable-dependency-tracking $(DEBUG)

override_dh_install:
	rm -r debian/tmp/usr/share/doc/opensaml*
	dh_install -a -i --fail-missing

override_dh_installdocs:
	dh_installdocs -A doc/NOTICE.txt
	set -e; if [ -d "$(DOCS)" ] ; then \
	    if [ -f "$(DOCS)/html/jquery.js" ] ; then \
		rm $(DOCS)/html/jquery.js ; \
		ln -s /usr/share/javascript/jquery/jquery.min.js \
		    $(DOCS)/html/jquery.js ; \
	    fi ; \
	fi

%:
	dh $@ --with autotools_dev
