Index: Portfile
===================================================================
--- Portfile	(revision 69918)
+++ Portfile	(working copy)
@@ -2,14 +2,14 @@
 
 PortSystem              1.0
 PortGroup               archcheck 1.0
+PortGroup               cmake 1.0
 
 # http://bugs.mysql.com/bug.php?id=47360
-PortGroup               muniversal 1.0
+#PortGroup               muniversal 1.0
 
 name                    mysql5-devel
 conflicts               mysql5 mysql4
-version                 5.5.2-m2
-revision        1
+version                 5.5.5-m3
 set branch              [join [lrange [split ${version} .] 0 1] .]
 homepage                http://www.mysql.com/
 categories              databases
@@ -34,16 +34,18 @@
     http://sunsite.informatik.rwth-aachen.de/mysql/Downloads/MySQL-${branch}/ \
     http://ftp.plusline.de/mysql/Downloads/MySQL-${branch}/
 
-checksums               md5     cd3254f29561953ffb7c023cb1b825d2 \
-                        sha1    801b6c9d3cdad2e5e273d3b4c8fe7e68cd1bab3c \
-                        rmd160  0549f599de5ba9efc26ab45dfcddca135a70d631
+checksums               md5     ad27f6561d6010c9346ffeca6de403fa \
+                        sha1    c5ea4bb46521d83000af1f3f189e1dd22cdb8009 \
+                        rmd160  fbaac4f5e0cb26f81f1f10c2095241e5320279e7
 
 depends_lib \
     port:zlib \
-    port:openssl
+    port:openssl \
+    port:readline
 
 archcheck.files         lib/libz.dylib \
-                        lib/libssl.dylib
+                        lib/libssl.dylib \
+                        lib/libreadline.dylib
 
 set major_version       [strsed ${version} {s/\..*$//}]
 set mysql               mysql${major_version}
@@ -66,53 +68,48 @@
     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
+#configure.args \
+#    --localstatedir=${dbdir} \
+#    --with-unix-socket-path=${prefix}/var/run/${mysql}/mysqld.sock \
+#    --with-mysqld-user=${mysqluser} \
+#    --with-plugins=all \
+#    --enable-thread-safe-client
 
-# 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
+configure.args-append       -DINSTALL_MANDIR:STRING=share/man \
+                            -DINSTALL_INFODIR:STRING=share/info \
+                            \
+                            -DINSTALL_BINDIR:STRING=lib/${mysql}/bin \
+                            -DINSTALL_SCRIPTDIR:STRING=lib/${mysql}/bin \
+                            -DINSTALL_SBINDIR:STRING=lib/${mysql}/libexec \
+                            -DINSTALL_INCLUDEDIR:STRING=include/${mysql}/mysql \
+                            -DINSTALL_LIBDIR:STRING=lib/${mysql}/mysql \
+                            -DINSTALL_PLUGINDIR:STRING=lib/${mysql}/mysql/plugin \
+                            -DINSTALL_DOCDIR:STRING=share/doc/${mysql} \
+                            -DINSTALL_DOCREADMEDIR:STRING=share/doc/${mysql} \
+                            -DINSTALL_MYSQLDATADIR:STRING=share/${mysql} \
+                            -DINSTALL_MYSQLSHAREDIR:STRING=share/${mysql}/mysql \
+                            -DINSTALL_SHAREDIR:STRING=share/${mysql} \
+                            -DINSTALL_SUPPORTFILESDIR:STRING=share/${mysql}/mysql \
+                            \
+                            -DSYSCONFDIR:PATH=${sysconfdir} \
+                            -DWITH_EMBEDDED_SERVER:BOOL=ON \
+                            -DWITH_READLINE:STRING=system \
+                            -DWITH_SSL:STRING=system \
+                            -DWITH_ZLIB:STRING=system
 
-# Build libmysqld embedded server.
-configure.cflags-append -fPIC
-configure.cxxflags-append -fPIC
-configure.args-append --with-embedded-server --with-pic
+# verbose configure output -- remove me
+configure.args-append       -LAH
 
 post-build {
-    if {[variant_isset universal]} {
-        set dirs {}
-        foreach arch ${universal_archs_to_use} {
-            lappend dirs ${worksrcpath}-${arch}
-        }
-    } else {
+#    if {[variant_isset universal]} {
+#        set dirs {}
+#        foreach arch ${universal_archs_to_use} {
+#            lappend dirs ${worksrcpath}-${arch}
+#        }
+#    } else {
         set dirs ${worksrcpath}
-    }
+#    }
     foreach dir ${dirs} {
-        reinplace "s|${dir}/libservices|${libdir}/mysql|g" \
-            ${dir}/plugin/daemon_example/.libs/libdaemon_example.lai \
-            ${dir}/plugin/semisync/.libs/semisync_master.lai \
-            ${dir}/plugin/semisync/.libs/semisync_slave.lai \
-            ${dir}/storage/example/.libs/ha_example.lai
         reinplace -E {s|-arch [a-z0-9_]+||g} \
             ${dir}/scripts/mysql_config \
             ${dir}/scripts/mysqlbug
@@ -125,6 +122,9 @@
 }
 
 post-destroot {
+    # Delete directories we don't want
+    delete ${destroot}${prefix}/data ${destroot}${prefix}/mysql-test ${destroot}${prefix}/sql-bench
+    
     # 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}
Index: files/patch-Makefile.in.diff
===================================================================
--- files/patch-Makefile.in.diff	(revision 69918)
+++ files/patch-Makefile.in.diff	(working copy)
@@ -1,11 +1,11 @@
---- Makefile.in.orig	2009-12-28 06:10:40.000000000 -0600
-+++ Makefile.in	2010-02-05 20:06:18.000000000 -0600
-@@ -415,7 +415,7 @@
+--- Makefile.in.orig	2010-07-06 13:37:17.000000000 -0500
++++ Makefile.in	2010-07-18 19:20:36.000000000 -0500
+@@ -396,7 +396,7 @@
  			@sql_union_dirs@ unittest \
  			@sql_server@ @man_dirs@ tests \
  			netware @libmysqld_dirs@ \
 -			mysql-test support-files sql-bench \
 +			support-files \
- 			win
+ 			win \
+ 			cmake
  
- DIST_SUBDIRS = . include Docs zlib \
