summaryrefslogtreecommitdiff
path: root/build.1
blob: 53cfcea879d8ad95cf5b718bff633c20b1fbfab0 (plain)
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
.de TQ \"follow a TP item with several TQ items to define several
.      \"entities with one shared description.
.br
.ns
.TP \\$1
..
.TH build 1 "(c) 1997-2008 SuSE Linux AG Nuernberg, Germany"
.SH NAME
build \- build SuSE Linux RPMs in a chroot environment
.SH SYNOPSIS
.B build
.RB [ --clean | --no-init]
.RB [ --rpms
.IR path1 : path2 : ... ]
.RB [ --arch
.IR arch1 : arch2 : ... ]
.RB [ --root
.IR buildroot ]
.RB [ specfile | srcrpm ]
.br
.B build
.B --help
.br
.B build
.B --verify
.SH DESCRIPTION
\fBbuild\fR is a tool to build SuSE Linux RPMs in a safe and clean way.
.B build
will install a minimal SuSE Linux as build system into some directory
and will chroot to this system to compile the package.
This way you don't risk to corrupt your working system (due to a broken spec
file for example), even if the package does not use BuildRoot.

.B build
searches the spec file for a
.I BuildRequires:
line; if such a line is found, all the specified rpms are installed.
Otherwise a selection of default packages are used. Note that
.B build
doesn't automatically resolve missing dependencies, so the specified
rpms have to be sufficient for the build.
.P
If a spec file is specified on the command line,
.B build
will use this file and all other files in the directory for building
the package. If a srcrpm is specified,
.B build
automatically unpacks it for the build.
If neither is given,
.B build
will use all the specfiles in the current directory.
.P
.SH OPTIONS
.TP
.B --clean
remove the build system and reinitialize it from scratch.
.TP
.B --no-init
skip the build system initialization and start with build immediately.
.TP
.B --list-state
list rpms that would be used to create a fresh build root.
Does not create the build root or perform a build.
.TP
.BI "\-\-rpms " path1 : path2 : path3\fR...\fP
Where build can find the SuSE Linux RPMs needed to create the
build system. This option overrides the BUILD_RPMS environment
variable.
.TP
.BI "\-\-arch " arch1 : arch2 : arch3\fR...\fP
What architectures to select from the RPMs.
.B build
automatically sets this to a sensible value for your host if you
don't specify this option.
.TP
.BI "\-\-repo " url_or_dir
Also use the specified repository to create the build system.
The repositories may be either of type rpmmd, yast2 (susetags),
or a simple directory. Multiple --repo options may be given.
As a special form, 'zypp://reponame' can be used to specify
a system repository. 'zypp://' selects all enabled system
repositories. This is also the default if BUILD_RPMS is not
set and no --rpms or --repo option is used.
.TP
.BI "\-\-root " buildroot
Specifies where the build system is set up. Overrides the
BUILD_ROOT enviroment variable.
.TP
.B --useusedforbuild
Tell build not to do dependency expansion, but to extract the
list of packages to install from "# usedforbuild" lines or, if none
are found, from all "BuildRequires" lines.  This option is useful
if you want to re-build a package from a srcrpm with exactly the
same packages used for the srcrpm build.
.TP
.B --norootforbuild

.TP
.B --help
Print a short help text.
.TP
.B --verify
verify the files in an existing build system.
.TP
.BI "\-\--dist " distribution
Set the distribution. If this option is not given, build tries to
calculate the distribution by looking at the rpm package used in the
build.
The specified distribution can either be a string
like "11.2" or "sles9", or the pathname of the build configuration to
use.

.SH .spec FILE OPTIONS
The
.B build
command interprets some special control comments in the specfile:
.TP
.B # norootforbuild
.TQ
.B # needsrootforbuild
.B build
uses either user
.I root
or user
.I abuild
in the build system to do the build.  For non-SUSE distros as well as
since SUSE 10.2, the default build user is
.I abuild.
For 10.2 and before, the default build user is
.I root.
These two flags in the spec file allow to deviate from the defaults
and force-set the build user to
.I abuild
and
.I root
.RI "(for " "#\ norootforbuild" " and " "#\ needsrootforbuild" " respectively."
.TP
.B # needsbinariesforbuild
provide the binary rpms that have been used to set up the build root
in
.I /.build.binaries
within the build root.
.SH ENVIRONMENT
.TP
.B BUILD_ROOT
The directory where build should install the chrooted build system.
"/var/tmp/build-root" is used by default.
.TP
.B BUILD_RPMS
Where build can find the SuSE Linux RPMs.  build needs them to create the
build system.
.TP
.B BUILD_RPM_BUILD_STAGE
The rpm build stage (-ba, -bb, ...).  This is just passed through to
rpm, check the rpm manpage for a complete list and descriptions.
"-ba" is the default.
You can use this to add more options to RPM.

.SH SEE ALSO
.BR rpm (8),
.TP
.BR "Maximum RPM":
.I http://www.rpm.org/max-rpm/
.TP
.BR "cross distribution packaging":
.I http://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto
.TP
.BR "openSUSE packaging standards and guidelines":
.I http://en.opensuse.org/Portal:Packaging