This is one of the items embedded Linux development using Yocto has particulary well covered.
It checks every license for every package and you can ask it to verify the checksum of the license file. If the license changes after upgrading a package, you'll get a build error.