# $Id: Portfile,v 1.7 2005/09/06 19:06:07 jberry Exp $ PortSystem 1.0 name mysql5 version 5.0.12-beta categories databases platforms darwin maintainers jberry@opendarwin.org mww@opendarwin.org description Multithreaded SQL database server long_description MySQL is an open-source, multi-threaded SQL database \ with a command syntax very similar to mSQL. homepage http://www.mysql.com/ master_sites http://ftp.plusline.de/mysql/Downloads/MySQL-5.0/ distname mysql-${version} checksums md5 52ce66773505a9128accc64b44d1ecf2 depends_lib port:zlib \ port:openssl set dbdir ${prefix}/var/db/${name} set mysqluser mysql configure.args --mandir=${prefix}/share/man \ --infodir=${prefix}/share/info \ --localstatedir=${dbdir} \ --sysconfdir=${prefix}/etc/${name} \ --with-zlib-dir=${prefix} \ --with-openssl=${prefix} \ --with-unix-socket-path=${prefix}/var/run/${name}/mysqld.sock \ --with-mysqld-user=${mysqluser} \ --without-docs \ --without-bench variant server { # Create a startupitem to start/stop the server startupitem.create yes startupitem.start "${prefix}/share/mysql/mysql.server start" startupitem.stop "${prefix}/share/mysql/mysql.server stop" } pre-destroot { # Some directories we must have in all cases xinstall -m 755 -d ${destroot}${prefix}/etc/${name} destroot.keepdirs-append ${destroot}${prefix}/etc/${name} # Setup only for server if { [variant_isset server] } { addgroup ${mysqluser} set gid [existsgroup ${mysqluser}] adduser ${mysqluser} gid=${gid} realname=MySQL\ Server # Some directories we must have only if we're running as a server xinstall -m 755 -o root -d ${destroot}${prefix}/var/run xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \ ${destroot}${dbdir} \ ${destroot}${prefix}/var/run/${name} destroot.keepdirs-append \ ${destroot}${dbdir} \ ${destroot}${prefix}/var/run/${name} } } post-destroot { system "rm -rf ${destroot}${prefix}/mysql-test/" } post-install { if { [variant_isset server] } { ui_msg "******************************************************" ui_msg "* You might want to run" ui_msg "* sudo -u ${mysqluser} mysql_install_db" ui_msg "* if this is a new install" ui_msg "******************************************************" } }