As an FYI, at its core Flatpak is just a manager for an OSTree repo with some special metadata attached. This means that there can be multiple ways to build Flatpaks. You can:
- Use
flatpak build* commands directly, which will manage a build tree and write out the metadata files. AFAIK the below two tools are just wrappers over this.
- Use flatpak-builder, which is a program that takes in a manifest file with build instructions and automatically builds everything. This is how most Flatpaks are built, including all the ones on Flathub.
- Use flatpak-module, which is how all the Fedora Flatpaks are built. It basically integrates Flatpaks with Fedora Modularity AFAIK and also uses a different build specification than flatpak-builder.
Now, with that explanation in mind, back to the original question: the Fedora docs have a guide for this here that’s likely what you want.