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

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

%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean
	rm -rf dist node_modules

override_dh_auto_build:
	mkdir -p node_modules
	ln -s /usr/share/nodejs/rollup node_modules/rollup
	TZ=UTC npm run rollup

override_dh_installdocs:
	dh_installdocs
	dh_nodejs_autodocs

override_dh_install:
	dh_install
	: # for some unknow reason the time stamp can finish with either
	: # (Coordinated Universal Time) or (Koordineeritud maailmaaeg)
	: # during reprotest. Let's make it more regular.
	for f in $$(grep -rl BUILT debian); do \
	  sed -i 's/\(\* BUILT[^(]*\)\(.*\)/\1(Coordinated Universal Time)/' $$f; \
	done
