# $Id: Portfile 59852 2009-10-24 23:06:39Z ryandesign@macports.org $ PortSystem 1.0 name mysql5 conflicts mysql5-devel mysql4 version 5.1.40 set branch [join [lrange [split ${version} .] 0 1] .] homepage http://www.mysql.com/ categories databases platforms darwin maintainers ryandesign license GPLv2 distname mysql-${version} use_parallel_build yes # http://bugs.mysql.com/bug.php?id=47360 universal_variant no 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://mysql.mirrors.pair.com/Downloads/MySQL-${branch}/ \ http://mysql.he.net/Downloads/MySQL-${branch}/ \ http://mirrors.sunsite.dk/mysql/Downloads/MySQL-${branch}/ \ http://sunsite.informatik.rwth-aachen.de/mysql/Downloads/MySQL-${branch}/ \ http://ftp.plusline.de/mysql/Downloads/MySQL-${branch}/ \ http://www.innodb.com/download/innodb_plugin/:plugin checksums \ [suffix ${distname}] \ md5 32e7373c16271606007374396e6742ad \ sha1 00b600763b4659d9e0256ea6dcce378175aa8d9e \ rmd160 330722fc012777c53933d6803d51a3f1b92d9892 depends_lib \ port:zlib \ port:openssl 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} set mysqluser mysql patchfiles \ patch-Makefile.in.diff \ patch-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 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 post-configure { reinplace "s;openssl_includes = -I;openssl_includes_includes = -I${prefix}/include/openssl;" ${worksrcpath}/tests/Makefile } set plugin_version 1.0.4 set plugin_distname innodb_plugin-${plugin_version} set plugin_distfile [suffix ${plugin_distname}] set plugin_worksrcdir ${plugin_distname} set plugin_worksrcpath ${workpath}/${plugin_worksrcdir} set innobase_dir storage/innobase variant innodb_plugin description "Install the InnoDB plugin Early Adopter release ${plugin_version}" { distfiles-append ${plugin_distfile}:plugin checksums-append \ ${plugin_distfile} \ md5 4350ba7c1520edce35635f982449efb3 \ sha1 c39e2a9cfa18b9f103c930d0c4a8edced81ed4ee \ rmd160 bd0467a10781677a7a7bb2e58ad38e0a43841d7f post-extract { delete ${worksrcpath}/${innobase_dir} move ${plugin_worksrcpath} ${worksrcpath}/${innobase_dir} } } 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." } } livecheck.type regex livecheck.url http://dev.mysql.com/ livecheck.regex "(5\\.1\\.\[0-9\.\]+)"