The goal is rebuilding SRPM (Source RPM) from official Fedora’s SRPM. Why would I need to rebuild? First the new SRPM is different than original SRPM, I may modify the SPEC or bump with new version source tarball. Once I get the new SRPM, I then build it with mock.

1   Setting up the environment

This is easy, just


# as root
yum install rpmdevtools
# as you
rpmdev-setuptree

Then, you will have ~/.rpmmacros and ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}.

2   Installing SRPM as normal user

Run the following as normal user:


`rpm -i gcalctool-5.24.3-1.fc10.src.rpm

You may see the following messages:


warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
[snip]

Just ignore it, you should have files in ~/rpmbuild.

3   Modifying and building

Now, you can modify the SPEC or put on latest tarball. After the modification, run:


cd ~/rpmbuild/SPECS ; rpmbuild -bs gcalctool.spec

Here we only build the SRPM, we then build RPM from it with mock, you can read Rebuilding RPM from SRPM with mock on Fedora.