#!/usr/bin/make -f

# The DKMS module version is the upstream part of the package version.
VERSION := $(shell dpkg-parsechangelog -SVersion | sed -e 's/[~+-].*//')
SRC := debian/removablefs-dkms/usr/src/removablefs-$(VERSION)

%:
	dh $@

# Nothing to build here: DKMS builds the module on the target system.
override_dh_auto_build override_dh_auto_test override_dh_auto_install override_dh_auto_clean:

override_dh_install:
	install -d $(SRC)
	install -m 0644 module/*.c module/*.h module/Kbuild module/Makefile module/dkms.conf $(SRC)/
	install -m 0755 module/configure $(SRC)/
	dh_install

override_dh_dkms:
	dh_dkms -p removablefs-dkms -V $(VERSION) -- module/dkms.conf

override_dh_installudev:
	cp data/udev/85-removablefs.rules debian/removablefs.udev
	dh_installudev -p removablefs --priority=85

override_dh_clean:
	dh_clean debian/removablefs.udev
