MariaDB is in Gentoo, so the steps to build it are:
Synchronize your tree with
emerge --sync
Build MariaDB using
emerge mariadb
This page is licensed: CC BY-SA / Gnu FDL