.TH "mock" "1" "0.7" "Seth Vidal" "" .SH "NAME" .LP mock \- build SRPMs in a chroot .SH "SYNTAX" .LP mock [options] \fB\-\-rebuild\fR \fISRPM [\fISRPM...\fR] .LP mock [options] \fB\-\-chroot\fR \fI\fR .LP mock [options] {\fB\-\-init\fR|\fBclean\fR|\fBshell\fR} .LP mock [options] \fB\-\-installdeps\fR {SRPM|RPM} .LP mock [options] \fB\-\-install\fR PACKAGE .LP mock [options] \fB\-\-orphanskill\fR .SH "DESCRIPTION" .LP Mock is a simple program that will build source RPMs inside a chroot. It doesn't 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. .LP The content of a chroot is specified by the configuration specified with the \fB\-r\fR option. The default configuration file is /etc/mock/default.cfg, which is usually a symlink to one of the installed configurations. .LP There is a site-wide configuration file, /etc/mock/defaults.cfg, which can be used to specify site-wide options. The shipped version of this file has no active options, but does have a list of all of the configuration options, examples of how to set them, and their default values. .LP For backwards compatibility, old-style commands, ("rebuild", "init", "clean", etc.) without leading '\-\-' are still accepted, but are deprecated. See COMMANDS section, below, for detailed listing of all commands. .SH "OPTIONS" .LP .TP \fB\-r\fR \fICHROOT\fP Uses specified chroot configuration as defined in /etc/mock/<\fIchroot\fP>.cfg. If none specified, uses the chroot linked to by /etc/mock/default.cfg .TP \fB\-\-offline\fR Run in 'offline' mode where we tell 'yum' to run completely from local cache. Also disables cache expiry for the mock yum cache. .TP \fB\-\-no\-clean\fR Do not clean chroot before building package. .TP \fB\-\-cleanup\-after\fR Clean chroot after building. Use with \-\-resultdir. Only active for '\-\-rebuild'. .TP \fB\-\-no\-cleanup\-after\fR Dont clean chroot after building. If automatic cleanup is enabled, use this to disable. .TP \fB\-\-arch=\fR\fIARCH\fP Specify target build arch. .TP \fB\-\-define=\fR"\fIMACRO EXPR\fP" Specify macro definitions used for the build. This option may be used multiple times, just as the rpmbuild \-\-define option can be. For example: \fB\-\-define "with_extra_cheese 1" \-\-define="packager Monkey"\fR .TP \fB\-\-with=\fR\fIOPTION\fP Enable configure OPTION for build. This option may be used multiple times. For example: \fB\-\-with extra_cheese\fR .TP \fB\-\-without=\fR\fIOPTION\fP Disable configure OPTION for build. This option may be used multiple times. For example: \fB\-\-without anchovies\fR .TP \fB\-\-resultdir=\fR\fIRESULTDIR\fP Change directory where resulting files (RPMs and build logs) are written. Resultdir can contain python-string substitutions for any variable in the chroot config. For example: \fB\-\-resultdir=./my/"%(dist)s"/"%(target_arch)s"/\fR .TP \fB\-\-uniqueext=\fR\fItext\fP Arbitrary, unique extension to append to buildroot directory name .TP \fB\-\-configdir=\fR\fICONFIGDIR\fP Change directory where config files are found .TP \fB\-\-rpmbuild_timeout=\fR\fISECONDS\fP Fail build if rpmbuild takes longer than 'timeout' seconds .TP \fB\-\-help\fR Show usage information and exit. .TP \fB\-\-version\fR Show version number and exit. .SH "COMMANDS" .LP .TP \fB\-\-clean\fR \- purge the chroot tree .TP \fB\-\-init\fR \- initialize a chroot (clean, install chroot packages, etc.) .TP \fB\-\-rebuild\fR \- If no command is specified, rebuild is assumed. Rebuilds the specified SRPM(s). The buildroot is cleaned first, unless --no-clean is specified. .TP \fB\-\-shell\fR \- run the specified command interactively within the chroot (which must already be initialized -- no 'clean' is performed). If no command specified, /bin/sh is run. .TP \fB\-\-chroot\fR \- run the specified command non-interactively within the chroot (which must already be initialized -- no 'clean' is performed). Command output will be sent to the log files. .TP \fB\-\-installdeps\fR \- find out deps for SRPM or RPM, and do a yum install to put them in the buildroot. Buildroot must already be initialized -- no 'clean' is performed .TP \fB\-\-install\fR \- Do a yum install PACKAGE inside the buildroot. Buildroot must already be initialized -- no 'clean' is performed .TP \fB\-\-orphanskill\fP Noop mode that simply checks that no stray processes are running in the chroot. Kills any processes that it finds using specified root. .SH "FILES" .LP \fI/etc/mock/\fP \- default configuration directory .LP \fI/var/lib/mock\fP \- directory where chroots are created .SH "EXAMPLES" .LP To rebuild test.src.rpm under the default chroot: .LP .RS 5 \fBmock --rebuild /path/to/test.src.rpm\fR .RE .LP To specify a different chroot (which must be defined in /etc/mock): .LP .RS 5 \fBmock \-r fedora\-8\-i386\-core --rebuild /path/to/test.src.rpm\fR .RE .SH "BUGS" .LP To report bugs in mock, go to: .LP .RS 5 \fIhttp://bugzilla.redhat.com/bugzilla\fR. .RE .LP Select the query option, using product \fBFedora Hosted Projects\fR and component \fBmock\fR and press the \fBStart Search\fR button. If there is a bug similar to the one you are seeing, add your information to the comments. If not, go to the new bug page using the same product and component and fill in the form. .SH "AUTHORS" .LP Michael Brown .LP Clark Williams .LP Seth Vidal .LP and a cast of...tens .SH "SEE ALSO" .LP yum(8) rpmbuild(8) http://fedoraproject.org/wiki/Projects/Mock