#!/usr/bin/make -f

WITH_LINKTREE := $(if $(filter nodoc, $(DEB_BUILD_OPTIONS)),,--with linktree)

%:
	dh $@ $(WITH_LINKTREE)

ifeq (,$(filter nodoc, $(DEB_BUILD_OPTIONS)))
execute_after_dh_auto_build:
	sh generate-site.sh

# Semibold was renamed SemiBold in Open Sans v2 (#1150402)
SEMIBOLD := $(notdir $(firstword $(wildcard \
	/usr/share/fonts/truetype/open-sans/OpenSans-SemiBold.ttf \
	/usr/share/fonts/truetype/open-sans/OpenSans-Semibold.ttf)))

%.linktrees: %.linktrees.in
	sed 's/@SEMIBOLD@/$(SEMIBOLD)/' $< > $@

execute_before_dh_linktree:  debian/node-nouislider-doc.linktrees
endif

# don't install another copy of the library for docs
override_dh_installdocs:
	dh_installdocs -Xdist

execute_after_dh_clean:
	rm -rf static
