How can one use DKMS to build a proper debian source package? The ‘mkdsc’ command will actually generate one automatically, but there are a few more steps to simplify it, and bring it up to date.
First follow the steps in  for setting up a DKMS package. Make sure you can build it using dkms. Then do the following:
If we run debuild -uc -us, we see a few lintian errors and warnings:
The errors are normal, and if this was a real package those will be taken care of since that information will need to be filled in anyway.
To address the executable issues, just chmod -x those files.
To address some of the other issues, we can just completely modify and change the rules file. Because debhelper has a helper for DKMS specifically we should use it.
In addition, if we do something like dch -i you’ll notice some errors, since our source directory is hardcoded to hello-0.1. So we can modify it to be in a ‘src’ directory and get around this.
Now there are some things that can be removed from the package completely:
Now to update the control file to use modern versions, a proper description, and make yourself a maintainer!
Now debuild -uc -us and fix remaining issues.