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

include /usr/share/dpkg/pkg-info.mk
export DEB_VERSION_UPSTREAM

# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

DKMS_CONFIGURE_OPTIONS=\
 --enable-natevents    \
 --enable-snmp-rules   \
 --enable-macaddress   \
 --enable-vlan         \
 --enable-direction    \
 --enable-sampler      \
 --enable-physdev      \
 --enable-promisc      \
 --promisc-mpls

%:
	dh $@ --with dkms

override_dh_installchangelogs:
	dh_installchangelogs NEWS

override_dh_auto_configure override_dh_auto_build override_dh_auto_install:
	# NOOP

override_dh_dkms:
	sed -e 's/`\.\/version.sh`/$(DEB_VERSION_UPSTREAM)/;s/\.\/configure/.\/configure $(DKMS_CONFIGURE_OPTIONS)/' dkms.conf > debian/dkms
	dh_dkms
