Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r11487 - main/trunk/doc/package/ebuild/eapi
Date: Wed, 03 Sep 2008 21:27:33
Message-Id: E1Kazst-0006NT-TF@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-09-03 21:27:21 +0000 (Wed, 03 Sep 2008)
3 New Revision: 11487
4
5 Modified:
6 main/trunk/doc/package/ebuild/eapi/2.docbook
7 Log:
8 Add a new "EAPI 2 Draft" section which unifies the content of the EAPI 2_pre*
9 sections.
10
11
12 Modified: main/trunk/doc/package/ebuild/eapi/2.docbook
13 ===================================================================
14 --- main/trunk/doc/package/ebuild/eapi/2.docbook 2008-09-03 02:13:35 UTC (rev 11486)
15 +++ main/trunk/doc/package/ebuild/eapi/2.docbook 2008-09-03 21:27:21 UTC (rev 11487)
16 @@ -274,16 +274,295 @@
17 </section>
18 </section>
19 </section>
20 -<section id='package-ebuild-eapi-2_pre3'>
21 - <title>EAPI 2_pre3</title>
22 - <section id='package-ebuild-eapi-2-phases'>
23 +<section id='package-ebuild-eapi-2-draft'>
24 + <title>EAPI 2 Draft</title>
25 + <section id='package-ebuild-eapi-2-draft-helpers'>
26 + <title>Helpers</title>
27 + <section id='package-ebuild-eapi-2-draft-helpers-doman'>
28 + <title>doman</title>
29 + <para>
30 + Language codes in file names are now used for path translation.
31 + </para>
32 + <table><title>Man Page Path Translation</title>
33 + <tgroup cols='2' align='left' >
34 + <colspec colname='source'/>
35 + <colspec colname='destination'/>
36 + <thead>
37 + <row>
38 + <entry>Source</entry>
39 + <entry>Destination</entry>
40 + </row>
41 + </thead>
42 + <tbody>
43 + <row>
44 + <entry>foo.1</entry>
45 + <entry>/usr/share/man/man1/foo.1</entry>
46 + </row>
47 + <row>
48 + <entry>foo.lang.1</entry>
49 + <entry>/usr/share/man/lang/man1/foo.1</entry>
50 + </row>
51 + </tbody>
52 + </tgroup>
53 + </table>
54 + </section>
55 + </section>
56 + <section id='package-ebuild-eapi-2-draft-use-deps'>
57 + <title>USE Dependencies</title>
58 + <section id='package-ebuild-eapi-2-draft-use-deps-unconditional'>
59 + <title>Unconditional USE Dependencies</title>
60 + <table><title>Syntax Examples</title>
61 + <tgroup cols='2' align='left' >
62 + <colspec colname='example'/>
63 + <colspec colname='meaning'/>
64 + <thead>
65 + <row>
66 + <entry>Example</entry>
67 + <entry>Meaning</entry>
68 + </row>
69 + </thead>
70 + <tbody>
71 + <row>
72 + <entry>foo[bar]</entry>
73 + <entry>foo must have bar enabled</entry>
74 + </row>
75 + <row>
76 + <entry>foo[bar,baz]</entry>
77 + <entry>foo must have both bar and baz enabled</entry>
78 + </row>
79 + <row>
80 + <entry>foo[-bar,baz]</entry>
81 + <entry>foo must have bar disabled and baz enabled</entry>
82 + </row>
83 + </tbody>
84 + </tgroup>
85 + </table>
86 + </section>
87 + <section id='package-ebuild-eapi-2-draft-use-deps-conditional'>
88 + <title>Conditional USE Dependencies</title>
89 + <table><title>Syntax Examples</title>
90 + <tgroup cols='2' align='left' >
91 + <colspec colname='compact'/>
92 + <colspec colname='expanded'/>
93 + <thead>
94 + <row>
95 + <entry>Compact Form</entry>
96 + <entry>Equivalent Expanded Form</entry>
97 + </row>
98 + </thead>
99 + <tbody>
100 + <row>
101 + <entry>foo[bar?]</entry>
102 + <entry>bar? ( foo[bar] ) !bar? ( foo )</entry>
103 + </row>
104 + <row>
105 + <entry>foo[!bar?]</entry>
106 + <entry>bar? ( foo ) !bar? ( foo[-bar] )</entry>
107 + </row>
108 + <row>
109 + <entry>foo[bar=]</entry>
110 + <entry>bar? ( foo[bar] ) !bar? ( foo[-bar] )</entry>
111 + </row>
112 + <row>
113 + <entry>foo[!bar=]</entry>
114 + <entry>bar? ( foo[-bar] ) !bar? ( foo[bar] )</entry>
115 + </row>
116 + </tbody>
117 + </tgroup>
118 + </table>
119 + </section>
120 + </section>
121 + <section id='package-ebuild-eapi-2-draft-phases'>
122 <title>Phases</title>
123 - <section id='package-ebuild-eapi-2-phases-src-prepare'>
124 + <section id='package-ebuild-eapi-2-draft-phases-src-prepare'>
125 <title>New src_prepare Phase Function</title>
126 <para>
127 - A new src_prepare function is called in-between the src_unpack and
128 - src_configure functions, with cwd initially set to $S.
129 + A new src_prepare function is called after the src_unpack
130 + function, with cwd initially set to $S.
131 </para>
132 </section>
133 + <section id='package-ebuild-eapi-2-draft-phases-src-configure'>
134 + <title>New src_configure Phase Function</title>
135 + <para>
136 + The configure portion of the src_compile function has been
137 + split into a separate function which is named src_configure. The
138 + src_configure function is called in-between the src_prepare and
139 + src_compile functions.
140 + </para>
141 + <programlisting>
142 +src_configure() {
143 + if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then
144 + econf
145 + fi
146 +}
147 +
148 +src_compile() {
149 + if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ] ; then
150 + emake || die "emake failed"
151 + fi
152 +}
153 + </programlisting>
154 + </section>
155 + <section id='package-ebuild-eapi-2-draft-phases-order'>
156 + <title>Execution Order of Phase Functions</title>
157 + <table><title>Execution Order of Phase Functions</title>
158 + <tgroup cols='1' align='left' >
159 + <colspec colname='name'/>
160 + <thead>
161 + <row>
162 + <entry>Phase Function Name</entry>
163 + </row>
164 + </thead>
165 + <tbody>
166 + <row>
167 + <entry>pkg_setup</entry>
168 + </row>
169 + <row>
170 + <entry>src_unpack</entry>
171 + </row>
172 + <row>
173 + <entry>src_prepare</entry>
174 + </row>
175 + <row>
176 + <entry>src_configure</entry>
177 + </row>
178 + <row>
179 + <entry>src_compile</entry>
180 + </row>
181 + <row>
182 + <entry>src_test</entry>
183 + </row>
184 + <row>
185 + <entry>src_install</entry>
186 + </row>
187 + <row>
188 + <entry>pkg_preinst</entry>
189 + </row>
190 + <row>
191 + <entry>pkg_postinst</entry>
192 + </row>
193 + <row>
194 + <entry>pkg_prerm</entry>
195 + </row>
196 + <row>
197 + <entry>pkg_postrm</entry>
198 + </row>
199 + </tbody>
200 + </tgroup>
201 + </table>
202 + </section>
203 + <section id='package-ebuild-eapi-2-draft-phases-default-functions'>
204 + <title>Default Phase Functions</title>
205 + <para>
206 + The default pkg_nofetch and src_* phase functions are now
207 + accessible via a function having a name
208 + that begins with default_ and
209 + ends with the respective phase function name. For example,
210 + a call to a function with the name default_src_compile is
211 + equivalent to a call to the default src_compile
212 + implementation.
213 + </para>
214 + <table><title>Default Phase Functions</title>
215 + <tgroup cols='1' align='left' >
216 + <colspec colname='name'/>
217 + <thead>
218 + <row>
219 + <entry>Function Name</entry>
220 + </row>
221 + </thead>
222 + <tbody>
223 + <row>
224 + <entry>default_pkg_nofetch</entry>
225 + </row>
226 + <row>
227 + <entry>default_src_unpack</entry>
228 + </row>
229 + <row>
230 + <entry>default_src_prepare</entry>
231 + </row>
232 + <row>
233 + <entry>default_src_configure</entry>
234 + </row>
235 + <row>
236 + <entry>default_src_compile</entry>
237 + </row>
238 + <row>
239 + <entry>default_src_test</entry>
240 + </row>
241 + </tbody>
242 + </tgroup>
243 + </table>
244 + <para>
245 + The default phase functions for a particular EAPI are also
246 + accessible as functions having names that start with 'eapi'
247 + followed by the EAPI value. For example, a call to a function
248 + named eapi0_src_compile is equivalent to a call to the
249 + default src_compile implementation that is provided with EAPI 0.
250 + </para>
251 + <table><title>Default EAPI Phase Functions</title>
252 + <tgroup cols='1' align='left' >
253 + <colspec colname='name'/>
254 + <thead>
255 + <row>
256 + <entry>Function Name</entry>
257 + </row>
258 + </thead>
259 + <tbody>
260 + <row>
261 + <entry>eapi0_pkg_nofetch</entry>
262 + </row>
263 + <row>
264 + <entry>eapi0_src_unpack</entry>
265 + </row>
266 + <row>
267 + <entry>eapi0_src_compile</entry>
268 + </row>
269 + <row>
270 + <entry>eapi0_src_test</entry>
271 + </row>
272 + <row>
273 + <entry>eapi1_pkg_nofetch</entry>
274 + </row>
275 + <row>
276 + <entry>eapi1_src_unpack</entry>
277 + </row>
278 + <row>
279 + <entry>eapi1_src_compile</entry>
280 + </row>
281 + <row>
282 + <entry>eapi1_src_test</entry>
283 + </row>
284 + <row>
285 + <entry>eapi2_pkg_nofetch</entry>
286 + </row>
287 + <row>
288 + <entry>eapi2_src_unpack</entry>
289 + </row>
290 + <row>
291 + <entry>eapi2_src_prepare</entry>
292 + </row>
293 + <row>
294 + <entry>eapi2_src_configure</entry>
295 + </row>
296 + <row>
297 + <entry>eapi2_src_compile</entry>
298 + </row>
299 + <row>
300 + <entry>eapi2_src_test</entry>
301 + </row>
302 + </tbody>
303 + </tgroup>
304 + </table>
305 + </section>
306 + <section id='package-ebuild-eapi-2-draft-phases-default-function-alias'>
307 + <title>Default Phase Function Alias</title>
308 + <para>
309 + A function named "default" is redefined for each phase so that it
310 + will call the default_* function corresponding to the current phase.
311 + For example, a call to the function named "default" during the
312 + src_compile phase is equivalent to a call to the function named
313 + default_src_compile.
314 + </para>
315 + </section>
316 </section>
317 </section>