buildsystem: support for older git versions

As older git versions don't support "git rev-list --count" run it with wc instead if needed
buildsystem: support for automated package installation for RedHat (and clones)
Merge pull request #2901 from at-visions/centos

Support for building on RedHat/CentOS