#!/usr/bin/make -f

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

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

# DH_GOPKG is the upstream path which you would normally “go get”.
# Using it allows us to build applications without patching locations.
export DH_GOPKG := github.com/google/gopacket

NOBUILD=examples pcap/gopacket_benchmark

%:
	dh $@ --buildsystem=golang

override_dh_auto_configure:
	dh_auto_configure
	rm -rf $(patsubst %,obj-*/src/$(DH_GOPKG)/%,$(NOBUILD))
	# Copy test files to build dir
	cp pcap/*.pcap obj-$(DEB_HOST_GNU_TYPE)/src/$(DH_GOPKG)/pcap/

override_dh_install:
	dh_install --fail-missing
