#!/usr/bin/make -f

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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

#upstream hardening
export DEBUG = 0
export HARDENING = 1

include /usr/share/dpkg/architecture.mk
export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)-

#NACL needs this
export NACL_INC_DIR=/usr/include/sodium
export NACL_LIB=sodium

override_dh_auto_clean:
	dh_clean

override_dh_auto_configure:
	./configure

override_dh_auto_build:
	$(MAKE) Q= PREFIX=/usr ETCDIR=/etc

override_dh_auto_install:
	$(MAKE) Q= PREFIX=/usr ETCDIR=/etc DESTDIR=$(CURDIR)/debian/netsniff-ng install
	find debian/netsniff-ng -type d -empty -delete

override_dh_strip:
	dh_strip --no-automatic-dbgsym

override_dh_dwz:
	#Do not generate debug files.

%:
	dh $@
