Initial commit of src_prepare function
authorMarkos Chandras <hwoarang@gentoo.org>
Fri, 16 Jul 2010 12:45:51 +0000 (15:45 +0300)
committerMarkos Chandras <hwoarang@gentoo.org>
Fri, 16 Jul 2010 16:54:15 +0000 (19:54 +0300)
ebuild-writing/functions/src_prepare/text.xml [new file with mode: 0644]
ebuild-writing/functions/text.xml

diff --git a/ebuild-writing/functions/src_prepare/text.xml b/ebuild-writing/functions/src_prepare/text.xml
new file mode 100644 (file)
index 0000000..83c0a17
--- /dev/null
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<guide self="ebuild-writing/functions/src_prepare/">
+<chapter>
+<title>src_prepare</title>
+
+<body>
+<table>
+  <tr>
+    <th>Function</th>
+    <ti><c>src_prepare</c></ti>
+  </tr>
+  <tr>
+    <th>Purpose</th>
+    <ti>Prepare source packages and do any necessary patching or fixes.</ti>
+  </tr>
+  <tr>
+    <th>Sandbox</th>
+    <ti>Enabled</ti>
+  </tr>
+  <tr>
+    <th>Privilege</th>
+    <ti>user</ti>
+  </tr>
+  <tr>
+    <th>Called for</th>
+    <ti>ebuild</ti>
+  </tr>
+</table>
+</body>
+
+<section>
+<title>Default <c>src_prepare</c></title>
+<body>
+<p>
+Starting from EAPI="2", src_prepare function is the appropriate area to perform
+any kind of patching and source code manipulation instead of src_unpack.
+</p>
+<codesample lang="ebuild">
+src_prepare() {
+       true;
+}
+</codesample>
+</body>
+</section>
+
+<section>
+<title>Sample <c>src_prepare</c></title>
+<body>
+<codesample lang="ebuild">
+src_prepare() {
+    epatch "${FILESDIR}/${PV}/${P}-fix-bogosity.patch"
+    use pam &amp;&amp; epatch "${FILESDIR}/${PV}/${P}-pam.patch"
+
+    sed -i -e 's/"ispell"/"aspell"/' src/defaults.h || die "Sed failed!"
+}
+</codesample>
+</body>
+</section>
+
+</chapter>
+</guide>
index f0bc37a..d634ad7 100644 (file)
@@ -6,7 +6,7 @@
 <body>
 <p>
 When installing packages from source, the function call order is <c>pkg_setup</c>,
-<c>src_unpack</c>, <c>src_compile</c>, <c>src_test</c> (optional, <c>FEATURES="test"</c>),
+<c>src_unpack</c>, <c>src_prepare</c>, <c>src_compile</c>, <c>src_test</c> (optional, <c>FEATURES="test"</c>),
 <c>src_install</c>, <c>pkg_preinst</c>, <c>pkg_postinst</c>. When installing packages
 from a binary, the function call order is <c>pkg_setup</c>, <c>pkg_preinst</c>,
 <c>pkg_postinst</c>.
@@ -46,6 +46,7 @@ page for further information.
 <include href="pkg_nofetch/"/>
 <include href="pkg_setup/"/>
 <include href="src_unpack/"/>
+<include href="src_prepare/"/>
 <include href="src_compile/"/>
 <include href="src_test/"/>
 <include href="src_install/"/>