# $Id: Portfile 30318 2007-10-24 16:05:05Z jwa@macports.org $ PortSystem 1.0 name mysql5-devel set vers 5.1.22 version ${vers}-rc categories databases platforms darwin maintainers jwa openmaintainer 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/ master_sites http://dev.mysql.com/get/Downloads/MySQL-5.1/ \ http://mysql.mirrors.pair.com/Downloads/MySQL-5.1/ \ http://mysql.he.net/Downloads/MySQL-5.1/ \ http://mysql.orst.edu/Downloads/MySQL-5.1 \ http://mysql.oss.eznetsols.org/Downloads/MySQL-5.1/ \ http://mirrors.sunsite.dk/mysql/Downloads/MySQL-5.1/ \ http://sunsite.informatik.rwth-aachen.de/mysql/Downloads/MySQL-5.1/ \ http://ftp.plusline.de/mysql/Downloads/MySQL-5.1/ distname mysql-${version} checksums md5 87be813d1b2d76b1c756de0a16fa29fb \ sha1 97c1396e0f0561485df120cce2092192aecd12a0 \ rmd160 f4bd9dc6a161b4479ac09d26727ea5713c57d1b3 depends_lib port:zlib \ port:openssl #set major_version [strsed ${version} {s/\..*$//}] set major_version [strsed ${vers} {s/\..*$//}] set mysql mysql${major_version} #set dbdir ${prefix}/var/db/${mysql} set sysconfdir ${prefix}/etc/${name} set dbdir ${prefix}/var/db/${name} set mysqluser mysql configure.args --mandir=${prefix}/share/man \ --infodir=${prefix}/share/info \ --localstatedir=${dbdir} \ --libdir=${prefix}/lib/${name} \ --bindir=${prefix}/lib/${name}/bin \ --includedir=${prefix}/include/${name} \ --datadir=${prefix}/share/${name} \ --sysconfdir=${sysconfdir} \ --with-zlib-dir=${prefix} \ --with-ssl=${prefix} \ --with-extra-charsets=complex \ --with-unix-socket-path=${prefix}/var/run/${name}/mysqld.sock \ --with-mysqld-user=${mysqluser} \ --without-docs \ --without-bench \ --with-plugins=all \ --without-server \ --enable-thread-safe-client # the following is in store for future # --program-suffix=5 post-configure { reinplace "s;openssl_includes = -I;openssl_includes_includes = -I${prefix}/include/openssl;" ${worksrcpath}/tests/Makefile } platform darwin 6 { pre-fetch { return -code error "no support for systems prior to 10.3" } } platform darwin 8 { configure.compiler gcc-4.0 configure.cppflags-append -I${worksrcpath}/include } variant server { configure.args-delete --without-server # Create a startupitem to start/stop the server startupitem.create yes startupitem.start "${prefix}/share/${name}/mysql/mysql.server start" startupitem.stop "${prefix}/share/${name}/mysql/mysql.server stop" } # the directories ${prefix}/sql-bench ${prefix}/mysql-test destroot.violate_mtree yes pre-destroot { # Some directories we must have in all cases xinstall -m 755 -d ${destroot}${prefix}/etc/${name} destroot.keepdirs-append ${destroot}${prefix}/etc/${name} # Setup only for server if { [variant_isset server] } { addgroup ${mysqluser} set gid [existsgroup ${mysqluser}] adduser ${mysqluser} gid=${gid} realname=MySQL\ Server # Some directories we must have only if we're running as a server xinstall -m 755 -o root -d ${destroot}${prefix}/var/run xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \ ${destroot}${dbdir} \ ${destroot}${prefix}/var/run/${name} destroot.keepdirs-append \ ${destroot}${dbdir} \ ${destroot}${prefix}/var/run/${name} } } post-destroot { delete ${destroot}${prefix}/mysql-test # 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/${name}/mysql/my-*.cnf] { reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${samp_conffile} } # Symlink mysql binaries into bin directory foreach f [glob -tails -directory ${destroot}${prefix}/lib/${name}/bin my*] { ln -sf ${prefix}/lib/${name}/bin/${f} ${destroot}${prefix}/bin/${f}${major_version} } } post-install { if { [variant_isset server] } { ui_msg "******************************************************" ui_msg "* In order to setup the database, you might want to run" ui_msg "* sudo -u ${mysqluser} mysql_install_db5" ui_msg "* if this is a new install" ui_msg "******************************************************" } } livecheck.check regex livecheck.url http://dev.mysql.com/ livecheck.version ${vers} livecheck.regex "(5\\.1\\.\[0-9\.\]+)"