NAME

lcfg-mock - An LCFG component to manage the mock build tool

DESCRIPTION

Mock is a simple program that will build source RPMs inside a chroot. It does not do anything terribly fancy other than populate a chroot with the contents specified by a configuration file, then build any input SRPM(s) in that chroot.

This is an LCFG component to manage the configuration files for the mock build tool. That is, it configures some options in /etc/mock/site-defaults.cfg and the specific configuration file for each chroot. It does not attempt to manage all possible options, just those which are most likely to need modification. If you have any more options which require configuration get in touch with the component author.

RESOURCES

basedir

This is the directory where mock creates the chroots. You will want this to somewhere with a reasonable amount of free disk space. It defaults to /var/lib/mock.

configdir

This is the mock configuration directory. The default is /etc/mock, it is unlikely that this will need to be altered.

cache_topdir

This is the directory where mock caches packages pulled in with yum and also the gzipped tar file for each chroot. Again, this should be located somwhere with a good amount of free disk space. It defaults to being <%mock.basedir%>/cache

createrepo_command

This is the command to be used to run createrepo on the build results directory. If this resource is not set then mock will not run createrepo at all.

rpmbuild_timeout

This is an integer representing the maximum amount of time which rpmbuild should be allowed to run. This provides the ability to kill runaway builds. If set to zero then no timeout will be applied. The default value is 0.

buildgroup

Any user wanting to use mock to do builds must be a member of this group. By default this is mock.

yum_plugins

This is a boolean value which controls whether yum plugins should be enabled. The default value is false.

repositories

This is a list of tags representing the global package repositories. It is not necessary to add anything to this resource, a list of repositories can be configured directly in the chroot resources. Adding repositories to this list does nothing to the mock configuration files, repository tags must be added to the repos resource for a chroot. When a repository is added to a particular chroot any resource can be overridden for that particular chroot. The following resources can be set for each repository:

reponame_repository

This is the longer, descriptive, name for the repository. You do not normally need to set this, it defaults to the repository tag name.

baseurl_repository

This is the URL to the packages repository. This must be specified. See the yum.conf man page for full details.

exclude_repository

This is a list of packages from the repository which should not be used. See the yum.conf man page for full details.

priority_repository

This is a numerical priority for the particular repository. If set this must be an integer in the range between 1 and 99. Repositories with a lower number have a higher priority. This will only have an effect if the yum_plugins resource is enabled. On Fedora this is handled by the yum-plugin-priorities package, on RHEL5 this is handled by the yum-priorities package.

chroots

This is a list of tags representing the chroots you want to be configured. The following resources can be set for each chroot:

chrtname_chroot

The name for the chroot, you only need to set this if you want characters (such as hyphen) in the name which are not valid LCFG tag names. If it is not set the tag name is used. This is the name which users will use to identify the target chroot through the -r option for mock.

basearch_chroot

The base architecture for the chroot (e.g. i386 or x86_64).

dist_chroot

The mock dist configuration option, only useful for --resultdir variable substitution.

resultdir_chroot

The directory into which the built packages will be placed. You can get mock to run createrepo on this directory and then use it as a yum repository in future builds. The component will ensure the directory exists and has the correct mode, uid and gid.

setup_chroot

This is the chroot_setup_cmd for the chroot, the default is groupinstall buildsys-build. This only needs to be changed for older distros (e.g. RHEL5).

ccache_ccache

This is a boolean value which can be used to enable the ccache plugin. By default it is true, older distros (e.g. RHEL5) will need this turned off.

repos_chroot

A list of yum repositories for this chroot. This list can include tags which are in the repositories list and also repositories which are specific to this chroot. When using repositories in the global list you can override the various resources for that repository within this chroot configuration. The following resources are available:

reponame_chroot_repo

The longer, descriptive, name for the repository. If not set the chroot tag name will be used.

baseurl_chroot_repo

A specific baseurl yum setting for this repository. See the yum.conf manual page for full details.

exclude_chroot_repo

A space-separated list of yum exclusions, useful for preventing packages being pulled in from the wrong repository. See the yum.conf manual page for full details.

priority_chroot_repo

This is a numerical priority for the particular repository. If set this must be an integer in the range between 1 and 99. Repositories with a lower number have a higher priority. This will only have an effect if the yum_plugins resource is enabled. On Fedora this is handled by the yum-plugin-priorities package, on RHEL5 this is handled by the yum-priorities package.

chroot_template

This is the path to the template used to generate the mock chroot configuration files. The default is /usr/lib/lcfg/conf/mock/mock-cfg.tt

defaults_template

This is the path to the template used to generate the site defaults configuration file for mock. The default is /usr/lib/lcfg/conf/mock/mock-default.tt

DEPENDENCIES

This is an LCFG component module and as such it requires LCFG::Component and LCFG::Template. The templates were written using the Perl Template Toolkit so you will also need that installed. The module also requires File::Find::Rule, List::MoreUtils and Readonly.

PLATFORMS

This is the list of platforms on which we have tested this software. We expect this software to work on any Redhat/Fedora platform which is supported by Perl.

Fedora13, Scientific5

BUGS AND LIMITATIONS

Please report any bugs or problems (or praise!) to bugs@lcfg.org, feedback and patches are also always very welcome.

AUTHOR

Stephen Quinney <squinney@inf.ed.ac.uk>

LICENSE

Copyright (C) 2011 University of Edinburgh. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GPL, version 2 or later.