#!/usr/bin/make -f
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=-lto
export DEB_CFLAGS_MAINT_APPEND = -DDEFAULT_CONFIG_FILE=\"/etc/tcpxtract.conf\"

%:
	dh $@ --with autoreconf

override_dh_auto_test:
	dh_auto_test
	./tcpxtract -c tcpxtract.conf -f debian/tests/test.pcap > extract.log 2>&1 \
	    || fail "tcpxtract exited with an error on the sample capture"
	grep -q "Found file of type" extract.log \
	    || fail "no file was recognized in the sample capture"
