#!/usr/bin/make -f

-include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/rules/buildcore.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

pkg = $(DEB_SOURCE_PACKAGE)
pkgdoc = frei0r-plugins-doc

DEB_UPSTREAM_URL = http://www.piksel.no/$(pkg)/releases
DEB_UPSTREAM_PACKAGE = frei0r-plugins
DEB_UPSTREAM_TARBALL_MD5 = a2eb63feeeb0c5cf439ccca276cbf70c

# TODO: have autotools build docs as part of main build, when doxygen is found
DEB_BUILDDIR_$(pkgdoc) = doc
build/$(pkgdoc)::
	$(DEB_MAKE_INVOKE)
# TODO: have autotools support DESTDIR for doc install target
#install/$(pkgdoc)::
#	$(DEB_MAKE_INVOKE) $(DEB_MAKE_INSTALL_TARGET)
DEB_DH_INSTALL_ARGS_$(pkgdoc) = doc/html usr/share/$(pkg)
# TODO: have autotools support DESTDIR for doc clean target
#DEB_PHONY_RULES += doc-clean/$(pkgdoc)
#doc-clean/$(pkgdoc):
#	$(DEB_MAKE_INVOKE) distclean
#clean:: doc-clean/$(pkgdoc)
clean::
	rm -f $(patsubst %,doc/html/*.%,html js css png map md5)
	rm -f doc/Makefile
