#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

export DKMS_NAME=saa716x
export DKMS_VERSION=0.1
export KERNEL=$(shell uname -r | cut -d'.' -f1)
export SOURCE=$(DKMS_NAME)-$(DKMS_VERSION)

%:
	dh $@

override_dh_auto_configure:
	chmod a+x $(DKMS_NAME)-$(DKMS_VERSION)/make.sh
	if [ $(KERNEL) -gt 4 ]; \
	then sed -i "s/common/pci/g" $(SOURCE)/dkms.conf; \
	else sed -i "s/pci/common/g" $(DKMS_NAME)-$(DKMS_VERSION)/dkms.conf; \
	fi
	true
