# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 # $Id$ PortSystem 1.0 name mysql5 version 5.1.71 # Please set revision_client and revision_server to 0 if you bump version. set revision_client 0 set revision_server 0 set version_branch [join [lrange [split ${version} .] 0 1] .] homepage http://www.mysql.com/ categories databases platforms darwin maintainers ryandesign pixilla license GPL-2 distname mysql-${version} dist_subdir mysql51 use_parallel_build yes description \ Multithreaded SQL database server long_description \ MySQL is an open-source, multi-threaded SQL database \ with a command syntax very similar to mSQL. master_sites \ http://artfiles.org/mysql/Downloads/MySQL-${version_branch}/ \ http://ftp.arnes.si/mysql/Downloads/MySQL-${version_branch}/ \ http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-${version_branch}/ \ http://ftp.heanet.ie/mirrors/www.mysql.com/Downloads/MySQL-${version_branch}/ \ http://ftp.iij.ad.jp/pub/db/mysql/Downloads/MySQL-${version_branch}/ \ http://ftp.itu.edu.tr/Mirror/Mysql/Downloads/MySQL-${version_branch}/ \ http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-${version_branch}/ \ http://ftp.ntua.gr/pub/databases/mysql/Downloads/MySQL-${version_branch}/ \ http://ftp.sunet.se/pub/unix/databases/relational/mysql/Downloads/MySQL-${version_branch}/ \ http://gd.tuwien.ac.at/db/mysql/Downloads/MySQL-${version_branch}/ \ http://it.mysql.contactlab.it/Downloads/MySQL-${version_branch}/ \ http://linorg.usp.br/mysql/Downloads/MySQL-${version_branch}/ \ http://mirror.csclub.uwaterloo.ca/mysql/Downloads/MySQL-${version_branch}/ \ http://mirror.leaseweb.com/mysql/Downloads/MySQL-${version_branch}/ \ http://mirror.switch.ch/ftp/mirror/mysql/Downloads/MySQL-${version_branch}/ \ http://mirror.trouble-free.net/mysql_mirror/Downloads/MySQL-${version_branch}/ \ http://mirrors.dedipower.com/www.mysql.com/Downloads/MySQL-${version_branch}/ \ http://mirrors.dotsrc.org/mysql/Downloads/MySQL-${version_branch}/ \ http://mirrors.ircam.fr/pub/mysql/Downloads/MySQL-${version_branch}/ \ http://mirrors.ukfast.co.uk/sites/ftp.mysql.com/Downloads/MySQL-${version_branch}/ \ http://mirrors.xservers.ro/mysql/Downloads/MySQL-${version_branch}/ \ http://mysql.blic.net/Downloads/MySQL-${version_branch}/ \ http://mysql.cdpa.nsysu.edu.tw/Downloads/MySQL-${version_branch}/ \ http://mysql.cs.pu.edu.tw/Downloads/MySQL-${version_branch}/ \ http://mysql.dataphone.se/Downloads/MySQL-${version_branch}/ \ http://mysql.easynet.be/Downloads/MySQL-${version_branch}/ \ http://mysql.he.net/Downloads/MySQL-${version_branch}/ \ http://mysql.infocom.ua/Downloads/MySQL-${version_branch}/ \ http://mysql.inspire.net.nz/Downloads/MySQL-${version_branch}/ \ http://mysql.linux.cz/Downloads/MySQL-${version_branch}/ \ http://mysql.llarian.net/Downloads/MySQL-${version_branch}/ \ http://mysql.mirror.iweb.ca/Downloads/MySQL-${version_branch}/ \ http://mysql.mirror.rafal.ca/Downloads/MySQL-${version_branch}/ \ http://mysql.mirrors.arminco.com/Downloads/MySQL-${version_branch}/ \ http://mysql.mirrors.hoobly.com/Downloads/MySQL-${version_branch}/ \ http://mysql.mirrors.ilisys.com.au/Downloads/MySQL-${version_branch}/ \ http://mysql.mirrors.ovh.net/ftp.mysql.com/Downloads/MySQL-${version_branch}/ \ http://mysql.mirrors.pair.com/Downloads/MySQL-${version_branch}/ \ http://mysql.nfsi.pt/Downloads/MySQL-${version_branch}/ \ http://mysql.ntu.edu.tw/Downloads/MySQL-${version_branch}/ \ http://mysql.spd.co.il/Downloads/MySQL-${version_branch}/ \ http://na.mirror.garr.it/mirrors/MySQL/Downloads/MySQL-${version_branch}/ \ http://sunsite.informatik.rwth-aachen.de/mysql/Downloads/MySQL-${version_branch}/ \ http://www.linorg.usp.br/mysql/Downloads/MySQL-${version_branch}/ \ http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-${version_branch}/ # Mirrors with bad distfiles # http://mysql.azc.uam.mx/Downloads/MySQL-${version_branch}/ \ # http://mysql.isu.edu.tw/Downloads/MySQL-${version_branch}/ \ # http://mysql.mirror.ac.za/Downloads/MySQL-${version_branch}/ \ # http://mysql.mirror.kangaroot.net/Downloads/MySQL-${version_branch}/ \ # http://mysql.mirrors.crysys.hit.bme.hu/Downloads/MySQL-${version_branch}/ \ # http://mysql.mivzakim.net/Downloads/MySQL-${version_branch}/ \ # http://mysql.sh.cvut.cz/Downloads/MySQL-${version_branch}/ \ # http://opensource.become.com/mysql/Downloads/MySQL-${version_branch}/ \ checksums rmd160 4077b4aab7297a48b5dc180acf35c9a94bce366c \ sha256 5365a5598f4d06c72fbcf61a437bf55e2d815a851e6ef972250e9c71b87360d3 set major_version [strsed ${version} {s/\..*$//}] set mysql mysql${major_version} set libdir ${prefix}/lib/${mysql} set bindir ${libdir}/bin set dbdir ${prefix}/var/db/${mysql} set sysconfdir ${prefix}/etc/${mysql} if {"darwin" eq ${os.platform} && ${os.major} > 8} { set mysqluser _mysql } else { set mysqluser mysql } add_users ${mysqluser} group=${mysqluser} realname=MySQL\ Server if {${name} eq ${subport}} { PortGroup archcheck 1.0 # http://bugs.mysql.com/bug.php?id=47360 PortGroup muniversal 1.0 revision ${revision_client} conflicts mysql5-devel mysql4 depends_lib \ port:zlib \ port:openssl \ port:tcp_wrappers archcheck.files lib/libz.dylib \ lib/libssl.dylib \ lib/libwrap.dylib patch.pre_args -p1 patchfiles patch-Makefile.in.diff \ patch-scripts-mysql_secure_installation.sh.diff post-patch { reinplace s%@BINDIR@%${bindir}%g ${worksrcpath}/scripts/mysql_secure_installation.sh } configure.args \ --mandir=${prefix}/share/man \ --infodir=${prefix}/share/info \ --localstatedir=${dbdir} \ --libdir=${libdir} \ --bindir=${bindir} \ --includedir=${prefix}/include/${mysql} \ --datadir=${prefix}/share/${mysql} \ --sysconfdir=${sysconfdir} \ --with-zlib-dir=${prefix} \ --with-ssl=${prefix} \ --with-extra-charsets=complex \ --with-unix-socket-path=${prefix}/var/run/${mysql}/mysqld.sock \ --with-mysqld-user=${mysqluser} \ --without-docs \ --with-plugins=all \ --enable-thread-safe-client # the following is in store for future # --program-suffix=5 # Add readline support. # "--without-readline" has the peculiar meaning "do not use the bundled copy # of readline but use the system's (i.e. MacPorts') copy of readline" depends_lib-append port:readline archcheck.files-append lib/libreadline.dylib configure.args-append --without-readline # Build libmysqld embedded server. configure.cflags-append -fPIC configure.cxxflags-append -fPIC configure.args-append --with-embedded-server --with-pic # doesn't build with clang as of 2011.06.27 # This is a bug in mysql's build system, fixed in 5.5 compiler.blacklist-append *clang* post-build { if {[variant_isset universal]} { set dirs {} foreach arch ${universal_archs_to_use} { lappend dirs ${worksrcpath}-${arch} } } else { set dirs ${worksrcpath} } foreach dir ${dirs} { reinplace -E {s|-arch [a-z0-9_]+||g} \ ${dir}/scripts/mysql_config \ ${dir}/scripts/mysqlbug } } pre-destroot { xinstall -m 755 -d ${destroot}${sysconfdir} destroot.keepdirs-append ${destroot}${sysconfdir} } post-destroot { # Fix paths in manpages and sample configuration files foreach manpage [glob -type f ${destroot}${prefix}/share/man/man\[1-9\]/*] { reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${manpage} } foreach samp_conffile [glob -type f ${destroot}${prefix}/share/${mysql}/mysql/my-*.cnf] { reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${samp_conffile} } # Symlink mysql binaries into bin directory, with ${major_version} appended to the name foreach f [glob -tails -directory ${destroot}${bindir} my*] { ln -sf ${bindir}/${f} ${destroot}${prefix}/bin/${f}${major_version} } } post-install { if {![file exists ${prefix}/etc/LaunchDaemons/org.macports.${mysql}/org.macports.${mysql}.plist]} { ui_msg "The MySQL client has been installed." ui_msg "If you also want a MySQL server, install the mysql5-server port." } } } subport mysql5-server { revision ${revision_server} conflicts mysql5-server-devel supported_archs noarch depends_run \ port:mysql5 distfiles use_configure no build {} destroot { xinstall -m 755 -o root -d ${destroot}${prefix}/var/run xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \ ${destroot}${dbdir} \ ${destroot}${prefix}/var/log/${mysql} \ ${destroot}${prefix}/var/run/${mysql} destroot.keepdirs-append \ ${destroot}${dbdir} \ ${destroot}${prefix}/var/log/${mysql} \ ${destroot}${prefix}/var/run/${mysql} } startupitem.create yes startupitem.name ${mysql} startupitem.start "${prefix}/share/${mysql}/mysql/mysql.server start" startupitem.stop "${prefix}/share/${mysql}/mysql/mysql.server stop" notes "If this is a new install, in order to setup the database you might want to run:" \ "sudo -u ${mysqluser} mysql_install_db5" } livecheck.type regex livecheck.url http://dev.mysql.com/downloads/mysql/${version_branch}.html livecheck.regex "