/[gentoo]/xml/htdocs/doc/en/handbook/hb-working-use.xml
Gentoo

Diff of /xml/htdocs/doc/en/handbook/hb-working-use.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.5 Revision 1.21
1<?xml version='1.0' encoding='UTF-8'?>
2<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3
1<!-- The content of this document is licensed under the CC-BY-SA license --> 4<!-- The content of this document is licensed under the CC-BY-SA license -->
2<!-- See http://creativecommons.org/licenses/by-sa/1.0 --> 5<!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
3 6
4<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-use.xml,v 1.5 2003/12/16 18:08:56 swift Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-use.xml,v 1.21 2004/10/21 10:31:20 swift Exp $ -->
5 8
6<sections> 9<sections>
7<section> 10<section>
8<title>What are USE-flags?</title> 11<title>What are USE-flags?</title>
9<subsection> 12<subsection>
25with KDE-support if those packages work flawlessly without? 28with KDE-support if those packages work flawlessly without?
26</p> 29</p>
27 30
28<p> 31<p>
29To help users in deciding what to install/activate and what not, we wanted the 32To help users in deciding what to install/activate and what not, we wanted the
30user to specify his environment in an easy way. This forces the user into 33user to specify his/her environment in an easy way. This forces the user into
31deciding what he really wants and eases the process for Portage, our package 34deciding what they really want and eases the process for Portage, our package
32managment system, to make useful decisions. 35managment system, to make useful decisions.
33</p> 36</p>
34 37
35</body> 38</body>
36</subsection> 39</subsection>
44Portage will know that you want support for the chosen keyword. Of course 47Portage will know that you want support for the chosen keyword. Of course
45this also alters the dependency information for a package. 48this also alters the dependency information for a package.
46</p> 49</p>
47 50
48<p> 51<p>
49Lets take a look at a specific example: the <c>kde</c> keyword. If you do not 52Let us take a look at a specific example: the <c>kde</c> keyword. If you do not
50have this keyword in your <c>USE</c> variable, all packages that have 53have this keyword in your <c>USE</c> variable, all packages that have
51<e>optional</e> KDE support will be compiled <e>without</e> KDE support. All 54<e>optional</e> KDE support will be compiled <e>without</e> KDE support. All
52packages that have an <e>optional</e> KDE dependency will be installed 55packages that have an <e>optional</e> KDE dependency will be installed
53<e>without</e> installing the KDE libraries (as dependency). If you have defined 56<e>without</e> installing the KDE libraries (as dependency). If you have defined
54the <c>kde</c> keyword, then those packages <e>will</e> be compiled with KDE 57the <c>kde</c> keyword, then those packages <e>will</e> be compiled with KDE
74 <li> 77 <li>
75 A <e>global</e> USE-flag is used by several packages, system-wide. This is 78 A <e>global</e> USE-flag is used by several packages, system-wide. This is
76 what most people see as USE-flags. 79 what most people see as USE-flags.
77 </li> 80 </li>
78 <li> 81 <li>
79 A <e>local</e> USE-fag is used by a single package to make package-specific 82 A <e>local</e> USE-flag is used by a single package to make package-specific
80 decisions. 83 decisions.
81 </li> 84 </li>
82</ul> 85</ul>
83 86
84<p> 87<p>
96icc - Use the Intel C++ Compiler if the package supports it 99icc - Use the Intel C++ Compiler if the package supports it
97icc-pgo - Enable PGO data generation or use when use icc. 100icc-pgo - Enable PGO data generation or use when use icc.
98imap - Adds support for IMAP 101imap - Adds support for IMAP
99</pre> 102</pre>
100 103
104<p>
105A list of available local USE-flags can be found locally in
106<path>/usr/portage/profiles/use.local.desc</path>.
107</p>
108
101</body> 109</body>
102</subsection> 110</subsection>
103</section> 111</section>
104<section> 112<section>
105<title>Using USE-flags</title> 113<title>Using USE-flags</title>
119we think are commonly used by the Gentoo users. This default setting is declared 127we think are commonly used by the Gentoo users. This default setting is declared
120in the <path>/etc/make.profile/make.defaults</path> file. Let us take a look at 128in the <path>/etc/make.profile/make.defaults</path> file. Let us take a look at
121this default setting: 129this default setting:
122</p> 130</p>
123 131
124<pre caption="/etc/make.profile/make.defaults USE variable"> 132<pre caption="/etc/make.profile/make.defaults USE variable on an x86 system">
125USE="x86 oss apm arts avi berkdb crypt cups encode foomaticdb gdbm gif gpm gtk 133USE="x86 oss apm arts avi berkdb crypt cups encode foomaticdb gdbm gif gpm
126 imlib jpeg kde gnome libg++ libwww mad mikmod motif mpeg ncurses nls 134 gtk gtk2 imlib jpeg kde gnome libg++ libwww mad mikmod motif mpeg ncurses
127 oggvorbis opengl pam pdflib png python qt quicktime readline sdl slang 135 nls oggvorbis opengl pam pdflib png python qt quicktime readline sdl
128 spell ssl svga tcpd truetype X xml2 xmms xv zlib" 136 slang spell ssl svga tcpd truetype X xml2 xmms xv zlib"
129</pre> 137</pre>
130 138
131<p> 139<p>
132As you can see, this variable already contains quite a lot of keywords. Do 140As you can see, this variable already contains quite a lot of keywords. Do
133<b>not</b> alter the <path>/etc/make.profile/make.defaults</path> file to tailor 141<b>not</b> alter the <path>/etc/make.profile/make.defaults</path> file to tailor
153</pre> 161</pre>
154 162
155</body> 163</body>
156</subsection> 164</subsection>
157<subsection> 165<subsection>
166<title>Declaring USE flags for individual packages</title>
167<body>
168
169<p>
170Sometimes you want to declare a certain USE flag for one (or a couple) of
171applications but not system-wide. To accomplish this, you will need to create
172the <path>/etc/portage</path> directory (if it doesn't exist yet) and edit
173<path>/etc/portage/package.use</path>.
174</p>
175
176<p>
177For instance, if you don't want <c>berkdb</c> support globally but you do want
178it for <c>mysql</c>, you would add:
179</p>
180
181<pre caption="/etc/portage/package.use example">
182dev-db/mysql berkdb
183</pre>
184
185<p>
186You can of course also explicitly <e>disable</e> USE flags for a certain
187application. For instance, if you don't want <c>java</c> support in PHP:
188</p>
189
190<pre caption="/etc/portage/package.use 2nd example">
191dev-php/php -java
192</pre>
193
194</body>
195</subsection>
196<subsection>
158<title>Declare temporary USE-flags</title> 197<title>Declare temporary USE-flags</title>
159<body> 198<body>
160 199
161<p> 200<p>
162Sometimes you want to set a certain USE-setting only once. Instead of editing 201Sometimes you want to set a certain USE-setting only once. Instead of editing
163<path>/etc/make.conf</path> twice (to do and undo the USE-changes) you can just 202<path>/etc/make.conf</path> twice (to do and undo the USE-changes) you can just
164declare the USE-variable as environment variable. 203declare the USE-variable as environment variable. Remember that, when you
204re-emerge or update this application (either explicitly or as part of a system
205update) your changes will be lost!
165</p> 206</p>
166 207
167<p> 208<p>
168As an example we will temporarily remove java from the USE-setting 209As an example we will temporarily remove java from the USE-setting
169during the installation of mozilla. 210during the installation of mozilla.
170</p> 211</p>
171 212
172<note>
173The <c>emerge</c> command will be discussed more thoroughly in <uri
174link="?part=2&amp;chap=2">Portage and Software</uri>.
175</note>
176
177<pre caption="Using USE as evironment variable"> 213<pre caption="Using USE as environment variable">
178# <i>USE="-java" emerge mozilla</i> 214# <i>USE="-java" emerge mozilla</i>
179</pre> 215</pre>
180 216
181</body> 217</body>
182</subsection> 218</subsection>
200</pre> 236</pre>
201 237
202</body> 238</body>
203</subsection> 239</subsection>
204<subsection> 240<subsection>
205<title>Precendence</title> 241<title>Precedence</title>
206<body> 242<body>
207 243
208<p> 244<p>
209Of course there is a certain precendence on what setting has priority over the 245Of course there is a certain precedence on what setting has priority over the
210USE setting. You don't want to declare <c>USE="-java"</c> only to see that 246USE setting. You don't want to declare <c>USE="-java"</c> only to see that
211<c>java</c> is declared anyway. The precedence for the USE setting is, ordered 247<c>java</c> is declared anyway. The precedence for the USE setting is, ordered
212by priority (first has lowest priority): 248by priority (first has lowest priority):
213</p> 249</p>
214 250
222 </li> 258 </li>
223 <li> 259 <li>
224 User-defined USE setting in <path>/etc/make.conf</path> 260 User-defined USE setting in <path>/etc/make.conf</path>
225 </li> 261 </li>
226 <li> 262 <li>
263 User-defined USE setting in <path>/etc/portage/package.use</path>
264 </li>
265 <li>
227 User-defined USE setting as environment variable 266 User-defined USE setting as environment variable
228 </li> 267 </li>
229</ol> 268</ol>
230 269
231<p> 270<p>
238# <i>emerge info</i> 277# <i>emerge info</i>
239</pre> 278</pre>
240 279
241</body> 280</body>
242</subsection> 281</subsection>
282<subsection>
283<title>Adapting your Entire System to New USE Flags</title>
284<body>
285
286<p>
287If you have altered your USE flags and you wish to update your entire system to
288use the new USE flags, use <c>emerge</c>'s <c>--newuse</c> option:
289</p>
290
291<pre caption="Rebuilding your entire system">
292# <i>emerge --update --deep --newuse world</i>
293</pre>
294
295<p>
296Next, run Portage's depclean to remove the conditional dependencies that
297were emerged on your "old" system but that have been obsoleted by the new USE
298flags.
299</p>
300
301<warn>
302Running <c>emerge depclean</c> is a dangerous operation and should be handled
303with care. Double-check the provided list of "obsoleted" packages to make sure
304it doesn't remove packages you need. In the following example we add the
305<c>-p</c> switch to have depclean only list the packages without removing them.
306</warn>
307
308<pre caption="Removing obsoleted packages">
309# <i>emerge -p depclean</i>
310</pre>
311
312<p>
313When depclean has finished, run <c>revdep-rebuild</c> to rebuild the
314applications that are dynamically linked against shared objects provided by
315possibly removed packages. <c>revdep-rebuild</c> is part of the
316<c>gentoolkit</c> package; don't forget to emerge it first.
317</p>
318
319<pre caption="Running revdep-rebuild">
320# <i>revdep-rebuild</i>
321</pre>
322
323<p>
324When all this is accomplished, your system is using the new USE flag settings.
325</p>
326
327</body>
328</subsection>
243</section> 329</section>
244<section> 330<section>
245<title>Package specific USE-flags</title> 331<title>Package specific USE-flags</title>
246<subsection> 332<subsection>
247<title>Viewing available USE-flags</title> 333<title>Viewing available USE-flags</title>
248<body> 334<body>
249 335
250<p> 336<p>
251In the next chapter on <uri link="?part=2&amp;chap=2">Portage and Software</uri>
252we will explain how to manage your installed software and how to work with
253<c>emerge</c>. However, we will give you a primer on <c>emerge</c> by showing
254you how to view what USE-flags a package uses.
255</p>
256
257<p>
258Let us take the example of <c>mozilla</c>: what USE-flags does it listen to? To 337Let us take the example of <c>mozilla</c>: what USE-flags does it listen to? To
259find out, we use <c>emerge</c> with the <c>--pretend</c> (don't really do 338find out, we use <c>emerge</c> with the <c>--pretend</c> and <c>--verbose</c>
260anything) and <c>--verbose</c> (give more output) options: 339options:
261</p> 340</p>
262 341
263<pre caption="Viewing the used USE-flags"> 342<pre caption="Viewing the used USE-flags">
264# <i>emerge --pretend --verbose mozilla</i> 343# <i>emerge --pretend --verbose mozilla</i>
265These are the packages that I would merge, in order: 344These are the packages that I would merge, in order:
275dedicated to package information called <c>etcat</c> which resides in the 354dedicated to package information called <c>etcat</c> which resides in the
276<c>gentoolkit</c> package. First, install <c>gentoolkit</c>: 355<c>gentoolkit</c> package. First, install <c>gentoolkit</c>:
277</p> 356</p>
278 357
279<pre caption="Installing gentoolkit"> 358<pre caption="Installing gentoolkit">
280# <i>emerge --usepkg gentoolkit</i> 359# <i>emerge gentoolkit</i>
281</pre> 360</pre>
282 361
283<p> 362<p>
284Now run <c>etcat</c> with the <c>uses</c> argument to view the USE-flags of a 363Now run <c>etcat</c> with the <c>uses</c> argument to view the USE-flags of a
285certain package. For instance, for the <c>gnumeric</c> package: 364certain package. For instance, for the <c>gnumeric</c> package:

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.20