#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/dpkg/pkg-info.mk

%:
	dh $@

override_dh_installdocs:
	dh_installdocs
	dh_nodejs_autodocs auto_dispatch

# Fix versions and homepage of components
override_dh_gencontrol:
	dh_gencontrol -pnode-codemirror-lang-markdown -- -v$(DEB_VERSION)
	dh_gencontrol -pnode-crelt -- \
		-v$(shell pkgjs-pjson crelt version)~$(DEB_VERSION) \
		-DHomepage=https://github.com/marijnh/crelt
	dh_gencontrol -pnode-style-mod -- \
		-v$(shell pkgjs-pjson style-mod version)~$(DEB_VERSION) \
		-DHomepage=https://www.npmjs.com/package/style-mod
	set -e; for p in codemirror-*; do \
		VERSION=`pkgjs-pjson $$p version`; \
		dh_gencontrol -pnode-$$p -- -v$$VERSION~$(DEB_VERSION); \
	done
