#!/usr/bin/make -f

# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

%:
	dh $@ --with python3

execute_before_dh_auto_build:
	export HOME=$(CURDIR)/debian/fakehomenpm && \
	cd plugins/magma && npm install && npm run build

override_dh_install:
	# Do NOT exclude .gitkeep yet, as dh_install doesn't install empty directories,
	# but some of them are required at runtime
	dh_install -X.eslintrc.js -X.github/ -X.gitignore -Xpycache -Xplugins/magma/node_modules/
	# Now we can remove .gitkeep
	find debian/caldera/ -name .gitkeep -type f -delete
	# Keep Lintian happy
	chmod -x debian/caldera/var/lib/caldera/plugins/sandcat/gocat/privdetect/privilegedetect.go
	chmod -x debian/caldera/var/lib/caldera/plugins/sandcat/gocat-extensions/execute/native/aws/s3upload_test.go
