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

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

export DH_GOPKG := git.torproject.org/pluggable-transports/websocket
export DH_GOPKG_SUBDIRS := websocket pt-websocket-server

DH_BUILDDIR = obj-$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

%:
	dh $@ --buildsystem=golang --with=golang

override_dh_auto_build:
	cd $(DH_BUILDDIR) && GOPATH=$$PWD go install -v $(DH_GOPKG_SUBDIRS:%=$(DH_GOPKG)/%)
	make doc/pt-websocket-server.1

override_dh_auto_test:
	cd $(DH_BUILDDIR) && GOPATH=$$PWD go test -v $(DH_GOPKG_SUBDIRS:%=$(DH_GOPKG)/%)

override_dh_auto_install:
	dh_auto_install
	rm -rf debian/pt-websocket/usr/share/gocode

override_dh_auto_clean:
	dh_auto_clean
	make clean

override_dh_compress:
	dh_compress -X /examples/
