Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

mysql5 port with +fast_mutexes variant

  • Loading branch information...
commit 89a971d74656aef57a0c529af9fd73c997804f9d 0 parents
@chetan authored
2  PortIndex
@@ -0,0 +1,2 @@
+mysql5 424
+variants {universal fast_mutex} portdir databases/mysql5 description {Multithreaded SQL database server} homepage http://www.mysql.com/ epoch 0 platforms darwin depends_lib {port:zlib port:openssl port:readline} name mysql5 license GPL-2 maintainers ryandesign long_description {MySQL is an open-source, multi-threaded SQL database with a command syntax very similar to mSQL.} categories databases version 5.1.57 revision 0
1  PortIndex.quick
@@ -0,0 +1 @@
+mysql5 0
151 databases/mysql5/Portfile
@@ -0,0 +1,151 @@
+# -*- 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: Portfile 78486 2011-05-09 11:57:25Z 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.57
+set branch [join [lrange [split ${version} .] 0 1] .]
+homepage http://www.mysql.com/
+categories databases
+platforms darwin
+maintainers ryandesign
+license GPL-2
+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://mirror.facebook.net/mysql/Downloads/MySQL-${branch}/ \
+ http://ftp.plusline.de/mysql/Downloads/MySQL-${branch}/
+
+checksums sha1 fcfe037ee6cfd53fe336ef12854e79481bdc6681 \
+ rmd160 9ca7f79d14525fef2c1badf8410fecd238ee283e
+
+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 "<a href=\"http://dev.mysql.com/downloads/mysql/\[^\"\]+\">(${branch}(\.\[0-9.\]+)?)\[^<\]*</a>"
+
+variant fast_mutex description {Enable fast mutexes} {
+ configure.args-append \
+ --with-fast-mutexes
+}
11 databases/mysql5/files/patch-Makefile.in.diff
@@ -0,0 +1,11 @@
+--- Makefile.in.orig 2010-08-03 12:29:19.000000000 -0500
++++ Makefile.in 2010-09-05 02:53:04.000000000 -0500
+@@ -417,7 +417,7 @@
+ @sql_union_dirs@ unittest \
+ @sql_server@ @man_dirs@ tests \
+ netware @libmysqld_dirs@ \
+- mysql-test support-files sql-bench @tools_dirs@ \
++ support-files @tools_dirs@ \
+ win
+
+ DIST_SUBDIRS = . include Docs zlib \
11 databases/mysql5/files/patch-mysql_secure_installation.sh.diff
@@ -0,0 +1,11 @@
+--- scripts/mysql_secure_installation.sh.orig 2010-08-03 12:24:30.000000000 -0500
++++ scripts/mysql_secure_installation.sh 2010-09-05 02:55:31.000000000 -0500
+@@ -40,7 +40,7 @@
+
+ find_mysql_client()
+ {
+- for n in ./bin/mysql mysql
++ for n in @BINDIR@/mysql ./bin/mysql mysql
+ do
+ $n --no-defaults --help > /dev/null 2>&1
+ status=$?
Please sign in to comment.
Something went wrong with that request. Please try again.