build-system: check match between debian package names and shared object files
Debian names packages containing shared object libraries by adding the major version to the package name.
libfoo1 .deb package, where "1" is the major version.
For libtool's system
current:revision:age, it gets translated into version number
major=current-age, reflecting the fact that ABIs can be backwards compatible. Debian uses major to generate the package name.
Further information can be found in https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release#Versioning-considerations-for-libraries.
Sometimes we incorrectly update LIBVERSION variable in Makefile.am with regards to the debian package name in debian/, and as a result we can end up for instance having a libfoo1 deb package containing a libfoo.0 -> libfoo.0.1.0 library files, which is wrong, since the debian package name should match the installed major version library. See OS#3175 as a real example.
To prevent it, we should add some extra logic/hooks to debian/rules to match filenames being added to a library package are correct regarding its package name.