# $Id: Portfile 33297 2008-01-23 09:32:47Z ryandesign@macports.org $ PortSystem 1.0 name mysql4 version 4.1.22 categories databases maintainers nomaintainer 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/ platforms darwin set sitedir Downloads/MySQL-4.1/ master_sites http://www.mirrorservice.org/sites/ftp.mysql.com/${sitedir} \ http://www.softagency.co.jp/MySQL/${sitedir} \ http://mirrors.tilian.co.uk/mysql.com/${sitedir} \ ftp://planetmirror.com/pub/mysql/${sitedir} \ ftp://sunsite.dk/mirrors/mysql/${sitedir} \ http://mysql.mediatraffic.fi/${sitedir} \ ftp://filepile.tiscali.de/mirror/mysql/${sitedir} \ ftp://ftp.rtfm.no/pub/mysql/${sitedir} \ http://www.mysql.cz/${sitedir} \ ftp://ftp.u-paris10.fr/mysql.com/${sitedir} \ http://mysql.oms-net.nl/${sitedir} \ ftp://ftp.free.fr/pub/MySQL\${sitedir} distname mysql-${version} checksums md5 37b4479951fa0cf052269d27c41ca200 depends_lib port:openssl set dbdir ${prefix}/var/db/mysql post-patch { reinplace "s%/etc/my.cnf%${prefix}/etc/${name}/my.cnf%g" \ ${worksrcpath}/scripts/mysqlaccess.sh \ ${worksrcpath}/scripts/mysqld_multi.sh \ ${worksrcpath}/scripts/mysqldumpslow.sh \ ${worksrcpath}/scripts/mysqlhotcopy.sh \ ${worksrcpath}/sql-bench/bench-init.pl.sh \ ${worksrcpath}/support-files/my-huge.cnf.sh \ ${worksrcpath}/support-files/my-innodb-heavy-4G.cnf.sh \ ${worksrcpath}/support-files/my-large.cnf.sh \ ${worksrcpath}/support-files/my-medium.cnf.sh \ ${worksrcpath}/support-files/my-small.cnf.sh \ ${worksrcpath}/support-files/mysql.server.sh reinplace "s%/etc/%${prefix}/etc/${name}/%g" \ ${worksrcpath}/mysys/default.c } platform darwin 6 { depends_lib-append lib:libdl:dlcompat configure.ldflags-append "-lncurses" configure.cflags "-O3 -fno-omit-frame-pointer" configure.cxx gcc configure.cxxflags "-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" } platform darwin 7 { configure.ldflags "-lncurses" configure.cflags "-O3 -fno-omit-frame-pointer" configure.cxx gcc configure.cxxflags "-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" configure.env-append LIBS=-ldl } configure.args --sysconfdir=${prefix}/etc/${name} --without-debug \ --without-bench \ --mandir=${prefix}/share/man --infodir=${prefix}/share/info \ --enable-thread-safe-client --with-extra-charsets=complex \ --with-openssl=${prefix} --with-innodb \ --localstatedir=${dbdir} \ --with-unix-socket-path=${prefix}/var/run/mysqld/mysqld.sock \ --with-mysqld-user=mysql 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 { xinstall -m 755 -d ${destroot}${prefix}/var/log/mysql destroot.keepdirs ${destroot}${prefix}/var/log/mysql if { [variant_isset server] } { addgroup mysql set gid [existsgroup mysql] adduser mysql gid=${gid} realname=MySQL\ Server system "chown mysql:mysql ${destroot}${prefix}/var/log/mysql" } } post-destroot { system "rm -rf ${destroot}${prefix}/mysql-test" xinstall -m 775 -d ${destroot}${dbdir} xinstall -m 755 -d ${destroot}${prefix}/var/run/mysqld destroot.keepdirs-append ${destroot}${dbdir} destroot.keepdirs-append ${destroot}${prefix}/var/run/mysqld if { [variant_isset server] } { xinstall -o root -m 755 -d ${destroot}${prefix}/etc/${name} xinstall -o root -m 644 -c ${filespath}/my.cnf ${destroot}${prefix}/etc/${name}/my.cnf.sample reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/${name}/my.cnf.sample xinstall -o mysql -g mysql -m 775 -d ${destroot}${dbdir} destroot.keepdirs-append ${destroot}${dbdir} system "chown -R mysql:mysql ${destroot}${dbdir}" xinstall -o mysql -g mysql -m 755 -d ${destroot}${prefix}/var/run/mysqld destroot.keepdirs-append ${destroot}${prefix}/var/run/mysqld system "chown -R mysql:mysql ${destroot}${prefix}/var/run/mysqld" } } post-install { ui_msg "******************************************************" ui_msg "* You might want to run *" ui_msg "* sudo -u mysql mysql_install_db *" ui_msg "* if this is a new install *" ui_msg "* *" ui_msg "* If you did not choose the server variant you may *" ui_msg "* add a mysql user and you will need to change the *" ui_msg "* ownership to that user for the following: *" ui_msg "* ${dbdir} *" ui_msg "* ${prefix}/var/run/mysqld *" ui_msg "* ${prefix}/var/log/mysql *" ui_msg "******************************************************" }