How to setup mock quickly?

How to setup mock quickly?

yum install mock

The default configuration is already set for you:
ls -l /etc/mock/default.cfg

If not then this will do:
sudo ln -s /etc/mock/fedora-15-x86_64.cfg /etc/mock/default.cfg

As is clearly stated in mock(1) man page, you need to add the relevant user to mock group:
sudo /usr/sbin/usermod -a -G mock $USER

Thats all for the setup.

Now lets use it:

mock --init # this populates the build root with the required pacakges and repositories
mock --rebuild hello-2.7-1.fc15.src.rpm # this will do the actuall build with all the build dependencies resolved
mock --shell # enter the mock's chroot shell

For more read here

( it covers many caveats related to mock )

You can build the hello source rpm as described here.

Advertisements