Post details: Using mock to build RHEL packages

09/19/06

Permalink 04:04:38 am, Categories: Programming, 201 words  

Using mock to build RHEL packages

Mock, the Fedora tool for maintaining standard buildroots and building rpm's in them, can also be used to build packages for Red Hat Enterprise Linux (RHEL).

As an example, to create a mock buildroot for RHEL4, you need to:

  • Create a yum repository with the RPM's for RHEL4 in them. One way to do that is to download the ISO files for RHEL4 from RHN and copy the RPM's from them into a new directory and run createrepo on that directory. There are also tools out there to help with that, e.g. Yam.
  • Create a second yum repository for the mock-specific RPM's for a buildroot. These are buildsys-build , which defines what RPM's make up the initial or 'minimal' build root, and buildsys-macros, which defines the %dist and %rhel macros, similar to the same package for Fedora. (An unmaintained example for such a repo can be found here)
  • Download the mock config file and adapt it to your local needs, in particular adjust the URL's for the yum repos in it.

If you want to rebuild buildsys-build and buildsys-macros from their specfiles, note that you need to define the %rhel macro on the command line like

  rpmbuild --define 'rhel 4' buildsys-build.spec
Permalink

Comments:

No Comments for this post yet...

Comments are closed for this post.

Search

Syndicate this blog XML

What is RSS?

Misc

powered by
b2evolution