#!/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:
	dh_auto_build --buildsystem=nodejs
	bundt
	mjs2cjs dist/index.mjs
	help2man --version-string `node bin.js -v|sed -s 's/uvu, //'` \
	-n 'Extremely fast and lightweight test runner for Node.js and the browser' \
	-N ./bin.js >uvu.1
	perl -i -pe 's/bin\.js/uvu/g;s/BIN\.JS/UVU/g' uvu.1

ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
override_dh_link:
	dh_link
	find debian/uvu/ -name .gitignore -delete
	jdupes -rl debian/uvu/usr/share/doc/uvu/examples
endif

override_dh_fixperms:
	dh_fixperms
	chmod +x debian/uvu/usr/share/nodejs/uvu/bin.js
