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 | addgroup mysql |
---|
57 | set gid [existsgroup mysql] |
---|
58 | adduser mysql gid=${gid} realname=MySQL\ Server |
---|
59 | |
---|
60 | if { [variant_isset server] } { |
---|
61 | system "install -o mysql -g mysql -m 775 -d ${destroot}${dbdir}" |
---|
62 | |
---|
63 | file mkdir ${destroot}${prefix}/var/run/mysqld |
---|
64 | system "touch ${destroot}${prefix}/var/run/mysqld/.keep" |
---|
65 | system "chown -R mysql:mysql ${destroot}${prefix}/var/run/mysqld" |
---|
66 | } |
---|
67 | |
---|
68 | |
---|
69 | file mkdir ${destroot}${prefix}/var/log/mysql |
---|
70 | system "touch ${destroot}${prefix}/var/log/mysql/.keep" |
---|
71 | system "chown mysql:mysql ${destroot}${prefix}/var/log/mysql" |
---|
72 | |
---|
73 | } |
---|
74 | |
---|
75 | post-destroot { |
---|
76 | |
---|
77 | file mkdir ${destroot}${prefix}/etc/mysql4 |
---|
78 | system "cp ${portpath}/files/my.cnf ${destroot}${prefix}/etc/mysql4/my.cnf.sample" |
---|
79 | reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/mysql4/my.cnf.sample |
---|
80 | |
---|
81 | if { [variant_isset server] } { |
---|
82 | |
---|
83 | system "install -o root -m 755 -d ${destroot}${prefix}/etc/rc.d" |
---|
84 | system "install -o root -m 755 -c ${portpath}/files/mysql4.sh ${destroot}${prefix}/etc/rc.d/" |
---|
85 | reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/rc.d/mysql4.sh |
---|
86 | } |
---|
87 | |
---|
88 | } |
---|