Mock

Mock creates chroots and builds packages in them. Its only task is to reliably populate a chroot and attempt to build a package in that chroot.

Status

Download

To check out the current code:

Setup

All users that are to use mock must be added to the mock group.

Configuration files are in /etc/mock. Mock versions 0.8.0 and higher cache the downloaded rpm packages (via the yum_cache plugin), which speeds up subsequent builds by a considerable margin. Nevertheless, you may wish to change the default configuration to point to local repositories to speed up builds.

By default, builds are done in /var/lib/mock, so be sure you have room. Starting with mock 0.8.0 and higher, you can change this via the 'basedir' config option.

Using

For example, to rebuild a package for i386 on the development branch of Fedora:

See /etc/mock for the available targets. If you have the bash-completion package installed, it will tab complete the targets for you.

Problems

If you encounter a bug running mock, please file it in Bugzilla, product "Fedora Hosted Projects", component mock.

See Also

Extras/MockTricks has some useful tips for using mock.
Docs/Drafts/MockSetupUsingLocalMirror Setting up a local mirror using Mock.
Legacy/Mock has some useful tips for building packages in mock for older Fedora and Red Hat Linux releases.