aboutsummaryrefslogtreecommitdiff
blob: 422089f80fe2e3a3172d7c0a1efacc69d0f7136a (plain)
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
<?xml version="1.0"?>
<guide self="ebuild-writing/functions/pkg_config/">
<chapter>
<title>pkg_config</title>

<body>
<table>
  <tr>
    <th>Function</th>
    <ti><c>pkg_config</c></ti>
  </tr>
  <tr>
    <th>Purpose</th>
    <ti>Run any special post-install configuration</ti>
  </tr>
  <tr>
    <th>Sandbox</th>
    <ti>Disabled</ti>
  </tr>
  <tr>
    <th>Privilege</th>
    <ti>root</ti>
  </tr>
  <tr>
    <th>Called for</th>
    <ti>manual</ti>
  </tr>
</table>
</body>

<section>
<title>Default <c>pkg_config</c></title>
<body>
<codesample lang="ebuild">
pkg_config()
{
    eerror "This ebuild does not have a config function."
}
</codesample>
</body>
</section>

<section>
<title>Example <c>pkg_config</c></title>
<body>
<p>
Taken from the <c>mysql</c> ebuilds. Note the use of <c>${ROOT}</c>.
</p>

<codesample lang="ebuild">
pkg_config() {
    if [ ! -d "${ROOT}"/var/lib/mysql/mysql ] ; then
        einfo "Press ENTER to create the mysql database and set proper"
        einfo "permissions on it, or Control-C to abort now..."
        read
        "${ROOT}"/usr/bin/mysql_install_db
    else
        einfo "Hmm, it appears as though you already have the mysql"
        einfo "database in place.  If you are having problems trying"
        einfo "to start mysqld, perhaps you need to manually run"
        einfo "/usr/bin/mysql_install_db and/or check your config"
        einfo "file(s) and/or database(s) and/or logfile(s)."
    fi
}
</codesample>
</body>
</section>

</chapter>
</guide>