Hello everyone.
I wrote dh_splitpackage, a helper script that unambiguously splits the files of a binary package into multiple packages based on a configuration file.
The configuration file may point the primary package (the one that gets leftover files by default) as well as any number of additional packages with any number of inclusion and exclusion patterns.
The new script can be called instead of dh_install (assuming all the files you are interested in are already in debian/tmp/) or afterwards.
The biggest advantage compared to existing tools is clear and not-that-error-prone classification of files to packages. Any file that would be classified to more than one package (hitting patterns in both files) is clearly reported and prevents the package from building properly. In addition running the script displays each file from debian/tmp and the package it was classified to.
Using this script could greatly simplify many packages that currently rely on numerous *.install files and custom dh_install overrides in debian/rules.
You can find the code at lp:~zkrynicki/+junk/dh_splitpackage (tag: release-0.1) The source tree also includes debian packaging that makes use of the new script.
Best regards Zygmunt Krynicki