File: mock.1

package info (click to toggle)
mock 1.1.33-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,460 kB
  • ctags: 318
  • sloc: sh: 9,302; python: 3,097; makefile: 128
file content (255 lines) | stat: -rw-r--r-- 9,311 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
.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\-\-buildsrpm\fR {\-\-spec \fIspec\fR \-\-sources \fIsrc\fR | \-\-scm\-enable}
.LP
mock  [options] \fB\-\-chroot\fR \fI<cmd>\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\-\-update\fR
.LP
mock  [options] \fB\-\-remove\fR PACKAGE
.LP
mock  [options] \fB\-\-orphanskill\fR
.LP
mock  [options] \fB\-\-copyin\fR \fIpath [\fIpath...\fR] \fIdestination\fR
.LP
mock  [options] \fB\-\-copyout\fR \fIpath [\fIpath...\fR] \fIdestination\fR
.LP
mock  [options] \fB\-\-scm-enable\fR [\fI--scm-option key=value ...\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/site-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.
.LP
To use mock, a user should become a member of the \fBmock\fR group by
adding their username to the \fBmock\fR line in /etc/group. This can
be done with the following command:
.P
        \fBsudo /usr/sbin/usermod \-a \-G mock $USER\fR

Note that mock is not intended to be run directly as root.

.SH "COMMANDS"
.LP
.TP
\fB\-\-clean\fP
Purge the chroot tree.
.TP
\fB\-\-scrub=\fR\fITYPE\fP
Completely remove the specified chroot or cache dir or all of the chroot and cache.  \fITYPE\fR is one of all, chroot, cache, root-cache, c-cache, or yum-cache.
.TP
\fB\-\-init\fP
Initialize a chroot (clean, install chroot packages, etc.)
.TP
\fB\-\-rebuild\fP
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\-\-buildsrpm\fP
Builds the specified SRPM either from a spec file and source file/directory or from SCM. The buildroot is cleaned first, unless \-\-no\-clean is specified.
.TP
\fB\-\-shell\fP
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\fP 
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\fP 
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\fP
Do a yum install PACKAGE inside the buildroot. Buildroot must already be initialized -- no 'clean' is performed
.TP
\fB\-\-update\fP 
Do a yum update inside the buildroot. Buildroot must already be initialized -- no 'clean' is performed
.TP
\fB\-\-remove\fP 
Do a yum remove PACKAGE inside the buildroot. Buildroot must already be initialized -- no 'clean' is performed
.TP
\fB\-\-orphanskill\fP
No-op mode that simply checks that no stray processes are running in the chroot. Kills any processes that it finds using specified root.
.TP
\fB\-\-copyin\fP
Copies the source paths (files or directory trees) into the chroot at
the specified destination path. 
.TP
\fB\-\-copyout\fP
Copies the source paths (files or directory trees) from the chroot to
the specified destination path. 
.TP
\fB\-\-scm-enable\fP
Enable building from an SCM (CVS/Git/SVN). The SCM repository must be
configured in site-defaults.cfg before SCM checkouts are possible. SCM
package and branch can be defined with \fB\-\-scm-option\fP arguments,
see site-defaults.cfg for more information.


.SH "OPTIONS"
.LP
.TP
\fB\-r\fR \fICHROOT\fP, \fB\-\-root\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
Don't clean chroot after building. If automatic cleanup is enabled, use this to disable.
.TP
\fB\-\-cache\-alterations\fR
Rebuild the root cache after making alterations to the chroot (i.e. \-\-install). Only useful when using tmpfs plugin.
.TP
\fB\-\-target=\fR\fIARCH\fP
This argument is passed to rpmbuild to specify the target arch to build. It defaults to whatever is specified for \-\-arch, or whatever is specified in the config file as config_opts['target_arch'].
.TP
\fB\-\-arch=\fR\fIARCH\fP
Calls the linux personality() syscall to tell the kernel to emulate a secondary architecture. For example, building i386 packages on an x86_64 buildhost.
.TP
\fB\-D \fR"\fIMACRO EXPR\fP", \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\-\-unpriv\fR
Drop privileges before running command when using \-\-chroot
.TP
\fB\-\-cwd=\fR\fIDIR\fP
Change to the specified directory (relative to the chroot) before running command when using \-\-chroot
.TP
\fB\-q\fR, \fB\-\-quiet\fR
Be quiet.
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Output verbose progress information.
.TP
\fB\-\-trace\fR
Enables verbose tracing of function enter/exit with function arguments and return codes. Useful for debugging mock itself.
.TP
\fB\-\-enable\-plugin=\fR\fIPLUGIN\fP
Enable the specified plugin.  This option may be used multiple times.
.TP
\fB\-\-disable\-plugin=\fR\fIPLUGIN\fP
Disable the specified plugin.  This option may be used multiple times.
.TP
\fB\-\-plugin-option \fR\fIPLUGIN\fR\fB:\fR\fIKEY\fR\fB=\fR\fIVALUE\fP
Set plugin specific parameter. This option may be used multiple times.
.TP
\fB\-h\fR, \fB\-\-help\fR
Show usage information and exit.
.TP
\fB\-\-version\fR
Show version number and exit.


.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 using the Fedora 14 configuration for x86_64
.LP
.RS 5
\fBmock \-r fedora-14-x86_64 \-\-rebuild /path/to/test.src.rpm
.RE
.LP
Note that the available configurations are found in the /etc/mock
directory with the extension .cfg. To specify a configuration use the
filename without the trailing .cfg extension.
.LP
To place the output RPMs and logs in a specified location.
.LP
.RS 5
\fBmock \-r fedora\-14\-i386 \-\-resultdir=./my-results /path/to/your.src.rpm\fR
.RE
.LP
To build a package from the default SCM repository configured in site-defaults.cfg use the following arguments.
.LP
.RS 5
\fBmock \-r fedora\-14\-i386 \-\-scm-enable \-\-scm-option package=pkg\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 <mebrown@michaels-house.net>
.LP
Clark Williams <williams@redhat.com>
.LP
Seth Vidal <skvidal@linux.duke.edu>
.LP
and a cast of...tens
.SH "SEE ALSO"
.LP
yum(8) rpmbuild(8)
http://fedoraproject.org/wiki/Projects/Mock