The Mock command uses rpmbuild and a changeroot to emulate building on different architetures(or the same) and in a clean environment. This is especially useful to find out what BuildRequires are needed inside your spec file.
Step 1: Install the mock command
yum install mock
Add user to mock group
usermod -a -G mock username
logoff the user and login again
Begin using mock!
Before using mock:
The first steps to using mock are making sure your SRPM’s are error free, by using the command rpmlint
1 packages and 0 specfiles checked; 0 errors, 0 warnings.
If you find errors, then fix them before continuing.
Running the mock command
mock -r fedora-18-x86_64 ~/rpmbuild/SRPMS/units-2.00-1.fc17.src.rpm
In this case, no errors came up and it finished successfully in 28 seconds(though this depends on your connection, had one that took 7 minutes). Logs are inside the /var/lib/mock/fedora-18-x86_64/result/ folder.