Home > Uncategorized > Mock and Koji

Mock and Koji

Purpose:

The purpose of this lab is to use and become familiar with the mock and koji tools.

Installation of Mock and Koji:

Mock: Mock is used to test the accuracy of the build dependances for RPMS. Alerting you if your package is missing any.

To get mock, I simply used YUM to grab and install it # yum install mock -y

I then have to add my user account to the mock users group # usermod -G

Koji: Is a build farm system which lets you test your build on different architectures that you might not have an access to.

Koji can be installed with a single step # yum install fedora-packager.

And then run /usr/bin/fedora-packager-setup  which creates the certificates to use Koji.

Using Mock:

In order to use mock, you need to have an SRPM built.

The syntax for using mock is # mock -r <configfile> <SRPMfile>

Here’s an example of one of the mock commands I used:

mock -r fedora-14-i386 rpmbuild/SRPMS/spell-1.1-1.fc15.src.rpm

The results of the mock command are sent to the /var/lib/distribution/result directory.

The distribution is determined by the distribution that was selected when the mock command was entered.

Here is an updated version of my RPM of spell : SPELL


Using Koji:

To build a package using Koji the command syntax is # koji  build dist-f14 –scratch rpmbuild/SRPMS/spell-1.1-1.fc15.src.rpm

The distribution to test the RPM on is F14(Fedora 14(32 and 64bit))

The RPM to be tested is spell-1.1-1.fc15.src.rpm

The –scratch specifies that the build is not committed to the fedora distribution.

Once the distribution has been uploaded to Koji, there will be a link which you can take to view the status of your build on Koji.

Here is one of mine : http://koji.fedoraproject.org/koji/taskinfo?taskID=3407241

The build is listed as closed because it has completed.

There is another method of tracking the status of your Koji build. By simply entering # koji watch-task taskID

Conclusion:

So, my first experience using Mock and Koji were interesting. It was fun to upload and queue my package to the Koji build farm and be able to watch as a host picks up the task and builds it for me.

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: