# -*- 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 mysql51 set name_mysql ${name} version 5.1.71 # Set revision_client and revision_server to 0 if you bump version. set revision_client 1 set revision_server 0 set version_branch [join [lrange [split ${version} .] 0 1] .] categories databases platforms darwin license GPL-2 maintainers pixilla openmaintainer homepage http://www.mysql.com/ if {"darwin" eq ${os.platform} && ${os.major} > 8} { set mysqluser _mysql } else { set mysqluser mysql } if {${subport} eq ${name}} { # http://bugs.mysql.com/bug.php?id=47360 PortGroup muniversal 1.0 PortGroup archcheck 1.0 PortGroup select 1.0 revision ${revision_client} license GPL-2 description Multithreaded SQL database server long_description MySQL is an open-source, multi-threaded SQL database. 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}/ \ distname mysql-${version} use_parallel_build yes patch.pre_args -p1 patchfiles patch-Makefile.in.diff \ patch-scripts-mysql_secure_installation.sh.diff checksums rmd160 4077b4aab7297a48b5dc180acf35c9a94bce366c \ sha256 5365a5598f4d06c72fbcf61a437bf55e2d815a851e6ef972250e9c71b87360d3 depends_lib port:zlib port:tcp_wrappers depends_run port:mysql_select select.group mysql select.file ${filespath}/${name_mysql} archcheck.files lib/libz.dylib lib/libwrap.dylib post-extract { file mkdir ${worksrcpath}/build_macports/macports copy ${filespath}/macports-default.cnf \ ${filespath}/my.cnf \ ${worksrcpath}/build_macports/macports/ } post-patch { reinplace "s%@BINDIR@%${prefix}/lib/${name_mysql}/bin%g" \ ${worksrcpath}/scripts/mysql_secure_installation.sh reinplace "s|@NAME@|${name_mysql}|g" \ ${worksrcpath}/build_macports/macports/macports-default.cnf \ ${worksrcpath}/build_macports/macports/my.cnf reinplace "s|@PREFIX@|${prefix}|g" \ ${worksrcpath}/build_macports/macports/macports-default.cnf \ ${worksrcpath}/build_macports/macports/my.cnf } configure.args \ --bindir=${prefix}/lib/${name_mysql}/bin \ --sbindir=${prefix}/lib/${name_mysql}/bin \ --libexecdir=${prefix}/lib/${name_mysql}/bin \ --sysconfdir=${prefix}/etc/${name_mysql} \ --localstatedir=${prefix}/var/db/${name_mysql} \ --libdir=${prefix}/lib/${name_mysql} \ --includedir=${prefix}/include/${name_mysql} \ --datarootdir=${prefix}/share/${name_mysql} \ --infodir=${prefix}/share/info/${name_mysql} \ --mandir=${prefix}/share/man/${name_mysql} \ --with-zlib-dir=${prefix} \ --without-ssl \ --with-extra-charsets=complex \ --with-unix-socket-path=${prefix}/var/run/${name_mysql}/mysqld.sock \ --with-mysqld-user=${mysqluser} \ --without-docs \ --with-plugins=all \ --enable-thread-safe-client # 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 } } post-destroot { # proc portdestroot::destroot_finish fails to find and compress our man pages # so borrow the compress command and run on our files now. set manpath "${destroot}${prefix}/share/man" set gzip [findBinary gzip ${portutil::autoconf::gzip_path}] foreach manpage [glob -type f ${destroot}${prefix}/share/man/${name_mysql}/man\[1-9\]/*] { # Fix paths in manpages reinplace "s|/etc/|${prefix}/etc/${name_mysql}/|g" ${manpage} # Compress all manpages with gzip system "$gzip -9vf ${manpage}" } foreach samp_conffile [glob -type f ${destroot}${prefix}/share/${name_mysql}/mysql/my-*.cnf] { # Fix paths in sample configuration files reinplace "s|/etc/my.cnf|${prefix}/etc/${name_mysql}/my.cnf|g" ${samp_conffile} } xinstall -m 755 -o root -d \ ${destroot}${prefix}/etc/${name_mysql} copy ${worksrcpath}/build_macports/macports/macports-default.cnf \ ${destroot}${prefix}/etc/${name_mysql}/ xinstall -m 755 -o root -d \ ${destroot}${prefix}/share/${name_mysql}/support-files/macports copy ${worksrcpath}/build_macports/macports/my.cnf \ ${destroot}${prefix}/share/${name_mysql}/support-files/macports/ } post-install { if {![file exists ${prefix}/etc/LaunchDaemons/org.macports.${name_mysql}/org.macports.${name_mysql}-server.plist]} { ui_msg "The ${name_mysql} client has been installed." ui_msg "To install the ${name_mysql} server, install the ${name_mysql}-server port." } } pre-activate { # The macports-default.cnf is installed by ${name_mysql}. # Early versions of ${name_mysql}-server installed macports-default.cnf so for a # reasonable period we need to deactivate older versions of the ${name_mysql}-server. if { [file exists ${prefix}/etc/${name_mysql}/macports-default.cnf] && ![catch {set vers [lindex [registry_active ${name_mysql}-server] 0]}] && [vercmp [lindex $vers 1] 5.1.63] < 1 && [vercmp [lindex $vers 2] 3] < 0 } { registry_deactivate_composite ${name_mysql}-server "" [list ports_nodepcheck 1] } } post-activate { if {![file exists ${prefix}/etc/${name_mysql}/my.cnf]} { copy ${prefix}/share/${name_mysql}/support-files/macports/my.cnf \ ${prefix}/etc/${name_mysql}/ } } variant openssl description {Enable OpenSSL support} {} variant system_readline description {Use system readline instead of bundled readline} {} if [variant_isset openssl] { depends_lib-append port:openssl configure.args-delete --without-ssl configure.args-append --with-ssl=${prefix} archcheck.files-append lib/libssl.dylib } if [variant_isset system_readline] { # "--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 configure.args-append --without-readline archcheck.files-append lib/libreadline.dylib } livecheck.type regex livecheck.url http://dev.mysql.com/downloads/mysql/${version_branch}.html livecheck.regex "

MySQL Community Server (${version_branch}(\.\[0-9.\]+)?)

" } subport ${name_mysql}-server { revision ${revision_server} license BSD description Run ${name_mysql} as server long_description ${description} supported_archs noarch distfiles depends_run port:${name_mysql} add_users ${mysqluser} group=${mysqluser} realname=MySQL\ Server startupitem.create yes startupitem.executable ${prefix}/lib/${name_mysql}/bin/mysqld --user=${mysqluser} use_configure no build {} destroot { xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \ ${destroot}${prefix}/etc/${name_mysql} \ ${destroot}${prefix}/var/db/${name_mysql} \ ${destroot}${prefix}/var/log/${name_mysql} \ ${destroot}${prefix}/var/run/${name_mysql} destroot.keepdirs-append \ ${destroot}${prefix}/var/db/${name_mysql} \ ${destroot}${prefix}/var/log/${name_mysql} \ ${destroot}${prefix}/var/run/${name_mysql} } notes " If this is a new install you might want to run: \$ sudo -u ${mysqluser} ${prefix}/lib/${name_mysql}/bin/mysql_install_db " livecheck.type none }