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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
|
Gentoo-HOWTO
Written by Peter Gavin <pete@gentoo.org> and other members of the
Gentoo Team
------------------------------------------------------------------------
This document is a work in progress, and is constantly being updated
and changed. It is by no means complete.
------------------------------------------------------------------------
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
1. ebuild
2. portage-merge
3. portage-unmerge
4. portage-maintain
5. pkgmerge
6. pkgname
B. Private Scripts
1. dobin
2. dodeps
3. dodir
4. dodoc
5. doexe
6. dohard
7. doinfo
8. doins
9. dolib
10. dolib.a
11. dolib.so
12. doman
13. domo
14. donewins
15. dopython
16. dosbin
17. dosed
18. dosym
19. find-packages
20. find-requires
21. fowners
22. fperms
23. import-configsettings
24. import-settings
25. megadigest
26. megadownload
27. megatouch
28. newbin
29. newdoc
30. newexe
31. newins
32. newlib.a
33. newlib.so
34. newman
36. newsbin
37. pkgmerge
38. pmake
39. portage-maintain
40. prepall
41. prepalldocs
42. prepallinfo
43. prepallman
44. prepallstrip
45. prepinfo
46. preplib
47. preplib.so
48. prepman
49. prepstrip
50. unpack
51. use
------------------------------------------------------------------------
I. Introduction
blah, blah, blah... (I'll fill this in later)
II. The Portage Tree
The portage tree is a heirarchy, in which the first level is
the category, and the second is the name of the package.
A. What (Not) to Put in the Portage Tree
The portage tree should only include ebuild files, and other
files in the 'files' directory for each package. 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.
B. Categories
The categories are defined as follows:
app-admin - non-critical system administration utilities
app-arch - non-critical archival/compression utilities
app-cdr - CD recording utilities
app-doc - application documentation
app-editors - non-critical text editors
app-emulation - packages for emulating other systems/OSes
app-misc - applications that don't fit anywhere else
app-office - office-type (word processing, spreadsheet, etc.)
packages
app-shells - non-critical shells and command interpreters
app-text - text processing, spell checkers, and document
formatting packages
dev-db - database libraries
dev-java - java classes/packages/etc.
dev-lang - compilers and interpreters for different languages
dev-libs - miscellaneous developer's libraries
dev-perl - perl modules
dev-python - python modules
dev-ruby - ruby modules
dev-util - various developers utilities
gnome-apps - applications for gnome
gnome-base - base gnome packages
gnome-libs - non-essential gnome libraries
gnome-office - office packages for gnome
kde-apps - applications for kde
kde-base - base kde packages
kde-i18n - kde internationalization packages
media-gfx - graphics related programs
media-libs - libraries for manipulating different media,
including accessing multimedia peripherals of your
computer (sound card, video card, etc.)
media-sound - programs related to sound, including cd-audio
and sound encoding
media-video - programs related to video, including video
codecs and players
net-analyzer - network usage statistics monitors/analyzers
net-dialup - network dialup clients and servers such as pppd
net-fs - network filesystems
net-ftp - ftp servers and clients
net-irc - irc servers and clients
net-libs - networking related libraries
net-mail - mtas and muas
net-misc - miscellaneous servers, clients, firewalls, etc.
net-nds - NIS/NIS+ and other name services
net-print - print servers and clients
net-www - http/www servers and clients
sys-apps - system-critical applications and utilities
sys-devel - base development packages, such as gcc and make
sys-kernel - linux kernels
sys-libs - system-critical libraries such as glibc
x11-base - xfree86 and xfree86 drivers for various video cards
x11-libs - widget sets and other x11 specific libraries
x11-terms - x11 terminal emulators
x11-wm - x11 window managers
C. The files Directory
Under each package subdirectory is a 'files' 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 '${PF}-gentoo.diff'. You
should not compress these diffs, since 1) they should not be big
enough to require compressing, and 2) cvs does not play well
with binary files.
Please add a suffix or prefix such as ${PV}-r${PR} (or just
${PV} if ${PR} is 0) to the tail of every file you put into
the files 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.
If you have many files that should go into the files
directory, you should create a subdirectory files/${PV}-${PR}
(or just files/${PV} if ${PR} is 0), 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.
III. .ebuild Files
.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
ebuild 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.
A. Naming .ebuild Files
.ebuild file names are in four sections.
The first section is the package name, which should only
contain lowercase letters, the digits 0-9, and hyphen ('-')
characters.
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 2 or 3 numbers
separated by periods, such as 1.2 or 4.5.2, and may have a
single letter immidiately following the last digit, e.g., 1.4b
or 2.6h. This letter should *not* be used to signify alpha or
beta status for the package. There are 3 special suffixes that
may be used for these packages: _alpha, _beta, and _pre. Each
of these suffixes may be immediately followed my a number,
e.g., 'linux-2.4.0_pre10'.
The third section of the package name is the revision number,
which is specified by -r#, where '#' is a number,
e.g. 'package-4.5.3-r3'. 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. 'package-4.5.3'.
The fourth section of the .ebuild file name is always the
.ebuild extension.
B. Contents of an .ebuild File
1. Variable Settings
The first part of every ebuild file is made up of a number of
variable settings. The variables you can set are
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
1. ebuild
2. portage-merge
3. portage-unmerge
4. portage-maintain
5. pkgmerge
6. pkgname
B. Private Scripts
1. dobin
2. dodeps
3. dodir
4. dodoc
5. doexe
6. dohard
7. doinfo
8. doins
9. dolib
10. dolib.a
11. dolib.so
12. doman
13. domo
14. donewins
15. dopython
16. dosbin
17. dosed
18. dosym
19. find-packages
20. find-requires
21. fowners
22. fperms
23. import-configsettings
24. import-settings
25. megadigest
26. megadownload
27. megatouch
28. newbin
29. newdoc
30. newexe
31. newins
32. newlib.a
33. newlib.so
34. newman
36. newsbin
37. pkgmerge
38. pmake
39. portage-maintain
40. prepall
41. prepalldocs
42. prepallinfo
43. prepallman
44. prepallstrip
45. prepinfo
46. preplib
47. preplib.so
48. prepman
49. prepstrip
50. unpack
51. use
|