- support tilde in rpm version comparison
[platform/upstream/build.git] / build.1
1 .de TQ \"follow a TP item with several TQ items to define several
2 .      \"entities with one shared description.
3 .br
4 .ns
5 .TP \\$1
6 ..
7 .TH build 1 "(c) 1997-2008 SuSE Linux AG Nuernberg, Germany"
8 .SH NAME
9 build \- build SuSE Linux RPMs in a chroot environment
10 .SH SYNOPSIS
11 .B build
12 .RB [ --clean | --no-init]
13 .RB [ --rpms
14 .IR path1 : path2 : ... ]
15 .RB [ --arch
16 .IR arch1 : arch2 : ... ]
17 .RB [ --root
18 .IR buildroot ]
19 .RB [ specfile | srcrpm ]
20 .br
21 .B build
22 .B --help
23 .br
24 .B build
25 .B --verify
26 .SH DESCRIPTION
27 \fBbuild\fR is a tool to build SuSE Linux RPMs in a safe and clean way.
28 .B build
29 will install a minimal SuSE Linux as build system into some directory
30 and will chroot to this system to compile the package.
31 This way you don't risk to corrupt your working system (due to a broken spec
32 file for example), even if the package does not use BuildRoot.
33
34 .B build
35 searches the spec file for a
36 .I BuildRequires:
37 line; if such a line is found, all the specified rpms are installed.
38 Otherwise a selection of default packages are used. Note that
39 .B build
40 doesn't automatically resolve missing dependencies, so the specified
41 rpms have to be sufficient for the build.
42 .P
43 If a spec file is specified on the command line,
44 .B build
45 will use this file and all other files in the directory for building
46 the package. If a srcrpm is specified,
47 .B build
48 automatically unpacks it for the build.
49 If neither is given,
50 .B build
51 will use all the specfiles in the current directory.
52 .P
53 .SH OPTIONS
54 .TP
55 .B --clean
56 remove the build system and reinitialize it from scratch.
57 .TP
58 .B --no-init
59 skip the build system initialization and start with build immediately.
60 .TP
61 .B --list-state
62 list rpms that would be used to create a fresh build root.
63 Does not create the build root or perform a build.
64 .TP
65 .BI "\-\-rpms " path1 : path2 : path3\fR...\fP
66 Where build can find the SuSE Linux RPMs needed to create the
67 build system. This option overrides the BUILD_RPMS environment
68 variable.
69 .TP
70 .BI "\-\-arch " arch1 : arch2 : arch3\fR...\fP
71 What architectures to select from the RPMs.
72 .B build
73 automatically sets this to a sensible value for your host if you
74 don't specify this option.
75 .TP
76 .BI "\-\-repo " url_or_dir
77 Also use the specified repository to create the build system.
78 The repositories may be either of type rpmmd, yast2 (susetags),
79 or a simple directory. Multiple --repo options may be given.
80 As a special form, 'zypp://reponame' can be used to specify
81 a system repository. 'zypp://' selects all enabled system
82 repositories. This is also the default if BUILD_RPMS is not
83 set and no --rpms or --repo option is used.
84 .TP
85 .BI "\-\-root " buildroot
86 Specifies where the build system is set up. Overrides the
87 BUILD_ROOT enviroment variable.
88 .TP
89 .B --useusedforbuild
90 Tell build not to do dependency expansion, but to extract the
91 list of packages to install from "# usedforbuild" lines or, if none
92 are found, from all "BuildRequires" lines.  This option is useful
93 if you want to re-build a package from a srcrpm with exactly the
94 same packages used for the srcrpm build.
95 .TP
96 .B --norootforbuild
97
98 .TP
99 .B --help
100 Print a short help text.
101 .TP
102 .B --verify
103 verify the files in an existing build system.
104 .TP
105 .BI "\-\--dist " distribution
106 Set the distribution. If this option is not given, build tries to
107 calculate the distribution by looking at the rpm package used in the
108 build.
109 The specified distribution can either be a string
110 like "11.2" or "sles9", or the pathname of the build configuration to
111 use.
112
113 .SH .spec FILE OPTIONS
114 The
115 .B build
116 command interprets some special control comments in the specfile:
117 .TP
118 .B # norootforbuild
119 .TQ
120 .B # needsrootforbuild
121 .B build
122 uses either user
123 .I root
124 or user
125 .I abuild
126 in the build system to do the build.  For non-SUSE distros as well as
127 since SUSE 10.2, the default build user is
128 .I abuild.
129 For 10.2 and before, the default build user is
130 .I root.
131 These two flags in the spec file allow to deviate from the defaults
132 and force-set the build user to
133 .I abuild
134 and
135 .I root
136 .RI "(for " "#\ norootforbuild" " and " "#\ needsrootforbuild" " respectively."
137 .TP
138 .B # needsbinariesforbuild
139 provide the binary rpms that have been used to set up the build root
140 in
141 .I /.build.binaries
142 within the build root.
143 .SH ENVIRONMENT
144 .TP
145 .B BUILD_ROOT
146 The directory where build should install the chrooted build system.
147 "/var/tmp/build-root" is used by default.
148 .TP
149 .B BUILD_RPMS
150 Where build can find the SuSE Linux RPMs.  build needs them to create the
151 build system.
152 .TP
153 .B BUILD_RPM_BUILD_STAGE
154 The rpm build stage (-ba, -bb, ...).  This is just passed through to
155 rpm, check the rpm manpage for a complete list and descriptions.
156 "-ba" is the default.
157 You can use this to add more options to RPM.
158
159 .SH SEE ALSO
160 .BR rpm (8),
161 .TP
162 .BR "Maximum RPM":
163 .I http://www.rpm.org/max-rpm/
164 .TP
165 .BR "cross distribution packaging":
166 .I http://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto
167 .TP
168 .BR "openSUSE packaging standards and guidelines":
169 .I http://en.opensuse.org/Portal:Packaging