If you encounter a bug running mock, please file it in [https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=mock Bugzilla], product "Fedora", component mock ([https://bugzilla.redhat.com/buglist.cgi?query_format=advanced&product=Fedora&component=mock&bug_status=NEW&bug_status=ASSIGNED&bug_status=MODIFIED&bug_status=ON_DEV&bug_status=ON_QA&bug_status=VERIFIED&bug_status=FAILS_QA&bug_status=RELEASE_PENDING&bug_status=POST Open Bugs]).

+

+

If your problem is specific to EPEL, then [https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora%20EPEL&component=mock file it] against the "Fedora EPEL" product instead ([https://bugzilla.redhat.com/buglist.cgi?query_format=advanced&product=Fedora%20EPEL&component=mock&bug_status=NEW&bug_status=ASSIGNED&bug_status=MODIFIED&bug_status=ON_DEV&bug_status=ON_QA&bug_status=VERIFIED&bug_status=FAILS_QA&bug_status=RELEASE_PENDING&bug_status=POST Open Bugs]).

Download

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 Mock outside your CVS sandbox

Create your srpm using 'rpmbuild -bs'. Then change to the directory where your srpm was created.

Now you can start mock with

mock -r <configfile> rebuild package-1.2-3.src.rpm

where <configfile> is the name of a configuration from /etc/mock/.

If using mock version older than 0.8.8 or on a system with python 2.4, and building i386 packages on x86_64, prepend setarch i386 to the mock command line: setarch i386 mock -r <configfile> rebuild package-1.2-3.src.rpm. Newer versions of mock no longer need the setarch command, although it does not hurt anything if it is there.

Note that you can track the progress of mock using the logs stored in /var/lib/mock/<configfile>/result

Using Mock inside your CVS sandbox

You only need to type 'make mockbuild' to start a mock build. The used architecture depends on the directory where you start the mock build.

Security Considerations

Build User

It's recommended you use a user account other than your normal user account to do the builds, just to be safe. You wouldn't want the build user to "accidentally" have access to your GPG or SSH keys.

To create the user, and put them into the mock group, run:

* adduser -m -G mock build

Then remember to su - build prior to running mock.

Untrusted Users Using Mock

Beware that adding a user to the mock group means that the user can easily get root access on the machine without providing a password: