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

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

%:
	dh $@ --with nodejs

override_dh_auto_clean:
	dh_auto_clean
	rm -rf build
	rm -f test/tmp/*

override_dh_auto_configure:
	node-gyp configure

override_dh_auto_build:
	node-gyp build

override_dh_auto_test:
	nodejs test/test-basic.js
	nodejs test/test-big-buffer.js
	nodejs test/test-stream.js

override_dh_install:
	dh_install
	chmod 644 $(CURDIR)/debian/node-iconv/usr/lib/nodejs/iconv/lib/iconv.node

override_dh_shlibdeps:
	dpkg-shlibdeps \
	-T$(CURDIR)/debian/node-iconv.substvars \
	$(CURDIR)/debian/node-iconv/usr/lib/nodejs/iconv/lib/iconv.node

override_dh_strip:
	strip \
	--remove-section=.comment \
	--remove-section=.note \
	--strip-unneeded \
	$(CURDIR)/debian/node-iconv/usr/lib/nodejs/iconv/lib/iconv.node
