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

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

%:
	dh $@

override_dh_clean:
	dh_clean node_modules/ build/

override_dh_auto_configure:
	HOME=/tmp npm install polymer-cli@1.2

override_dh_auto_build:
	mkdir -p dist/static/acl/custom
	mkdir -p dist/static/quota/custom

	cd ./actions/extra/acl/custom; ../../../../node_modules/.bin/polymer build
	cp -r ./actions/extra/acl/custom/build/default/* dist/static/acl/custom/
	cd ./actions/extra/quota/custom; ../../../../node_modules/.bin/polymer build
	cp -r ./actions/extra/quota/custom/build/default/* dist/static/quota/custom/
	dh_auto_build

override_dh_install:
	dh_install -p eole-fichier-actions dist/static/* usr/share/eole/creole/extra/
	dh_install

override_dh_builddeb:
	# Make package compatible with older version
	dh_builddeb -- -Zgzip -Srle

override_dh_missing:

.PHONY: override_dh_auto_configure override_dh_auto_build override_dh_builddeb override_dh_missing
