I have made a package in Arch Linux by using the PKGBUILD and makepkg method. So the file is a .pkg.tar.xz format. My goal is to be able to somehow convert this package to a format compatible with other Linux flavors (such as centOS) so I can install it on them as well. Is there a good way to do this? Or is there another method that any of you suggest?
There is no clear way to "convert" Arch Linux packages into CentOS packages. The best thing you can do is to follow this ArchWiki guide on how to create packages to other distributions from inside Arch.
Depending on what distribution it is, the technique will change like using virtualization or chroot. If you take a look at the wiki you will see that on specific Fedora/CentOS cases, it involves installing
rpm-org from AUR and create a
chroot environment to put all needed packages inside.
But, there is no way to directly convert