1 | PortSystem 1.0 |
---|
2 | name mysql4 |
---|
3 | version 4.0.14 |
---|
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.14.tar.gz md5 9764f09c89692345d3b7800ab014f822 |
---|
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 | configure.args --localstatedir=${dbdir} --without-server --sysconfdir=${prefix}/etc --without-bench |
---|
31 | |
---|
32 | variant innodb { |
---|
33 | configure.args-append --with-innodb |
---|
34 | } |
---|
35 | |
---|
36 | variant server { |
---|
37 | depends_run path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup |
---|
38 | configure.args --localstatedir=${dbdir} --sysconfdir=${prefix}/etc --without-bench --with-innodb --with-unix-socket-path=${prefix}/var/run/mysqld/mysqld.sock |
---|
39 | |
---|
40 | pre-destroot { |
---|
41 | system "install -o mysql -g mysql -m 775 -d ${destroot}${dbdir}" |
---|
42 | file mkdir ${destroot}${prefix}/var/run |
---|
43 | file mkdir ${destroot}${prefix}/var/run/mysqld |
---|
44 | file mkdir ${destroot}${prefix}/var/logs |
---|
45 | file mkdir ${destroot}${prefix}/var/log/mysql |
---|
46 | system "touch ${destroot}${prefix}/var/run/mysqld/.turd \ |
---|
47 | ${destroot}${prefix}/var/log/mysql/.turd" |
---|
48 | system "chown mysql:mysql ${destroot}${prefix}/var/log/mysql" |
---|
49 | system "chown mysql:mysql ${destroot}${prefix}/var/run/mysqld" |
---|
50 | } |
---|
51 | |
---|
52 | post-destroot { |
---|
53 | addgroup mysql |
---|
54 | set gid [existsgroup mysql] |
---|
55 | adduser mysql gid=${gid} realname=MySQL\ Server |
---|
56 | |
---|
57 | system "install -o root -m 755 -d ${destroot}${prefix}/etc/rc.d" |
---|
58 | |
---|
59 | system "install -o root -m 755 -c ${portpath}/files/mysql4.sh ${destroot}${prefix}/etc/rc.d/" |
---|
60 | reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/rc.d/mysql4.sh |
---|
61 | |
---|
62 | system "cp ${portpath}/files/my.cnf ${destroot}${prefix}/etc/my.cnf" |
---|
63 | reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/my.cnf |
---|
64 | } |
---|
65 | } |
---|