#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

# --enable-sflow
# Build sflow collector sfcpad; default is NO
#
# --enable-nfprofile
# Build nfprofile used by NfSen; default is NO
#
# --enable-nftrack
# Build nftrack used by PortTracker; default is NO
#
# --enable-nfpcapd
# Build nfpcapd collector to create netflow data from interface traffic or
# precollected pcap traffic, similar to softflowd; default is NO
#
# --enable-nsel
# Compile nfdump, to read and process NSEL/NEL event data; default is NO

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-nfpcapd \
		--enable-nfprofile \
		--enable-nftrack \
		--enable-nsel \
		--enable-sflow \
		--enable-shared=no \
		CPPFLAGS="$(CFLAGS) $(CPPFLAGS)"

# Test suite only works on amd64/arm64/armhf/i386
override_dh_auto_test:
ifneq (,$(filter $(DEB_HOST_ARCH),amd64 arm64 armhf i386))
	dh_auto_test --no-parallel
endif

override_dh_install:
	rm -f debian/tmp/usr/lib/*/libnfdump.a
	rm -f debian/tmp/usr/lib/*/libnfdump.la
	# This manpage is installed but not included, as the flow-tools
	# importer is not built anymore
	rm -f debian/tmp/usr/share/man/man1/ft2nfdump.1
	dh_install