#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk

PATH:=$(shell echo $$PATH):$(shell dpkg -L nodejs-8 | grep '\/bin\/node$$' | xargs dirname)

pre-build::
	export PATH=$(PATH)
	npm install --registry http://npm.yandex-team.ru --cache-min 86400

make::pre-build
	ENV=production NODE_ENV=production $(MAKE) all

install/$(DEB_SOURCE_PACKAGE)::make
	dh_install -p$(DEB_SOURCE_PACKAGE)
	dh_nodeubic --no-start -p$(DEB_SOURCE_PACKAGE)
