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

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

BROWSERIFY=NODE_PATH=/usr/lib/nodejs browserify-lite

%:
	dh $@ --with nodejs

override_dh_installexamples:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
	dh_installexamples
	sed -i 's,"/javascript/debug/debug.min.js","../../../javascript/debug/debug.js",g' debian/libjs-debug/usr/share/doc/libjs-debug/examples/*.html
	sed -i "s,require[\(]'../../'[\)],require('debug'),g" debian/node-debug/usr/share/doc/node-debug/examples/*.js
else
	@echo '**********************************************************'
	@echo 'Skip examples                                             '
	@echo '**********************************************************'
endif

override_dh_installchangelogs:
	dh_installchangelogs -k CHANGELOG.md
