# $Id: Portfile 63790 2010-02-15 02:10:04Z ryandesign@macports.org $ PortSystem 1.0 PortGroup archcheck 1.0 # http://bugs.mysql.com/bug.php?id=47360 PortGroup muniversal 1.0 name mysql5 conflicts mysql5-devel mysql4 version 5.1.43 revision 1 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 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}/ checksums \ md5 451fd3e8c55eecdf4c3ed109dce62f01 \ sha1 fff98e59f17487d646998662409bc894a422b7e9 \ rmd160 51aa017edc165f13f2cb696ee210505b8f2a21ee depends_lib \ port:zlib \ port:openssl archcheck.files lib/libz.dylib \ lib/libssl.dylib 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" == ${os.platform} && ${os.major} > 8} { set mysqluser _mysql } else { 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 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 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." } } livecheck.type regex livecheck.version [lindex [split ${version} -] 0] livecheck.url http://dev.mysql.com/ livecheck.regex "(${branch}(\.\[0-9.\]+)?)\[^<\]*"