move checking if centos libyaml-devel package is available to common function