| 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 | 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/mysql4 --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}/etc/mysql4 |
|---|
| 43 | file mkdir ${destroot}${prefix}/var/run |
|---|
| 44 | file mkdir ${destroot}${prefix}/var/run/mysqld |
|---|
| 45 | file mkdir ${destroot}${prefix}/var/log |
|---|
| 46 | file mkdir ${destroot}${prefix}/var/log/mysql |
|---|
| 47 | system "touch ${destroot}${prefix}/var/run/mysqld/.turd \ |
|---|
| 48 | ${destroot}${prefix}/var/log/mysql/.turd" |
|---|
| 49 | system "chown mysql:mysql ${destroot}${prefix}/var/log/mysql" |
|---|
| 50 | system "chown mysql:mysql ${destroot}${prefix}/var/run/mysqld" |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | post-destroot { |
|---|
| 54 | addgroup mysql |
|---|
| 55 | set gid [existsgroup mysql] |
|---|
| 56 | adduser mysql gid=${gid} realname=MySQL\ Server |
|---|
| 57 | |
|---|
| 58 | system "install -o root -m 755 -d ${destroot}${prefix}/etc/rc.d" |
|---|
| 59 | |
|---|
| 60 | system "install -o root -m 755 -c ${portpath}/files/mysql4.sh ${destroot}${prefix}/etc/rc.d/" |
|---|
| 61 | reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/rc.d/mysql4.sh |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | system "cp ${portpath}/files/my.cnf ${destroot}${prefix}/etc/mysql4/my.cnf" |
|---|
| 65 | reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc//mysql4/my.cnf |
|---|
| 66 | } |
|---|
| 67 | } |
|---|