a distribution-correct way to build MariaDB on FreeBSD is from the port collection. We should try to build our packages in a compatible way, ideally - from the port collection.
It can be done by uploading a source tarball on freebsd where a port expects it to see. And building from there, disabling distinfo checks (sha2/filesize checks for tarball).
Additionally we should try to integrate as many freebsd mariadb patches as possible.