From Fedora Project Wiki

Simple RPM builds from SRPM - command sequence

This tutorial assumes you have a file containing sources of RPM package (file with .src.rpm extension) and you want to build binary RPM which you can then install.

There are several ways how to build srpm. Let's take a look at some of them.

Using rpmbuild

# yum install rpm-build yum-utils
# su - <user>
$ rpm -i <package>.src.rpm
$ cd ~/rpmbuild/SPECS
$ sudo yum-builddep <package>.spec
$ rpmbuild -ba <package>.spec                          # now your rpms are in ../RPMS and src.rpm in ../SRPMS

Using mock

# yum install mock
# usermod -a -G mock <user>
# su - <user>
# mock -r CONFIG_FILE <package>.src.rpm                # mock will tell you where your packages are

Using COPR


Details and description