Building Fedora modules locally

This page walks you through building modules locally on your machine.

Prerequisites

You need to install the module-build-service as well as fedpkg:

$ sudo dnf install module-build-service fedpkg

and add yourself to the mock group:

$ sudo usermod -a -G mock USERNAME
$ newgrp

Step 1: Build your module

Local builds are started using fedpkg from within your dist-git repository.

For example, to submit a build of the testmodule:master module, run:

Local builds don’t support stream expansion. If your module depends on multiple streams of another module, such as platform, you need to specify what stream you want to build against. For example: fedpkg module-build-local -s platform:f28.
$ fedpkg clone modules/testmodule
$ cd testmodule
$ git checkout master
$ fedpkg module-build-local

When the build finishes, you’ll be able to find the results in:

~/modulebuild/builds/MODULE/results/

where MODULE is "module-NAME-STREAM-VERSION", so for example "module-testmodule-master-20180612122805".

Step 2: Test your module

This requires Fedora 28 or higher.

To test your module, add the repository to your system by creating an entry similar to this in /etc/yum.repos.d/test.repo:

[local]
name=My Local Repository
baseurl=file:///home/adam/modulebuild/builds/module-testmodule-master-20180612122805/results/
gpgcheck=0
enabled=1

Please replace "adam" with your user name, and "module-testmodule-master-20180612122805" with the actual value for your module.

Now, when you list the available modules on your system, you should be able to see it and install it:

$ dnf module list
$ dnf module install testmodule:master