#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

name = bbswitch
# Parse the package version from the changelog, "borrowed" from acpi_call
version := $(shell dpkg-parsechangelog | grep '^Version:' | cut -d' ' -f2 |\
 rev | cut -d- -f2- | rev | cut -d':' -f2)

%:
	dh $@ --with dkms

build:

override_dh_auto_clean:

override_dh_auto_build:

override_dh_dkms:
	dh_dkms -p$(name)-dkms -V $(version)

override_dh_auto_install:
	# bbswitch-dkms
	dh_installdirs -p$(name)-dkms usr/src/$(name)-$(version)
	dh_install -p$(name)-dkms Makefile usr/src/$(name)-$(version)
	dh_install -p$(name)-dkms bbswitch.c usr/src/$(name)-$(version)

override_dh_installchangelogs:
	dh_installchangelogs NEWS
