#!/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_auto_build:
	ALIASES="api-extractor,/usr/bin/true babel,/usr/bin/babeljs" pkgjs-lerna run build

override_dh_installdocs:
	dh_installdocs
	dh_nodejs_autodocs auto_dispatch

override_dh_install:
	dh_install
	find debian/ -name .eslintrc.js -delete

override_dh_gencontrol:
	set -e;for c in `pkgjs-utils root_components_list 2>/dev/null` packages/web-components/fast-ssr; do \
		NAME=`pkgjs-pjson $$c name`; \
		VERSION=`pkgjs-pjson $$c version|sed -e 's/-/~/g'`; \
		PKG=node-`pkgjs-utils normalize_name $$NAME`; \
		URL=`pkgjs-pjson $$c homepage`; \
		if test "$$URL"==""; then \
			URL=`pkgjs-pjson $$c repository url|sed -e 's/.git$$//' -e 's/^git\+//'`; \
		fi; \
		dh_gencontrol -p$$PKG -- -v$${VERSION}~$(DEB_VERSION) -DHomepage=$$URL; \
	done
