#!/usr/bin/make -f
#export DH_VERBOSE = 1

export HOME=$(CURDIR)/debian/fakehomenpm
export NODE_OPTIONS=--max_old_space_size=2048

# we need to have the exact same version between the libnode version used
# during the build and the libnode version installed on the user system
LIBNODE_VERSION := $(shell ls /usr/lib/$(DEB_HOST_MULTIARCH)/libnode.so.* | cut -d'.' -f3)

%:
	dh $@

override_dh_installsystemd:
	dh_installsystemd --no-enable --no-start

override_dh_auto_install:
	npm install

execute_after_dh_install:
	rm -rf debian/juice-shop/var/lib/juice-shop/node_modules/flatted/python/__pycache__

execute_after_dh_gencontrol:
	dh_gencontrol -- -Vnode:Depends="libnode$(LIBNODE_VERSION)"
