This makes build "scripts" not tied to Fedora-specific files. Especially ease porting to other platforms.
Still not all code migrated, added appropriate TODO/FIXME comments.