build: reimplement the OSS checks using a more declarative approach

Hello people, this is a tentative re-implementation of the OSS checks. I implemented the checks starting from @bugmen0t pseudo-code in ticket #359.

Please test this out on your OS and report if it breaks / works.