Ticket #12313: mysql5-server-Portfile

File mysql5-server-Portfile, 1.6 KB (added by sfiera@…, 17 years ago)
Line 
1# $Id$
2
3PortSystem          1.0
4
5name                mysql5-server
6version             5.0.45
7homepage            http://www.mysql.com/
8categories          databases
9platforms           darwin
10maintainers         ryandesign
11distfiles
12
13description \
14        Multithreaded SQL database server
15
16long_description \
17        MySQL is an open-source, multi-threaded SQL database \
18        with a command syntax very similar to mSQL. This port \
19        installs a server for it.
20
21depends_build       port:mysql5-client
22
23set mysql           mysql5
24set dbdir           ${prefix}/var/db/${mysql}
25set mysqluser       mysql
26
27use_configure       no
28build {}
29
30# Create a startupitem to start/stop the server
31startupitem.create      yes
32startupitem.start       "${prefix}/share/mysql5/mysql/mysql.server start"
33startupitem.stop        "${prefix}/share/mysql5/mysql/mysql.server stop"
34
35destroot {
36        addgroup ${mysqluser}
37        set gid [existsgroup ${mysqluser}]
38        adduser ${mysqluser} gid=${gid} realname=MySQL\ Server
39       
40        # Some directories we must have only if we're running as a server
41        xinstall -m 755 -o root -d ${destroot}${prefix}/var/run
42       
43        xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \
44        ${destroot}${dbdir} \
45                ${destroot}${prefix}/var/run/${mysql}
46        destroot.keepdirs-append  \
47                ${destroot}${dbdir} \
48                ${destroot}${prefix}/var/run/${mysql}
49}
50
51post-install {
52        ui_msg "******************************************************"
53        ui_msg "* In order to setup the database, you might want to run"
54        ui_msg "* sudo -u ${mysqluser} mysql_install_db5"
55        ui_msg "* if this is a new install"
56        ui_msg "******************************************************"
57}