#!/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_installinit:
	dh_installinit --noscripts --name=smbd

override_dh_systemd_enable:
	dh_systemd_enable --name=smbd

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

.PHONY: override_dh_installinit override_dh_systemd_enable override_dh_auto_configure override_dh_auto_build
