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

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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

MODULE_PATH=/usr/lib/$(DEB_HOST_MULTIARCH)/nodejs/srs/lib/binding/srs.node

%:
	dh $@ --with nodejs

override_dh_link:
	dh_link `gdal-config --datadir` usr/lib/$(DEB_HOST_MULTIARCH)/nodejs/srs/srs_data

override_dh_auto_configure:
	node-gyp configure -module_name=srs -module_path=lib/binding/ -shared_gdal=1

override_dh_auto_build:
	node-gyp build
	cp -a build/lib/binding lib/

override_dh_fixperms:
	dh_fixperms
	chmod 644 $(CURDIR)/debian/node-srs$(MODULE_PATH)
