1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
|
<?xml version='1.0'?>
<guide>
<title>Gentoo Linux HOWTO</title>
<author title="Author"><mail link="pete@gentoo.org">Peter Gavin</mail></author>
<abstract>This document is a work in progress, and is constantly being
updated and changed. It is by no means complete. </abstract><!-- blah, blah, blah... (I'll fill this in later) -->
<version>0.51</version>
<date>9 Apr 2001</date>
<!--
Contents
I. Introduction
II. The Portage Tree
A. What (Not) to Put in the Portage Tree
B. Categories
C. The files Directory
III. .ebuild Files
A. Naming .ebuild Files
B. Contents of an .ebuild File
C. Rules for Writing an .ebuild File
IV. Filesystem Locations
A. Introduction to the FHS
B. How to Fit Your Packages into the Filesystem
V. The Portage Scripts and Utilities
A. Public Scripts
B. Private Scripts
VI. Package Dependencies
-->
<chapter>
<title>The Portage tree</title>
<section>
<title>Introduction</title>
<body><p>The portage tree is a heirarchy, in which the first level is the category,
and the second is the name of the package.
</p></body>
</section>
<section>
<title> What (not) to put in the Portage tree</title>
<body><p>The Portage tree should only include ebuild files, and other
files in the <path>files</path> directory for each package. Generally, no binary
files should be placed in the portage tree. No files that can
be downloaded from other sources (such as patches written by
other people) should be put here. No patches you write
yourself should be compressed.
</p></body>
</section>
<section>
<title>Categories</title>
<body><p>The categories are defined as follows:</p>
<table><tr><th>Category</th><th>Description</th></tr>
<tr><ti><path>app-admin</path></ti><ti>non-critical system administration utilities</ti></tr>
<tr><ti><path>app-arch</path></ti><ti>non-critical archival/compression utilities </ti></tr>
<tr><ti><path>app-cdr</path></ti><ti> CD recording utilities </ti></tr>
<tr><ti><path>app-doc</path></ti><ti>application documentation </ti></tr>
<tr><ti><path>app-editors</path></ti><ti>non-critical text editors </ti></tr>
<tr><ti><path>app-emulation</path></ti><ti>packages for emulating other systems/OSes </ti></tr>
<tr><ti><path>app-misc</path></ti><ti>applications that don't fit anywhere else </ti></tr>
<tr><ti><path>app-office</path></ti><ti>office-type (word processing, spreadsheet, etc.) packages </ti></tr>
<tr><ti><path>app-shells </path></ti><ti>non-critical shells and command interpreters </ti></tr>
<tr><ti><path>app-text </path></ti><ti>text processing, spell checkers, and document formatting packages </ti></tr>
<tr><ti><path>dev-db </path></ti><ti>database libraries </ti></tr>
<tr><ti><path>dev-java </path></ti><ti>java classes/packages/etc. </ti></tr>
<tr><ti><path>dev-lang </path></ti><ti>compilers and interpreters for different languages </ti></tr>
<tr><ti><path>dev-libs </path></ti><ti>miscellaneous developer's libraries </ti></tr>
<tr><ti><path>dev-perl </path></ti><ti>perl modules </ti></tr>
<tr><ti><path>dev-python </path></ti><ti>python modules </ti></tr>
<tr><ti><path>dev-ruby </path></ti><ti>ruby modules </ti></tr>
<tr><ti><path>dev-util </path></ti><ti>various developers utilities </ti></tr>
<tr><ti><path>gnome-apps </path></ti><ti>applications for GNOME </ti></tr>
<tr><ti><path>gnome-base </path></ti><ti>base GNOME packages </ti></tr>
<tr><ti><path>gnome-libs </path></ti><ti>non-essential GNOME libraries </ti></tr>
<tr><ti><path>gnome-office </path></ti><ti>office packages for gnome </ti></tr>
<tr><ti><path>kde-apps </path></ti><ti>applications for KDE </ti></tr>
<tr><ti><path>kde-base </path></ti><ti>base KDE packages </ti></tr>
<tr><ti><path>kde-i18n </path></ti><ti>KDE internationalization packages </ti></tr>
<tr><ti><path>media-gfx </path></ti><ti>graphics-related programs </ti></tr>
<tr><ti><path>media-libs </path></ti><ti> libraries for manipulating different media, including accessing multimedia peripherals of your computer (sound card, video card, etc.) </ti></tr>
<tr><ti><path>media-sound </path></ti><ti>programs related to sound, including cd-audio and sound encoding </ti></tr>
<tr><ti><path>media-video </path></ti><ti>programs related to video, including video codecs and players </ti></tr>
<tr><ti><path>net-analyzer </path></ti><ti>network usage statistics monitors/analyzers </ti></tr>
<tr><ti><path>net-dialup </path></ti><ti>network dialup clients and servers such as pppd </ti></tr>
<tr><ti><path>net-fs </path></ti><ti>network filesystems </ti></tr>
<tr><ti><path>net-ftp </path></ti><ti>ftp servers and clients </ti></tr>
<tr><ti><path>net-irc </path></ti><ti>irc servers and clients </ti></tr>
<tr><ti><path>net-libs </path></ti><ti>networking-related libraries </ti></tr>
<tr><ti><path>net-mail </path></ti><ti>MTAs and MUAs </ti></tr>
<tr><ti><path>net-misc </path></ti><ti>miscellaneous servers, clients, firewalls, etc. </ti></tr>
<tr><ti><path>net-nds </path></ti><ti>NIS/NIS+ and other network directory services </ti></tr>
<tr><ti><path>net-print </path></ti><ti>print servers and clients </ti></tr>
<tr><ti><path>net-www </path></ti><ti>http/www servers and clients </ti></tr>
<tr><ti><path>sys-apps </path></ti><ti>system-critical applications and utilities </ti></tr>
<tr><ti><path>sys-devel </path></ti><ti>base development packages, such as gcc and make </ti></tr>
<tr><ti><path>sys-kernel </path></ti><ti>Linux kernels and kernel source packages </ti></tr>
<tr><ti><path>sys-libs </path></ti><ti>system-critical libraries such as glibc </ti></tr>
<tr><ti><path>x11-base </path></ti><ti>base X packages, such as XFree86 and drivers for various video cards </ti></tr>
<tr><ti><path>x11-libs </path></ti><ti>widget sets and other X-specific libraries</ti></tr>
<tr><ti><path>x11-terms </path></ti><ti>X-based terminal emulators </ti></tr>
<tr><ti><path>x11-wm </path></ti><ti>X window managers </ti></tr>
</table>
</body>
</section>
<section>
<title>The files Directory</title>
<body><p>Under each package subdirectory is a <path>files</path> directory. You
should place any patches, configuration files, and other
auxillary files your package might require in this
directory. Patches you create yourself just to get your
package to build should be called <path>${PF}-gentoo.diff</path>. You
should not compress these diffs, since they should not be big
enough to require compressing, and cvs does not play well
with binary files.
</p><p>Please add a suffix or prefix such as <path>${PVR}</path> to the tail of every file you put into
the <path>files</path> directory, so that the files used for each
individual version of your ebuild scripts are distinguishable
from one another, and so that the changes between different
revisions are visible.
</p><p>If you have many files that should go into the files
directory, you should create a subdirectory <path>files/${PVR}</path>, and put all these files
in there. If you use this method, you do not need to suffix
the names of the files in this directory with the ebuild version.
</p></body>
</section>
</chapter>
<chapter>
<title>ebuild files</title>
<section>
<title>Introduction</title>
<body><p>ebuild files are the basis for the entire portage
system. They contain all the information required to build a
package, and every installed package requires one of these
files. ebuild files are essentially just bash scripts that
contain a few functions and environment variable settings. The
<c>ebuild</c> command takes care of the rest of the details, such as
merging the package into the filesystem and recording the
package into the package database.
</p></body>
</section>
<section>
<title>Naming ebuild Files</title>
<body><p>ebuild file names are in four sections:</p>
<p>The first section is the package name, which should only
contain lowercase letters, the digits 0-9, and hyphen ('-')
characters.
</p><p>The second section is the version of the package, which should
normally be the same as the version on the main source
tarball. The version is normally made up of two or three numbers
separated by periods, such as <c>1.2</c> or <c>4.5.2</c> (although very long period-separated number sequences <e>are</e> supported), and may have a
single letter immediately following the last digit, e.g., <c>1.4b</c>
or <c>2.6h</c>. This letter should <e>not</e> be used to signify alpha or
beta status for the package. There are four special suffixes that
may be used for these packages: <c>_alpha</c>, <c>_beta</c>, <c>_pre</c> and <c>_rc</c>. Each
of these suffixes may be immediately followed my a number,
e.g., <c>linux-2.4.0_pre10</c>. Assuming identical version parts, an <c>_alpha</c> package is
older than <c>_beta</c>, <c>_beta</c> older than <c>_pre</c>, and <c>_pre</c> older than <c>_rc</c>.
An <c>_rc</c> package is older than a package without an underscore prefix (i.e. <c>linux-2.4.0</c>),
and <c>linux-2.4.0</c> is older than a package with a single letter prefix, i.e. <c>linux-2.4.0b</c>.
As you would expect, the <c>linux-2.4.0b</c> package is considered older than <c>linux-2.4.0c</c>.
All this versioning information is important, as Portage uses it internally to determine whether one package
or ebuild is newer than another with the same category and name.
</p>
<p>The third section of the package name is the Gentoo Linux-specific <e>revision</e> number,
which is specified by <c>-r#</c>, where <c>#</c> is a number,
e.g. <c>package-4.5.3-r3</c>. This revision number is independent of
the version of the source tarball, but if you need to make
non-trivial changes to your ebuild file, you should copy the
ebuild file to a new file with the revision number
incremented by 1. Initial releases normally have no revision
number, e.g. <c>package-4.5.3</c> and default to a revision of zero.
</p><p>The fourth section of the ebuild file name is always the
<c>.ebuild</c> extension.
</p></body>
</section>
<section>
<title>Contents of an ebuild File</title>
<body><p>1. Variable Settings:
</p><p>The first part of every ebuild file is made up of a number of
variable settings. The variables you can set are:</p>
<ul>
<li>P - the name name and version of the package; you should not need to set this, as it is determined from the name of the ebuild file
</li><li>A - the name (without the path) of the main archive file for your package
</li><li>S - the source directory for your package; normally ${WORKDIR}/${P}
</li><li>DESCRIPTION - a short, one line description of your package
</li><li>SRC_URI - the URIs for every source file in your package, separated by whitespace; normally the first one is something like "ftp://ftp.company.com/pub/somepackage/${A}"
</li><li>HOMEPAGE - your package's homepage
</li><li>DEPEND - build dependencies; see the section <uri link="#dependencies">Package Dependencies</uri>
</li><li>RDEPEND - runtime dependencies; see the section <uri link="#dependencies">Package Dependencies</uri>
</li></ul>
<p></p>
</body>
</section>
<section>
<title>Rules for writing an ebuild File</title>
<body><p>(TODO)<!-- todo -->
</p></body>
</section>
</chapter>
<chapter>
<title>Filesystem Locations</title>
<section>
<title>Introduction to the FHS</title>
<body>
<p>The filesystem standard used in Gentoo Linux is the FHS,
short for Filesystem Heirarchy Standard, version 2.0. A simplified
description of the standard is given here; for a complete
specification go to <uri>http://www.ibiblio.org/pub/Linux/docs/fhs/</uri>.</p>
</body>
</section>
<section>
<title>How to fit your packages into the filesystem</title>
<body><p>(TODO)<!-- todo -->
</p></body>
</section>
</chapter>
<chapter>
<title>The Portage scripts and utilities</title>
<section>
<title>Public scripts</title>
<body><p>These are scripts used by the system-administrator to install and remove packages, and maintain the package database.</p>
<ul>
<li>ebuild - the main engine of the Portage system; performs all major tasks such as unpacking, compiling, installing, merging, and unmerging packages </li>
<li>pkgmerge - merges a pre-packaged .tbz2 file for a package
</li></ul>
</body>
</section>
<section>
<title>Private Scripts</title>
<body><p>These are scripts you can use in your ebuild files to perform common tasks.</p>
<ul>
<li>dobin
</li><li>dodeps
</li><li>dodir
</li><li>dodoc
</li><li>doexe
</li><li>dohard
</li><li>doinfo
</li><li>doins
</li><li>dolib
</li><li>dolib.a
</li><li>dolib.so
</li><li>doman
</li><li>domo
</li><li>donewins
</li><li>dopython
</li><li>dosbin
</li><li>dosed
</li><li>dosym
</li><li>find-packages
</li><li>find-requires
</li><li>fowners
</li><li>fperms
</li><li>import-configsettings
</li><li>import-settings
</li><li>megadigest
</li><li>megadownload
</li><li>megatouch
</li><li>newbin
</li><li>newdoc
</li><li>newexe
</li><li>newins
</li><li>newlib.a
</li><li>newlib.so
</li><li>newman
</li><li>newsbin
</li><li>pkgname - splits up a package name into its individual parts, i.e. its name, version, and release number
</li><li>pmake
</li><li>portage-maintain
</li><li>prepall
</li><li>prepalldocs
</li><li>prepallinfo
</li><li>prepallman
</li><li>prepallstrip
</li><li>prepinfo
</li><li>preplib
</li><li>preplib.so
</li><li>prepman
</li><li>prepstrip
</li><li>unpack
</li><li>use
</li></ul></body>
</section>
</chapter>
<chapter>
<title>Package Dependencies</title>
<section>
<title>Why dependencies are important</title>
<body><p>(TODO)<!-- todo -->
</p></body>
</section>
<section>
<title>How to Specify Dependencies in Your ebuild Files</title>
<body><p>(TODO)<!-- todo -->
</p></body>
</section>
</chapter>
</guide>
|