1 |
# Copyright 1999-2004 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: $ |
4 |
|
5 |
# NOTE: The comments in this file are for instruction and documentation. |
6 |
# They're not meant to appear with your final, production ebuild. Please |
7 |
# remember to remove them before submitting or committing your ebuild. That |
8 |
# doesn't mean you can't add your own comments though. |
9 |
|
10 |
# The 'Header' on the third line should just be left alone. When your ebuild |
11 |
# will be committed to cvs, the details on that line will be automatically |
12 |
# generated to contain the correct data. |
13 |
|
14 |
# inherit lists eclasses to inherit functions from. Almost all ebuilds should |
15 |
# inherit eutils, as a large amount of important functionality has been |
16 |
# moved there. For example, the $(get_libdir) mentioned below wont work |
17 |
# without the following line: |
18 |
inherit eutils |
19 |
# A well-used example of an eclass function that needs eutils is epatch. If |
20 |
# your source needs patches applied, it's suggested to put your patch in the |
21 |
# 'files' directory and use: |
22 |
# |
23 |
# epatch ${FILESDIR}/patch-name-here |
24 |
# |
25 |
# eclasses tend to list descriptions of how to use their functions properly. |
26 |
# take a look at /usr/portage/eclasses/ for more examples. |
27 |
|
28 |
# Short one-line description of this package. |
29 |
DESCRIPTION="This is a sample skeleton ebuild file" |
30 |
|
31 |
# Homepage, not used by Portage directly but handy for developer reference |
32 |
HOMEPAGE="http://foo.bar.com/" |
33 |
|
34 |
# Point to any required sources; these will be automatically downloaded by |
35 |
# Portage. |
36 |
SRC_URI="ftp://foo.bar.com/${P}.tar.gz" |
37 |
|
38 |
# License of the package. This must match the name of file(s) in |
39 |
# /usr/portage/licenses/. For complex license combination see the developer |
40 |
# docs on gentoo.org for details. |
41 |
LICENSE="" |
42 |
|
43 |
# The SLOT variable is used to tell Portage if it's OK to keep multiple |
44 |
# versions of the same package installed at the same time. For example, |
45 |
# if we have a libfoo-1.2.2 and libfoo-1.3.2 (which is not compatible |
46 |
# with 1.2.2), it would be optimal to instruct Portage to not remove |
47 |
# libfoo-1.2.2 if we decide to upgrade to libfoo-1.3.2. To do this, |
48 |
# we specify SLOT="1.2" in libfoo-1.2.2 and SLOT="1.3" in libfoo-1.3.2. |
49 |
# emerge clean understands SLOTs, and will keep the most recent version |
50 |
# of each SLOT and remove everything else. |
51 |
# Note that normal applications should use SLOT="0" if possible, since |
52 |
# there should only be exactly one version installed at a time. |
53 |
# DO NOT USE SLOT=""! This tells Portage to disable SLOTs for this package. |
54 |
SLOT="0" |
55 |
|
56 |
# Using KEYWORDS, we can record masking information *inside* an ebuild |
57 |
# instead of relying on an external package.mask file. Right now, you |
58 |
# should set the KEYWORDS variable for every ebuild so that it contains |
59 |
# the names of all the architectures with which the ebuild works. All of |
60 |
# the official architectures can be found in the keywords.desc file which |
61 |
# is in /usr/portage/profiles/. Usually you should just set this to "~x86". |
62 |
# The ~ in front of the architecture indicates that the package is new and |
63 |
# should be considered unstable until testing proves its stability. Once |
64 |
# packages go stable the ~ prefix is removed. So, if you've confirmed that |
65 |
# your ebuild works on x86 and ppc, you'd specify: KEYWORDS="~x86 ~ppc" |
66 |
# For packages that are platform-independent (like Java, PHP or Perl |
67 |
# applications) specify all keywords. |
68 |
# For binary packages, use -* and then list the archs the bin package |
69 |
# exists for. If the package was for an x86 binary package, then |
70 |
# KEYWORDS would be set like this: KEYWORDS="-* x86" |
71 |
# DO NOT USE KEYWORDS="*". This is deprecated and only for backward |
72 |
# compatibility reasons. |
73 |
KEYWORDS="~x86" |
74 |
|
75 |
# Comprehensive list of any and all USE flags leveraged in the ebuild, |
76 |
# with the exception of any ARCH specific flags, i.e. "ppc", "sparc", |
77 |
# "x86" and "alpha". This is a required variable. If the ebuild doesn't |
78 |
# use any USE flags, set to "". |
79 |
IUSE="X gnome" |
80 |
|
81 |
# A space delimited list of portage features to restrict. man 5 ebuild |
82 |
# for details. Usually not needed. |
83 |
#RESTRICT="nostrip" |
84 |
|
85 |
# Build-time dependencies, such as |
86 |
# ssl? ( >=dev-libs/openssl-0.9.6b ) |
87 |
# >=dev-lang/perl-5.6.1-r1 |
88 |
# It is advisable to use the >= syntax show above, to reflect what you |
89 |
# had installed on your system when you tested the package. Then |
90 |
# other users hopefully won't be caught without the right version of |
91 |
# a dependency. |
92 |
DEPEND="" |
93 |
|
94 |
# Run-time dependencies, same as DEPEND if RDEPEND isn't defined: |
95 |
#RDEPEND="" |
96 |
|
97 |
# Source directory; the dir where the sources can be found (automatically |
98 |
# unpacked) inside ${WORKDIR}. The default value for S is ${WORKDIR}/${P} |
99 |
# If you don't need to change it, leave the S= line out of the ebuild |
100 |
# to keep it tidy. |
101 |
S=${WORKDIR}/${P} |
102 |
|
103 |
src_compile() { |
104 |
# Most open-source packages use GNU autoconf for configuration. |
105 |
# You should use something similar to the following lines to |
106 |
# configure your package before compilation. The "|| die" portion |
107 |
# at the end will stop the build process if the command fails. |
108 |
# You should use this at the end of critical commands in the build |
109 |
# process. (Hint: Most commands are critical, that is, the build |
110 |
# process should abort if they aren't successful.) |
111 |
./configure \ |
112 |
--host=${CHOST} \ |
113 |
--prefix=/usr \ |
114 |
--infodir=/usr/share/info \ |
115 |
--mandir=/usr/share/man || die "./configure failed" |
116 |
# Note the use of --infodir and --mandir, above. This is to make |
117 |
# this package FHS 2.2-compliant. For more information, see |
118 |
# http://www.pathname.com/fhs/ |
119 |
|
120 |
# Also note that it is cleaner and easier to use econf, which is the |
121 |
# portage shortcut to the above ./configure statement: |
122 |
# |
123 |
# econf || die |
124 |
# Note that econf will die on failure, but please use econf || die |
125 |
# for consistency. |
126 |
|
127 |
# emake (previously known as pmake) is a script that calls the |
128 |
# standard GNU make with parallel building options for speedier |
129 |
# builds (especially on SMP systems). Try emake first. It might |
130 |
# not work for some packages, because some makefiles have bugs |
131 |
# related to parallelism, in these cases, use emake -j1 to limit |
132 |
# make to a single process. The -j1 is a visual clue to others |
133 |
# that the makefiles have bugs that have been worked around. |
134 |
emake || die "emake failed" |
135 |
} |
136 |
|
137 |
src_install() { |
138 |
# You must *personally verify* that this trick doesn't install |
139 |
# anything outside of DESTDIR; do this by reading and |
140 |
# understanding the install part of the Makefiles. |
141 |
make DESTDIR=${D} install || die |
142 |
# For Makefiles that don't make proper use of DESTDIR, setting |
143 |
# prefix is often an alternative. However if you do this, then |
144 |
# you also need to specify mandir and infodir, since they were |
145 |
# passed to ./configure as absolute paths (overriding the prefix |
146 |
# setting). |
147 |
#make \ |
148 |
# prefix=${D}/usr \ |
149 |
# mandir=${D}/usr/share/man \ |
150 |
# infodir=${D}/usr/share/info \ |
151 |
# libdir=${D}/usr/$(get_libdir) \ |
152 |
# install || die |
153 |
# Again, verify the Makefiles! We don't want anything falling |
154 |
# outside of ${D}. |
155 |
|
156 |
# The portage shortcut to the above command is simply: |
157 |
# |
158 |
#einstall || die |
159 |
# Note that einstall will die on failure, but please use einstall || die |
160 |
# for consistency. |
161 |
} |