Ok, so how do I start building already?

Now that you know how to read the spec file (in excruciating detail?) and know what to expect during the build, let’s try to actually build one of those packages. The starting point here is just a folder with the spec file and all its sources and patches.

Tip

To get the sources defined externally run spectool -g *.spec.

After making sure you do not have a sources file present next to the spec file, the build process using fedpkg is quite straightforward, simply run

$ fedpkg mockbuild

If you do not want to use any helper scripts to do the building for you, you can invoke the mock build directly from an srpm, i.e. the source rpm, basically just an archive of the spec file and its sources and patches. First to get the srpm you can use fedpkg srpm or mock --buildsrpm [1]

$ mock --buildsrpm --spec *.spec --sources ./ --resultdir results
$ mock ./results/*.src.rpm

If you start from a project that has packit integration you can build the project locally using

$ packit build in-mock

How and why one would setup a packit integration is covered in the automation section.

Please don’t. Although this is the bare core that is used underneath mock, this approach has too many hidden failures and dependencies, e.g. it uses whatever packages and files you have locally.

What should I look out for?

Regardless of how you triggerred the build, you should find the results containing logs (mainly build.log and root.log) regardless if it succeeded or failed, and the .rpm artifacts only if it was successful.

You might encounter numerous failures that you should have some basic knowledge of the build system in order to be able to debug. For some of the common build failures, please check the build FAQ.

I need to build multiple packages depending on each other

Wow you are quite ahead of the curve :). The workflows for building multiple packages is much more limited and primarily found in the automation section. For building locally you have a few options

The official support for multi-package build here is using chain-build, but that requires already being a packager and knowing how to build with koji, which is out of scope here. Another option is to do the builds manually one after another and reusing the rpm files

$ fedpkg mockbuild --extra-pkgs results/*.rpm

After building all the srpm manually you can do a chain build them using --chain

$ mock --chain /path/to/first.src.rpm /path/to/second.src.rpm