Gentoo Archives: gentoo-commits

From: Markos Chandras <hwoarang@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/devmanual:devrel-handbook commit in: ebuild-writing/misc-files/metadata/
Date: Sat, 03 Nov 2012 22:24:58
Message-Id: 1351981206.ded893153edae1761760c572f9f40f30eff4b273.hwoarang@gentoo
1 commit: ded893153edae1761760c572f9f40f30eff4b273
2 Author: Markos Chandras <hwoarang <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 3 22:20:06 2012 +0000
4 Commit: Markos Chandras <hwoarang <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 3 22:20:06 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/devmanual.git;a=commit;h=ded89315
7
8 metadata: Add examples from the devrel handbook
9
10 ---
11 ebuild-writing/misc-files/metadata/text.xml | 464 +++++++++++++++++++++++++--
12 1 files changed, 442 insertions(+), 22 deletions(-)
13
14 diff --git a/ebuild-writing/misc-files/metadata/text.xml b/ebuild-writing/misc-files/metadata/text.xml
15 index 1cd4081..5e6cd52 100644
16 --- a/ebuild-writing/misc-files/metadata/text.xml
17 +++ b/ebuild-writing/misc-files/metadata/text.xml
18 @@ -19,31 +19,452 @@ provided, an English long description must be present. A typical
19 example might look like:
20 </p>
21
22 +<subsection>
23 +<body>
24 +
25 +<p>
26 +A <path>metadata.xml</path> file can contain a number of tags:
27 +</p>
28 +
29 +<table>
30 +<tr>
31 + <th>tag</th>
32 + <th>description</th>
33 +</tr>
34 +<tr>
35 + <ti>
36 + <brite>&lt;pkgmetadata&gt;</brite>
37 + </ti>
38 + <ti>
39 + This is the root element of the <path>metadata.xml</path> file for
40 + packages. It has no attributes. The following subtags are
41 + allowed:
42 + <brite>&lt;herd&gt;</brite>,
43 + <brite>&lt;maintainer&gt;</brite>,
44 + <brite>&lt;longdescription&gt;</brite>,
45 + <brite>&lt;use&gt;</brite>, and
46 + <brite>&lt;upstream&gt;</brite>.
47 + There should be at least one <brite>&lt;herd&gt;</brite> or
48 + <brite>&lt;maintainer&gt;</brite> subtag.
49 + </ti>
50 +</tr>
51 +<tr>
52 + <ti>
53 + <brite>&lt;catmetadata&gt;</brite>
54 + </ti>
55 + <ti>
56 + This is the root element of the <path>metadata.xml</path> file for
57 + categories as per <uri link="/proj/en/glep/glep-0034.html">GLEP 34</uri>.
58 + It has no attributes. It contains a number of
59 + <brite>&lt;longdescription&gt;</brite> tags, each for a different
60 + language.
61 + </ti>
62 +</tr>
63 +<tr>
64 + <ti>
65 + <brite>&lt;herd&gt;</brite>
66 + </ti>
67 + <ti>
68 + If a package is maintained by one or more herds, names of these herds
69 + can be specified with the <brite>&lt;herd&gt;</brite> tag. The names
70 + used in this tag must be the same as specified in the <uri
71 + link="http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo/xml/htdocs/proj/en/metastructure/herds/herds.xml?content-type=text/plain&amp;rev=HEAD">herds.xml</uri>
72 + file.
73 + </ti>
74 +</tr>
75 +<tr>
76 + <ti>
77 + <brite>&lt;maintainer&gt;</brite>
78 + </ti>
79 + <ti>
80 + Besides being part of a herd, a package can also be maintained directly.
81 + The maintainers of a package can be specified with the
82 + <brite>&lt;maintainer&gt;</brite> tag. This tag has one required subtag:
83 + <brite>&lt;email&gt;</brite>. It has two optional subtags:
84 + <brite>&lt;name&gt;</brite>, and <brite>&lt;description&gt;</brite>.
85 + </ti>
86 +</tr>
87 +<tr>
88 + <ti><brite>&lt;email&gt;</brite></ti>
89 + <ti>
90 + This contains the e-mail address of the maintainer. It is required.
91 + </ti>
92 +</tr>
93 +<tr>
94 + <ti><brite>&lt;name&gt;</brite></ti>
95 + <ti>
96 + This contains freetext with the name of the maintainer. It is optional.
97 + </ti>
98 +</tr>
99 +<tr>
100 + <ti><brite>&lt;description&gt;</brite></ti>
101 + <ti>
102 + The description tag contains a description of the maintainership, or for
103 + example a remark that someone interested can take over the maintainership.
104 + It is optional.
105 + </ti>
106 +</tr>
107 +<tr>
108 + <ti><brite>&lt;longdescription&gt;</brite></ti>
109 + <ti>
110 + This tag contains a description of the package. This is to augment the
111 + DESCRIPTION field in the ebuilds themselves. This tag has two optional
112 + subtags: <brite>&lt;pkg&gt;</brite> and <brite>&lt;cat&gt;</brite>.
113 + </ti>
114 +</tr>
115 +<tr>
116 + <ti><brite>&lt;use&gt;</brite></ti>
117 + <ti>
118 + This tag contains descriptions of <uri
119 + link="::ebuild-writing/variables#iuse">USE flags</uri>.
120 + This tag is optional and, if specified, has one required subtag:
121 + <brite>&lt;flag&gt;</brite>.
122 + </ti>
123 +</tr>
124 +<tr>
125 + <ti><brite>&lt;flag&gt;</brite></ti>
126 + <ti>
127 + This tag contains a description of how the named USE flag affects this
128 + package. It is required if the <brite>&lt;use&gt;</brite> tag is specified.
129 + It also requires the USE flag to be named in the <c>name</c> attribute.
130 + This tag has two optional subtags: <brite>&lt;pkg&gt;</brite> and
131 + <brite>&lt;cat&gt;</brite>.
132 + </ti>
133 +</tr>
134 +<tr>
135 + <ti><brite>&lt;upstream&gt;</brite></ti>
136 + <ti>
137 + This tag contains information about the upstream developers/project.
138 + </ti>
139 +</tr>
140 +<tr>
141 + <ti><brite>&lt;maintainer&gt;</brite></ti>
142 + <ti>
143 + Name and e-mail of an upstream maintainer. May appear more than once.
144 + </ti>
145 +</tr>
146 +<tr>
147 + <ti><brite>&lt;name&gt;</brite></ti>
148 + <ti>
149 + The name of an upstream maintainer should contain a block of text with upstream's name.
150 + This element is mandatory for an upstream maintainer and must appear only once.
151 + </ti>
152 +</tr>
153 +<tr>
154 + <ti><brite>&lt;email&gt;</brite></ti>
155 + <ti>
156 + The email address of an upstream may appear only once.
157 + </ti>
158 +</tr>
159 +<tr>
160 + <ti><brite>&lt;changelog&gt;</brite></ti>
161 + <ti>
162 + Should contain a URL where the location of the upstream changelog can be found.
163 + The URL must be version independent and must point to a changelog which is only
164 + updated on new releases of the corresponding package. (This also implies that
165 + one can link to an automatically updated changelog in case of vcs snapshots
166 + only.)
167 + </ti>
168 +</tr>
169 +<tr>
170 + <ti><brite>&lt;doc&gt;</brite></ti>
171 + <ti>
172 + Should contain a URL where the location of the upstream documentation can be
173 + found. The link must not point to any third party documentation and must be
174 + version independent. If the documentation is available in more than one language,
175 + a lang attribute can be used which follows the same rules as the one for
176 + longdescription.
177 + </ti>
178 +</tr>
179 +<tr>
180 + <ti><brite>&lt;bugs-to&gt;</brite></ti>
181 + <ti>
182 + Should contain a place where bugs can be filed, a URL or an e-mail address prefixed
183 + with mailto:.
184 + </ti>
185 +</tr>
186 +<tr>
187 + <ti><brite>&lt;remote-id&gt;</brite></ti>
188 + <ti>
189 + Should specify a type of package identification tracker and the identification that
190 + corresponds to the package in question. remote-id should make it easier to index
191 + information such as its Freshmeat ID or its CPAN name.
192 + </ti>
193 +</tr>
194 +<tr>
195 + <ti><brite>&lt;pkg&gt;</brite></ti>
196 + <ti>
197 + This tag contains a valid package name in the format of a DEPEND.
198 + </ti>
199 +</tr>
200 +<tr>
201 + <ti><brite>&lt;cat&gt;</brite></ti>
202 + <ti>
203 + This tag contains a valid category name as defined in
204 + <path>profiles/categories</path>.
205 + </ti>
206 +</tr>
207 +</table>
208 +
209 +<p>
210 +There are also some attributes that can be used with these tags. They are all
211 +optional:
212 +</p>
213 +
214 +<table>
215 +<tr>
216 + <th>attribute</th>
217 + <th>tags</th>
218 + <th>description</th>
219 +</tr>
220 +<tr>
221 + <ti>lang</ti>
222 + <ti>
223 + <brite>&lt;description&gt;</brite>, <brite>&lt;longdescription&gt;</brite>,
224 + <brite>&lt;use&gt;</brite>, <brite>&lt;doc&gt;</brite>
225 + </ti>
226 + <ti>
227 + In every case where a description is required, there must be at
228 + <e>least</e> an english description. If an additional description in
229 + another language is given, this attribute is used to specify the language
230 + used. The format is the two-character language code as defined by the <uri
231 + link="http://www.w3.org/WAI/ER/IG/ert/iso639.htm#2letter">ISO-639-1</uri>
232 + norm.
233 + </ti>
234 +</tr>
235 +<tr>
236 + <ti>restrict</ti>
237 + <ti>
238 + <brite>&lt;herd&gt;</brite>, <brite>&lt;maintainer&gt;</brite>,
239 + <brite>&lt;longdescription&gt;</brite>, <brite>&lt;flag&gt;</brite>
240 + </ti>
241 + <ti>
242 + The restrict attribute allows one to restrict the application of certain
243 + tags to certain versions of a package. When this attribute is used, a tag
244 + without this attribute must also exist. That tag without the restrict
245 + attribute will serve as the default. The format of the restrict attribute
246 + is that of the DEPEND flag, except that "&lt;" and
247 + "&gt;" need to be specified by &amp;lt; and &amp;gt;.<br />
248 + <br />
249 + For example, in the <c>sys-libs/db</c> package,
250 + <c>restrict="&amp;gt;=sys-libs/db-3.2.9-r5"</c> on the
251 + <brite>maintainer</brite> tag shows that I'm currently maintaining all
252 + versions greater then 3.2.9-r5.
253 + </ti>
254 +</tr>
255 +<tr>
256 + <ti>name</ti>
257 + <ti>
258 + <brite>&lt;flag&gt;</brite>
259 + </ti>
260 + <ti>
261 + This attribute is required on the <brite>&lt;flag&gt;</brite> tag. It
262 + simply contains the USE flag.
263 + <br /><br />
264 + For example, in the <c>sys-apps/hal</c> package, <c>&lt;flag name='acpi'&gt;
265 + Enables ACPI&lt;/flag&gt;</c>
266 + </ti>
267 +</tr>
268 +<tr>
269 + <ti>status</ti>
270 + <ti>
271 + <brite>&lt;maintainer&gt;</brite>
272 + </ti>
273 + <ti>
274 + The upstream maintainer element has a status attribute, which is one of active or inactive.
275 + This attribute is not mandatory. The absence of it shall be interpreted as unknown.
276 + Please note: This attribute is only allowed in the &lt;upstream&gt; &lt;maintainer&gt; element!
277 + </ti>
278 +</tr>
279 +<tr>
280 + <ti>type</ti>
281 + <ti>
282 + <brite>&lt;remote-id&gt;</brite>
283 + </ti>
284 + <ti>
285 + A string identifying the type of upstream source. A list of valid strings are kept in metadata.dtd.
286 + Developers should email the gentoo-dev mailing list before using a new type value.
287 + </ti>
288 +</tr>
289 +
290 +</table>
291 +
292 +</body>
293 +</subsection>
294 +
295 +</body>
296 +</section>
297 +
298 +<section>
299 +<title>Metadata Examples</title>
300 +<subsection>
301 +<title>First Example</title>
302 +<body>
303 +
304 +<p>
305 +In this first example we provide you with the <path>metadata.xml</path> for
306 +OpenOffice of which the ebuilds are completely managed by a herd called
307 +<c>openoffice</c>:
308 +</p>
309 +
310 <codesample lang="sgml">
311 - &lt;?xml version="1.0" encoding="UTF-8"?&gt;
312 - &lt;!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"&gt;
313 - &lt;pkgmetadata&gt;
314 - &lt;herd&gt;freedesktop&lt;/herd&gt;
315 - &lt;maintainer&gt;
316 - &lt;email&gt;dang@g.o&lt;/email&gt;
317 - &lt;name&gt;Daniel Gryniewicz&lt;/name&gt;
318 +&lt;?xml version='1.0' encoding='UTF-8'?&gt;
319 +&lt;!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"&gt;
320 +&lt;pkgmetadata&gt;
321 + &lt;herd&gt;openoffice&lt;/herd&gt;
322 + &lt;longdescription&gt;
323 + OpenOffice is the opensource version of staroffice.
324 + This ebuild allows you to compile it yourself. Unfortunately this
325 + compilation can take up to a day depending on the speed of your
326 + computer. It will however make a snappier openoffice than the binary
327 + version.
328 + &lt;/longdescription&gt;
329 +&lt;/pkgmetadata&gt;
330 +</codesample>
331 +
332 +<p>
333 +The <c>openoffice</c> herd is defined in <path>herds.xml</path> by the
334 +<uri link="/proj/en/metastructure">Gentoo Metastructure Project</uri>:
335 +</p>
336 +
337 +<note>
338 +This example may be outdated when you read it. It's just an example!
339 +</note>
340 +
341 +<codesample lang="sgml">
342 +&lt;herd&gt;
343 + &lt;name&gt;openoffice&lt;/name&gt;
344 + &lt;email&gt;openoffice@g.o&lt;/email&gt;
345 + &lt;description&gt;Openoffice related packages&lt;/description&gt;
346 + &lt;maintainer&gt;&lt;email&gt;pauldv@g.o&lt;/email&gt;&lt;/maintainer&gt;
347 + &lt;maintainer&gt;&lt;email&gt;suka@g.o&lt;/email&gt;&lt;/maintainer&gt;
348 +&lt;/herd&gt;
349 +</codesample>
350 +
351 +<p>
352 +If you want to add (or remove) yourself from a herd, edit <path>herds.xml</path>
353 +located in <path>[gentoo]/xml/htdocs/proj/en/metastructure/herds</path> in Gentoo's CVS repository. Make sure you
354 +know the e-mail alias the herd listens to (for instance the "sound" herd has
355 +<mail link="sound@g.o">sound@g.o</mail>) and add yourself to the
356 +alias (by editing <path>/var/mail/alias/misc/&lt;alias name&gt;</path> on
357 +dev.gentoo.org).
358 +</p>
359 +
360 +</body>
361 +</subsection>
362 +<subsection>
363 +<title>Second Example</title>
364 +<body>
365 +
366 +<p>
367 +For the second example, we will examine the <path>metadata.xml</path> of
368 +<c>app-portage/mirrorselect</c>. This ebuild is maintained by the
369 +<c>tools-portage</c> herd, but has a separate maintainer.
370 +</p>
371 +
372 +<pre caption="Herd &amp; individually maintained package">
373 +&lt;?xml version='1.0' encoding='UTF-8'?&gt;
374 +&lt;!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"&gt;
375 +&lt;pkgmetadata&gt;
376 + &lt;herd&gt;tools-portage&lt;/herd&gt;
377 + &lt;maintainer&gt;
378 + &lt;email&gt;johnm@g.o&lt;/email&gt;
379 + &lt;name&gt;John Mylchreest&lt;/name&gt;
380 + &lt;/maintainer&gt;
381 + &lt;longdescription&gt;
382 + This utility is used to select the fastest mirror (distfiles) and provide a
383 + nicer front-end for mirror selection (both rsync + distfiles) to a user.
384 + &lt;/longdescription&gt;
385 +&lt;/pkgmetadata&gt;
386 +</pre>
387 +
388 +</body>
389 +</subsection>
390 +<subsection>
391 +<title>Third Example</title>
392 +<body>
393 +
394 +<p>
395 +For the third example, we will describe the <path>metadata.xml</path> of
396 +<c>sys-apps/hal</c>. This ebuild is maintained by the <c>gentopia</c> herd
397 +and contains USE flag descriptions.
398 +</p>
399 +
400 +<codesample lang="sgml">
401 +&lt;?xml version="1.0" encoding="UTF-8"&gt;
402 +&lt;!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"&gt;
403 +&lt;pkgmetadata&gt;
404 +&lt;herd&gt;gentopia&lt;/herd&gt;
405 +&lt;maintainer&gt;
406 + &lt;email&gt;compnerd@g.o&lt;/email&gt;
407 +&lt;/maintainer&gt;
408 +&lt;maintainer&gt;
409 + &lt;email&gt;steev@g.o&lt;/email&gt;
410 +&lt;/maintainer&gt;
411 +&lt;use&gt;
412 + &lt;flag name='acpi'&gt;Enables HAL to attempt to read from
413 + /proc/acpi/event, if unavailable, HAL will read events from
414 + &lt;pkg&gt;sys-power/acpid&lt;/pkg&gt;. If you need multiple acpi
415 + readers, ensure acpid is in your default runlevel along with HAL. This
416 + will also enable HAL to read Toshia and IBM acpi events which do not
417 + get sent via /proc/acpi/event&lt;/flag&gt;
418 + &lt;flag name='crypt'&gt;Allows HAL to mount volumes that are encrypted using
419 + LUKS. &lt;pkg&gt;sys-fs/cryptsetup-luks&lt;/pkg&gt; which has recently been renamed
420 + to &lt;pkg&gt;sys-fs/cryptsetup&lt;/pkg&gt; allows you to create such encrypted
421 + volumes. HAL will be able to handle volumes that are removable or
422 + fixed.&lt;/flag&gt;
423 + &lt;flag name='dell'&gt;Builds an installs the Dell addon, which reads data from
424 + the Dell SM BIOS via &lt;pkg&gt;sys-libs/libsmbios&lt;/pkg&gt;. It will read your
425 + service tag information and your hardware backlight data as well as
426 + allow you to modify the backlight settings on a Dell laptop.&lt;/flag&gt;
427 + &lt;flag name='disk-partition'&gt;Allows HAL to use libparted from
428 + &lt;pkg&gt;sys-apps/parted&lt;/pkg&gt; to read raw partition data from your disks
429 + and process that data. Future versions of HAL (possibly 0.5.11 and
430 + higher) will allow you to create, modify, delete and format partitions
431 + from a GUI interface agnostic of your desktop environment.&lt;/flag&gt;
432 + &lt;flag name='doc'&gt;Generates documentation that describes HAL's fdi
433 + format.&lt;/flag&gt;
434 + &lt;flag name='pcmcia'&gt;Allows HAL to process PCMCIA/CardBus slot data which
435 + includes inserts and removals and act on these events.&lt;/flag&gt;
436 + &lt;flag name='selinux'&gt;Installs SELinux policies and links HAL to the SELinux
437 + libraries.&lt;/flag&gt;
438 +&lt;/use&gt;
439 +&lt;/pkgmetadata&gt;
440 +</codesample>
441 +
442 +</body>
443 +</subsection>
444 +<subsection>
445 +<title>Fourth Example</title>
446 +<body>
447 +
448 +<p>
449 +This example demonstrates the usage of the upstream element:
450 +</p>
451 +
452 +<codesample lang="sgml">
453 +&lt;upstream&gt;
454 + &lt;maintainer status="inactive"&gt;
455 + &lt;name&gt;Foo Bar&lt;/name&gt;
456 + &lt;email&gt;foo@×××.bar&lt;/email&gt;
457 + &lt;/maintainer&gt;
458 + &lt;maintainer status="active"&gt;
459 + &lt;name&gt;Foo Gentoo&lt;/name&gt;
460 + &lt;email&gt;foo@g.o&lt;/email&gt;
461 &lt;/maintainer&gt;
462 - &lt;longdescription lang="en"&gt;
463 - HAL provides a view of the various hardware attached to a system.
464 - In addition to this, HAL keeps detailed metadata for each piece of
465 - hardware and provide hooks such that system- and desktop-level software
466 - can react to changes in the hardware configuration in order to maintain
467 - system policy.
468 - &lt;/longdescription&gt;
469 - &lt;use&gt;
470 - &lt;flag name="laptop"&gt;Adds support for power management scripts
471 - (&lt;pkg&gt;sys-power/pm-utils&lt;/pkg&gt;)&lt;/flag&gt;
472 - &lt;flag name="selinux"&gt;Installs SELinux policies and links HAL to the SELinux
473 - libraries.&lt;/flag&gt;
474 - &lt;/use&gt;
475 - &lt;/pkgmetadata&gt;
476 + &lt;changelog&gt;http://foo.bar/changelog.txt&lt;/changelog&gt;
477 + &lt;doc lang="en"&gt;http://foo.bar/doc/index.html&lt;/doc&gt;
478 + &lt;doc lang="de"&gt;http://foo.bar/doc/index.de.html&lt;/doc&gt;
479 + &lt;bugs-to&gt;https://bugs.foo.bar&lt;/bugs-to&gt;
480 + &lt;remote-id type="freshmeat"&gt;foobar&lt;/remote-id&gt;
481 + &lt;remote-id type="sourceforge"&gt;foobar&lt;/remote-id&gt;
482 +&lt;/upstream&gt;
483 </codesample>
484
485 +</body>
486 +</subsection>
487 +
488 +
489 <p>
490 All new packages <b>must</b> include a <c>metadata.xml</c> file. That file
491 should specify at least one herd or one maintainer. It is however recommended,
492 @@ -67,7 +488,6 @@ should ensure that you have <c>dev-libs/libxml2</c> installed so that
493 the XML can be validated.
494 </p>
495
496 -</body>
497 </section>
498
499 <section>