DKMS Howto
From Kyle's Wiki
Prerequisites
apt-get install debhelper dkms kernel-headers
How To
1. Untar the source code into /usr/src/$modulename-$version
2. Make a dkms.conf inside that folder like this:
MAKE="make -C src/ KERNELDIR=/lib/modules/${kernelver}/build" CLEAN="make -C src/ clean" BUILT_MODULE_NAME=$module_name BUILT_MODULE_LOCATION=src/ DEST_MODULE_LOCATION="/updates" PACKAGE_NAME=$modulename-dkms PACKAGE_VERSION=$module_version REMAKE_INITRD=no
3. Add it:
dkms add -m $module_name -v $module_version
4. Build it:
dkms build -m $module_name -v $module_version
5. Make src deb:
dkms mkdsc -m $module_name -v $module_version --source-only
6. Make deb:
dkms mkdeb -m $module_name -v $module_version --source-only
7. Clean up:
cp /var/lib/dkms/$module_name/$module_version/deb/$module_name-dkms_$module_version_all.deb ~ && rm -r /var/lib/dkms/$module_name
8. Install package / distribute:
dpkg -i ~/$module_name-dkms_$module_version_all.deb