-added documentation for specfile control comments for build(1)
[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 "\-\-root " buildroot
77 Specifies where the build system is set up. Overrides the
78 BUILD_ROOT enviroment variable.
79 .TP
80 .B --useusedforbuild
81 Tell build not to do dependency expansion, but to extract the
82 list of packages to install from "# usedforbuild" lines or, if none
83 are found, from all "BuildRequires" lines.  This option is useful
84 if you want to re-build a package from a srcrpm with exactly the
85 same packages used for the srcrpm build.
86 .TP
87 .B --norootforbuild
88
89 .TP
90 .B --help
91 Print a short help text.
92 .TP
93 .B --verify
94 verify the files in an existing build system.
95
96 .SH .spec FILE OPTIONS
97 The
98 .B build
99 command interprets some special control comments in the specfile:
100 .TP
101 .B # norootforbuild
102 .TQ
103 .B # needsrootforbuild
104 .B build
105 uses either user
106 .I root
107 or user
108 .I abuild
109 in the build system to do the build.  For non-SUSE distros as well as
110 since SUSE 10.2, the default build user is
111 .I abuild.
112 For 10.2 and before, the default build user is
113 .I root.
114 These two flags in the spec file allow to deviate from the defaults
115 and force-set the build user to
116 .I abuild
117 and
118 .I root
119 .RI "(for " "#\ norootforbuild" " and " "#\ needsrootforbuild" " respectively."
120 .TP
121 .B # needsbinariesforbuild
122 provide the binary rpms that have been used to set up the build root
123 in
124 .I /.build.binaries
125 within the build root.
126 .SH ENVIRONMENT
127 .TP
128 .B BUILD_ROOT
129 The directory where build should install the chrooted build system.
130 "/var/tmp/build-root" is used by default.
131 .TP
132 .B BUILD_RPMS
133 Where build can find the SuSE Linux RPMs.  build needs them to create the
134 build system.  "/media/dvd/suse" is the default value which will do
135 the trick if you have the SuSE Linux DVD mounted.
136 .TP
137 .B BUILD_RPM_BUILD_STAGE
138 The rpm build stage (-ba, -bb, ...).  This is just passed through to
139 rpm, check the rpm manpage for a complete list and descriptions.
140 "-ba" is the default.
141 You can use this to add more options to RPM.
142
143 .SH SEE ALSO
144 .BR rpm (1),
145 .TP
146 .BR "Maximum RPM":
147 .I http://www.rpm.org/max-rpm/
148 .TP
149 .BR "cross distribution packaging":
150 .I http://en.opensuse.org/Build_Service/cross_distribution_package_how_to
151 .TP
152 .BR "SUSE packaging standards and guidelines":
153 .I http://en.opensuse.org/Packaging