adjusted to support other platorms like Gentoo