1 | PortSystem 1.0 |
---|
2 | name mysql4 |
---|
3 | version 4.0.15a |
---|
4 | categories databases |
---|
5 | maintainers bchesneau@mac.com |
---|
6 | description Multithreaded SQL database server |
---|
7 | long_description MySQL is an open-source, multi-threaded SQL database \ |
---|
8 | with a command syntax very similar to mSQL. |
---|
9 | homepage http://www.mysql.com/ |
---|
10 | platforms darwin |
---|
11 | master_sites ftp://ftp.sunet.se/pub/unix/databases/relational/mysql/Downloads/MySQL-4.0 \ |
---|
12 | http://mysql-mirror.free.fr/Downloads/MySQL-4.0 \ |
---|
13 | ftp://ftp.FreeBSD.org/pub/FreeBSD/distfiles |
---|
14 | |
---|
15 | set filename mysql-${version}${extract.sufx} |
---|
16 | distfiles ${filename} |
---|
17 | distname mysql-${version} |
---|
18 | extract.only ${filename} |
---|
19 | checksums mysql-4.0.15a.tar.gz md5 45ee33e80667bb7af3fd6ea8cd1f264c |
---|
20 | |
---|
21 | variant darwin { |
---|
22 | depends_lib-append lib:libdl.1:dlcompat |
---|
23 | } |
---|
24 | |
---|
25 | set dbdir ${prefix}/var/db/mysql |
---|
26 | |
---|
27 | configure.env LDFLAGS=-L${prefix}/lib\\ -lncurses \ |
---|
28 | CPPFLAGS=-I${prefix}/include |
---|
29 | |
---|
30 | |
---|
31 | configure.args --sysconfdir=${prefix}/etc/mysql4 --without-bench |
---|
32 | |
---|
33 | |
---|
34 | pre-configure { |
---|
35 | if { ![variant_isset server] } { |
---|
36 | configure.args-append --without-server |
---|
37 | } |
---|
38 | } |
---|
39 | |
---|
40 | variant innodb { |
---|
41 | configure.args-append --with-innodb |
---|
42 | } |
---|
43 | |
---|
44 | variant debug { |
---|
45 | configure.args-append --with-debug |
---|
46 | } |
---|
47 | |
---|
48 | variant server { |
---|
49 | depends_run path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup |
---|
50 | configure.args-append --localstatedir=${dbdir} --with-unix-socket-path=${prefix}/var/run/mysqld/mysqld.sock |
---|
51 | |
---|
52 | } |
---|
53 | |
---|
54 | pre-destroot { |
---|
55 | |
---|
56 | if { [variant_isset server] } { |
---|
57 | system "install -o mysql -g mysql -m 775 -d ${destroot}${dbdir}" |
---|
58 | |
---|
59 | file mkdir ${destroot}${prefix}/var/run/mysqld |
---|
60 | system "touch ${destroot}${prefix}/var/run/mysqld/.keep" |
---|
61 | system "chown -R mysql:mysql ${destroot}${prefix}/var/run/mysqld" |
---|
62 | } |
---|
63 | |
---|
64 | |
---|
65 | file mkdir ${destroot}${prefix}/var/log/mysql |
---|
66 | system "touch ${destroot}${prefix}/var/log/mysql/.keep" |
---|
67 | system "chown mysql:mysql ${destroot}${prefix}/var/log/mysql" |
---|
68 | |
---|
69 | } |
---|
70 | |
---|
71 | post-destroot { |
---|
72 | |
---|
73 | file mkdir ${destroot}${prefix}/etc/mysql4 |
---|
74 | system "cp ${portpath}/files/my.cnf ${destroot}${prefix}/etc/mysql4/my.cnf.sample" |
---|
75 | reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/mysql4/my.cnf.sample |
---|
76 | |
---|
77 | if { [variant_isset server] } { |
---|
78 | addgroup mysql |
---|
79 | set gid [existsgroup mysql] |
---|
80 | adduser mysql gid=${gid} realname=MySQL\ Server |
---|
81 | system "install -o root -m 755 -d ${destroot}${prefix}/etc/rc.d" |
---|
82 | system "install -o root -m 755 -c ${portpath}/files/mysql4.sh ${destroot}${prefix}/etc/rc.d/" |
---|
83 | reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/rc.d/mysql4.sh |
---|
84 | } |
---|
85 | |
---|
86 | } |
---|