diff -ruN databases.orig/mariadb55-client/Makefile databases/mariadb55-client/Makefile
--- databases.orig/mariadb55-client/Makefile	2013-10-01 00:36:19.000000000 +0200
+++ databases/mariadb55-client/Makefile	2013-10-01 15:13:15.285388241 +0200
@@ -7,7 +7,7 @@
 
 MASTERDIR=	${.CURDIR}/../mariadb55-server
 
-PKGMESSAGE=	mustnotexist
+FILESDIR=	${.CURDIR}/files
 PATCHDIR=	${.CURDIR}/files
 PLIST=		${.CURDIR}/pkg-plist
 
diff -ruN databases.orig/mariadb55-client/files/patch-mysys_default.c databases/mariadb55-client/files/patch-mysys_default.c
--- databases.orig/mariadb55-client/files/patch-mysys_default.c	2013-01-05 12:30:51.000000000 +0100
+++ databases/mariadb55-client/files/patch-mysys_default.c	2013-10-01 23:48:22.726204234 +0200
@@ -1,5 +1,5 @@
---- mysys/default.c.orig	2012-12-17 03:57:40.000000000 +0200
-+++ mysys/default.c	2012-12-17 04:00:28.000000000 +0200
+--- mysys/default.c.orig	2013-10-01 21:15:03.544135869 +0200
++++ mysys/default.c	2013-10-01 21:15:38.871375504 +0200
 @@ -89,7 +89,7 @@
  
  /* Which directories are searched for options (and in which order) */
@@ -18,11 +18,31 @@
      /*
        Ignore world-writable regular files.
        This is mainly done to protect us to not read a file created by
-@@ -1229,6 +1229,7 @@
- #if defined(DEFAULT_SYSCONFDIR)
-   if (DEFAULT_SYSCONFDIR[0])
-     errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
-+    errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs);
- #endif /* DEFAULT_SYSCONFDIR */
+@@ -803,6 +803,14 @@
+   if (!(fp= mysql_file_fopen(key_file_cnf, name, O_RDONLY, MYF(0))))
+     return 1;					/* Ignore wrong files */
+ 
++  if (strstr(name, "/etc") == name)
++  {
++    fprintf(stderr,
++	      "error: Config file %s in invalid location, please move to or merge with %%PREFIX%%%s\n",
++	      name,name);
++      goto err;
++  }
++
+   while (mysql_file_fgets(buff, sizeof(buff) - 1, fp))
+   {
+     line++;
+@@ -1226,10 +1226,8 @@
+   errors += add_directory(alloc, "/etc/", dirs);
+   errors += add_directory(alloc, "/etc/mysql/", dirs);
+ 
+-#if defined(DEFAULT_SYSCONFDIR)
+-  if (DEFAULT_SYSCONFDIR[0])
+-    errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
+-#endif /* DEFAULT_SYSCONFDIR */
++  errors += add_directory(alloc, "%%PREFIX%%/etc/", dirs);
++  errors += add_directory(alloc, "%%PREFIX%%/etc/mysql/", dirs);
  
  #endif
+ 
diff -ruN databases.orig/mariadb55-client/files/pkg-message.in databases/mariadb55-client/files/pkg-message.in
--- databases.orig/mariadb55-client/files/pkg-message.in	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-client/files/pkg-message.in	2013-10-01 23:50:26.235947512 +0200
@@ -0,0 +1,7 @@
+************************************************************************
+
+MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for
+my.cnf. Please move existing my.cnf files from those paths to
+%%PREFIX%%/etc and %%PREFIX%%/etc/mysql.
+
+************************************************************************
diff -ruN databases.orig/mariadb55-client.orig/Makefile databases/mariadb55-client.orig/Makefile
--- databases.orig/mariadb55-client.orig/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-client.orig/Makefile	2013-10-01 00:36:19.000000000 +0200
@@ -0,0 +1,24 @@
+# $FreeBSD: databases/mariadb55-client/Makefile 328886 2013-09-30 22:36:19Z flo $
+
+PORTNAME=	mariadb
+PKGNAMESUFFIX=	-client
+
+COMMENT=	Multithreaded SQL database (client)
+
+MASTERDIR=	${.CURDIR}/../mariadb55-server
+
+PKGMESSAGE=	mustnotexist
+PATCHDIR=	${.CURDIR}/files
+PLIST=		${.CURDIR}/pkg-plist
+
+LATEST_LINK=	mariadb55-client
+
+CONFLICTS_INSTALL=	mysql-client-[345].* mariadb-client-5.3.* percona-client-5.*
+
+CMAKE_ARGS+=	-DWITHOUT_SERVER=1
+
+USE_LDCONFIG=	${PREFIX}/lib/mysql
+
+CLIENT_ONLY=	yes
+
+.include "${MASTERDIR}/Makefile"
diff -ruN databases.orig/mariadb55-client.orig/files/patch-CMakeLists.txt databases/mariadb55-client.orig/files/patch-CMakeLists.txt
--- databases.orig/mariadb55-client.orig/files/patch-CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-client.orig/files/patch-CMakeLists.txt	2013-10-01 00:32:28.000000000 +0200
@@ -0,0 +1,55 @@
+--- CMakeLists.txt.orig	2013-09-20 01:34:26.000000000 +0300
++++ CMakeLists.txt	2013-09-27 01:30:14.000000000 +0300
+@@ -306,28 +306,8 @@
+ ADD_SUBDIRECTORY(extra)
+ ADD_SUBDIRECTORY(libservices)
+ ADD_SUBDIRECTORY(scripts)
+-ADD_SUBDIRECTORY(sql/share)
+ ADD_SUBDIRECTORY(support-files)
+ 
+-IF(NOT WITHOUT_SERVER)
+-  ADD_SUBDIRECTORY(tests)
+-  ADD_SUBDIRECTORY(sql)
+-  OPTION (WITH_EMBEDDED_SERVER "Compile MySQL with embedded server" OFF)
+-  IF(WITH_EMBEDDED_SERVER) 
+-   ADD_SUBDIRECTORY(libmysqld)
+-   ADD_SUBDIRECTORY(libmysqld/examples)
+-  ENDIF(WITH_EMBEDDED_SERVER)
+-
+-  ADD_SUBDIRECTORY(mysql-test)
+-  ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
+-  ADD_SUBDIRECTORY(sql-bench)
+-
+-  IF(EXISTS ${CMAKE_SOURCE_DIR}/internal/CMakeLists.txt)
+-    ADD_SUBDIRECTORY(internal)
+-  ENDIF()
+-  ADD_SUBDIRECTORY(packaging/rpm-uln)
+-ENDIF()
+-
+ IF(UNIX)
+   ADD_SUBDIRECTORY(man)
+ ENDIF()
+@@ -339,7 +319,6 @@
+   ADD_SUBDIRECTORY(win/upgrade_wizard)
+   ADD_SUBDIRECTORY(win/packaging)
+ ENDIF()
+-ADD_SUBDIRECTORY(packaging/solaris)
+ 
+ CONFIGURE_FILE(config.h.cmake   ${CMAKE_BINARY_DIR}/include/my_config.h)
+ CONFIGURE_FILE(config.h.cmake   ${CMAKE_BINARY_DIR}/include/config.h)
+@@ -366,6 +345,7 @@
+   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ )
+ 
++IF(FALSE)
+ INSTALL_DOCUMENTATION(README COPYING COPYING.LESSER
+                       COMPONENT Readme)
+ INSTALL_DOCUMENTATION(${CMAKE_BINARY_DIR}/Docs/INFO_SRC
+@@ -373,6 +353,7 @@
+ IF(UNIX)
+   INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY COMPONENT Readme)
+ ENDIF()
++ENDIF()
+ 
+ INCLUDE(CPack)
+ 
diff -ruN databases.orig/mariadb55-client.orig/files/patch-client_CMakeLists.txt databases/mariadb55-client.orig/files/patch-client_CMakeLists.txt
--- databases.orig/mariadb55-client.orig/files/patch-client_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-client.orig/files/patch-client_CMakeLists.txt	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,50 @@
+--- client/CMakeLists.txt.orig	2012-11-28 17:49:47.000000000 +0200
++++ client/CMakeLists.txt	2013-01-05 01:49:16.000000000 +0200
+@@ -34,11 +34,12 @@
+   SET_TARGET_PROPERTIES(mysql PROPERTIES ENABLE_EXPORTS TRUE)
+ ENDIF(UNIX)
+ 
++IF(FALSE)
+ MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc COMPONENT Test)
+ SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS")
+ TARGET_LINK_LIBRARIES(mysqltest mysqlclient regex)
+ SET_TARGET_PROPERTIES(mysqltest PROPERTIES ENABLE_EXPORTS TRUE)
+-
++ENDIF()
+ 
+ MYSQL_ADD_EXECUTABLE(mysqlcheck mysqlcheck.c)
+ TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient)
+@@ -49,15 +50,19 @@
+ MYSQL_ADD_EXECUTABLE(mysqlimport mysqlimport.c)
+ TARGET_LINK_LIBRARIES(mysqlimport mysqlclient)
+ 
++IF(FALSE)
+ MYSQL_ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c COMPONENT Server)
+ TARGET_LINK_LIBRARIES(mysql_upgrade mysqlclient)
+ ADD_DEPENDENCIES(mysql_upgrade GenFixPrivs)
++ENDIF()
+ 
+ MYSQL_ADD_EXECUTABLE(mysqlshow mysqlshow.c)
+ TARGET_LINK_LIBRARIES(mysqlshow mysqlclient)
+ 
++IF(FALSE)
+ MYSQL_ADD_EXECUTABLE(mysql_plugin mysql_plugin.c)
+ TARGET_LINK_LIBRARIES(mysql_plugin mysqlclient)
++ENDIF()
+ 
+ MYSQL_ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc)
+ TARGET_LINK_LIBRARIES(mysqlbinlog mysqlclient)
+@@ -75,10 +80,12 @@
+ ENDIF(WIN32)
+ 
+ # async_example is just a code example, do not install it.
++IF(FALSE)
+ ADD_EXECUTABLE(async_example async_example.c)
+ TARGET_LINK_LIBRARIES(async_example mysqlclient)
++ENDIF()
+ 
+-SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysqlslap mysql_plugin 
++SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysqlshow mysqlslap 
+ PROPERTIES HAS_CXX TRUE)
+ 
+ ADD_DEFINITIONS(-DHAVE_DLOPEN)
diff -ruN databases.orig/mariadb55-client.orig/files/patch-cmake__jemalloc.cmake databases/mariadb55-client.orig/files/patch-cmake__jemalloc.cmake
--- databases.orig/mariadb55-client.orig/files/patch-cmake__jemalloc.cmake	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-client.orig/files/patch-cmake__jemalloc.cmake	2013-10-01 00:32:28.000000000 +0200
@@ -0,0 +1,14 @@
+--- cmake/jemalloc.cmake.orig	2013-09-20 00:34:22.000000000 +0200
++++ cmake/jemalloc.cmake	2013-09-27 22:46:05.791110010 +0200
+@@ -37,9 +37,9 @@
+     SET(WITH_JEMALLOC "no")
+   ENDIF()
+   IF(WITH_JEMALLOC STREQUAL "system" OR WITH_JEMALLOC STREQUAL "yes")
+-    CHECK_LIBRARY_EXISTS(jemalloc malloc_stats_print "" HAVE_JEMALLOC)
++    CHECK_LIBRARY_EXISTS(c malloc_stats_print "" HAVE_JEMALLOC)
+     IF (HAVE_JEMALLOC)
+-      SET(LIBJEMALLOC jemalloc)
++      SET(LIBJEMALLOC c)
+     ELSEIF (WITH_JEMALLOC STREQUAL "system")
+       MESSAGE(FATAL_ERROR "system jemalloc is not found")
+     ELSEIF (WITH_JEMALLOC STREQUAL "yes")
diff -ruN databases.orig/mariadb55-client.orig/files/patch-cmake_os_FreeBSD.cmake databases/mariadb55-client.orig/files/patch-cmake_os_FreeBSD.cmake
--- databases.orig/mariadb55-client.orig/files/patch-cmake_os_FreeBSD.cmake	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-client.orig/files/patch-cmake_os_FreeBSD.cmake	2013-10-01 00:32:28.000000000 +0200
@@ -0,0 +1,16 @@
+--- cmake/os/FreeBSD.cmake.orig	2013-09-27 00:09:44.000000000 +0300
++++ cmake/os/FreeBSD.cmake	2013-09-27 00:09:57.000000000 +0300
+@@ -24,9 +24,10 @@
+ # ADD_DEFINITIONS(-DHAVE_BROKEN_REALPATH)
+ 
+ # Find libexecinfo (library that contains backtrace_symbols etc)
+-INCLUDE_DIRECTORIES(/usr/local/include)
+-SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} /usr/local/include )
+-SET(ENV{LIB} "$ENV{LIB}:/usr/local/lib")
++SET(EXECINFO_ROOT /usr/local CACHE INTERNAL "Where to find execinfo library and header")
++INCLUDE_DIRECTORIES(${EXECINFO_ROOT}/include)
++SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${EXECINFO_ROOT}/include)
++SET(ENV{LIB} "$ENV{LIB}:${EXECINFO_ROOT}/lib")
+ FIND_LIBRARY(EXECINFO NAMES execinfo)
+ IF(EXECINFO)
+  SET(LIBEXECINFO ${EXECINFO})
diff -ruN databases.orig/mariadb55-client.orig/files/patch-extra_CMakeLists.txt databases/mariadb55-client.orig/files/patch-extra_CMakeLists.txt
--- databases.orig/mariadb55-client.orig/files/patch-extra_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-client.orig/files/patch-extra_CMakeLists.txt	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,25 @@
+--- extra/CMakeLists.txt.orig	2012-12-17 03:38:29.000000000 +0200
++++ extra/CMakeLists.txt	2012-12-17 03:40:12.000000000 +0200
+@@ -54,6 +54,7 @@
+                   DEPENDS 
+                   ${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp)
+ 
++IF(FALSE)
+ MYSQL_ADD_EXECUTABLE(my_print_defaults my_print_defaults.c)
+ TARGET_LINK_LIBRARIES(my_print_defaults  mysys)
+ 
+@@ -74,11 +75,14 @@
+ 
+ MYSQL_ADD_EXECUTABLE(replace replace.c COMPONENT Server)
+ TARGET_LINK_LIBRARIES(replace mysys)
++ENDIF()
+ IF(UNIX)
++IF(FALSE)
+   MYSQL_ADD_EXECUTABLE(innochecksum innochecksum.c)
+ 
+   MYSQL_ADD_EXECUTABLE(resolve_stack_dump resolve_stack_dump.c)
+   TARGET_LINK_LIBRARIES(resolve_stack_dump mysys)
++ENDIF()
+ 
+   MYSQL_ADD_EXECUTABLE(mysql_waitpid mysql_waitpid.c COMPONENT Client)
+   TARGET_LINK_LIBRARIES(mysql_waitpid mysys)
diff -ruN databases.orig/mariadb55-client.orig/files/patch-extra_yassl_taocrypt_src_integer.cpp databases/mariadb55-client.orig/files/patch-extra_yassl_taocrypt_src_integer.cpp
--- databases.orig/mariadb55-client.orig/files/patch-extra_yassl_taocrypt_src_integer.cpp	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-client.orig/files/patch-extra_yassl_taocrypt_src_integer.cpp	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,11 @@
+--- extra/yassl/taocrypt/src/integer.cpp.orig	2012-12-17 03:41:47.000000000 +0200
++++ extra/yassl/taocrypt/src/integer.cpp	2012-12-17 03:42:47.000000000 +0200
+@@ -73,7 +73,7 @@
+ CPP_TYPENAME AlignedAllocator<T>::pointer AlignedAllocator<T>::allocate(
+                                            size_type n, const void *)
+ {
+-    if (n > max_size())
++    if (n > AlignedAllocator<T>::max_size())
+         return 0;
+     if (n == 0)
+         return 0;
diff -ruN databases.orig/mariadb55-client.orig/files/patch-include_CMakeLists.txt databases/mariadb55-client.orig/files/patch-include_CMakeLists.txt
--- databases.orig/mariadb55-client.orig/files/patch-include_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-client.orig/files/patch-include_CMakeLists.txt	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,22 @@
+--- include/CMakeLists.txt.orig	2012-11-28 17:49:47.000000000 +0200
++++ include/CMakeLists.txt	2012-12-23 00:48:29.000000000 +0200
+@@ -58,13 +58,18 @@
+ FOREACH(f ${HEADERS_GEN_CONFIGURE})
+   INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
+ ENDFOREACH(f)
+-INSTALL(DIRECTORY mysql/ DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development FILES_MATCHING PATTERN "*.h")
++INSTALL(DIRECTORY mysql/ DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development
++  FILES_MATCHING PATTERN "*.h"
++  PATTERN "psi_abi*" EXCLUDE
++)
+ 
+ STRING(REPLACE "." "\\." EXCL_RE "${HEADERS};${HEADERS_GEN_CONFIGURE}")
+ STRING(REPLACE ";" "|" EXCL_RE "${EXCL_RE}")
+ 
++IF(FALSE)
+ INSTALL(DIRECTORY . DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Development
+   FILES_MATCHING PATTERN "*.h"
+   PATTERN CMakeFiles EXCLUDE
+   PATTERN mysql EXCLUDE
+   REGEX "\\./(${EXCL_RE}$)" EXCLUDE)
++ENDIF()
diff -ruN databases.orig/mariadb55-client.orig/files/patch-include_my_compare.h databases/mariadb55-client.orig/files/patch-include_my_compare.h
--- databases.orig/mariadb55-client.orig/files/patch-include_my_compare.h	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-client.orig/files/patch-include_my_compare.h	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,11 @@
+--- include/my_compare.h.orig	2012-12-17 03:52:37.000000000 +0200
++++ include/my_compare.h	2012-12-17 03:53:40.000000000 +0200
+@@ -40,7 +40,7 @@
+   But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and HA_MAX_KEY_LENGTH.
+ */
+ 
+-#define HA_MAX_KEY_LENGTH           1000        /* Max length in bytes */
++#define HA_MAX_KEY_LENGTH           4000        /* Max length in bytes */
+ #define HA_MAX_KEY_SEG              32          /* Max segments for key */
+ 
+ #define HA_MAX_POSSIBLE_KEY_BUFF    (HA_MAX_KEY_LENGTH + 24+ 6+6)
diff -ruN databases.orig/mariadb55-client.orig/files/patch-libservices_CMakeLists.txt databases/mariadb55-client.orig/files/patch-libservices_CMakeLists.txt
--- databases.orig/mariadb55-client.orig/files/patch-libservices_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-client.orig/files/patch-libservices_CMakeLists.txt	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,9 @@
+--- libservices/CMakeLists.txt.orig	2012-11-28 17:49:47.000000000 +0200
++++ libservices/CMakeLists.txt	2012-12-23 17:32:35.000000000 +0200
+@@ -24,4 +24,6 @@
+   debug_sync_service.c)
+ 
+ ADD_CONVENIENCE_LIBRARY(mysqlservices ${MYSQLSERVICES_SOURCES})
++IF(FALSE)
+ INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR} COMPONENT Development)
++ENDIF()
diff -ruN databases.orig/mariadb55-client.orig/files/patch-man_CMakeLists.txt databases/mariadb55-client.orig/files/patch-man_CMakeLists.txt
--- databases.orig/mariadb55-client.orig/files/patch-man_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-client.orig/files/patch-man_CMakeLists.txt	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,16 @@
+--- man/CMakeLists.txt.orig	2012-12-22 21:30:12.000000000 +0200
++++ man/CMakeLists.txt	2012-12-22 21:30:54.000000000 +0200
+@@ -30,9 +30,13 @@
+ SET(MAN1_TEST mysql-stress-test.pl.1 mysql-test-run.pl.1 mysql_client_test.1
+               mysqltest_embedded.1 mysql_client_test_embedded.1)
+ 
++IF(FALSE)
+ INSTALL(FILES ${MAN1_SERVER} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT ManPagesServer)
+ INSTALL(FILES ${MAN8_SERVER} DESTINATION ${INSTALL_MANDIR}/man8 COMPONENT ManPagesServer)
++ENDIF()
+ INSTALL(FILES ${MAN1_CLIENT} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT ManPagesClient)
+ INSTALL(FILES ${MAN1_DEVEL} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT ManPagesDevelopment)
++IF(FALSE)
+ INSTALL(FILES ${MAN1_TEST} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT ManPagesTest)
++ENDIF()
+ 
diff -ruN databases.orig/mariadb55-client.orig/files/patch-mysys_default.c databases/mariadb55-client.orig/files/patch-mysys_default.c
--- databases.orig/mariadb55-client.orig/files/patch-mysys_default.c	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-client.orig/files/patch-mysys_default.c	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,28 @@
+--- mysys/default.c.orig	2012-12-17 03:57:40.000000000 +0200
++++ mysys/default.c	2012-12-17 04:00:28.000000000 +0200
+@@ -89,7 +89,7 @@
+ 
+ /* Which directories are searched for options (and in which order) */
+ 
+-#define MAX_DEFAULT_DIRS 6
++#define MAX_DEFAULT_DIRS 7
+ #define DEFAULT_DIRS_SIZE (MAX_DEFAULT_DIRS + 1)  /* Terminate with NULL */
+ static const char **default_directories = NULL;
+ 
+@@ -785,7 +785,7 @@
+   {
+     MY_STAT stat_info;
+     if (!my_stat(name,&stat_info,MYF(0)))
+-      return 1;
++      return 0;
+     /*
+       Ignore world-writable regular files.
+       This is mainly done to protect us to not read a file created by
+@@ -1229,6 +1229,7 @@
+ #if defined(DEFAULT_SYSCONFDIR)
+   if (DEFAULT_SYSCONFDIR[0])
+     errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
++    errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs);
+ #endif /* DEFAULT_SYSCONFDIR */
+ 
+ #endif
diff -ruN databases.orig/mariadb55-client.orig/files/patch-regex_CMakeLists.txt databases/mariadb55-client.orig/files/patch-regex_CMakeLists.txt
--- databases.orig/mariadb55-client.orig/files/patch-regex_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-client.orig/files/patch-regex_CMakeLists.txt	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,9 @@
+--- regex/CMakeLists.txt.orig	2012-12-23 00:42:41.000000000 +0200
++++ regex/CMakeLists.txt	2012-12-23 00:42:54.000000000 +0200
+@@ -18,4 +18,6 @@
+ SET(REGEX_SOURCES regcomp.c regerror.c regexec.c regfree.c reginit.c)
+ ADD_CONVENIENCE_LIBRARY(regex ${REGEX_SOURCES})
+ 
++IF(FALSE)
+ INSTALL(FILES "my_regex.h" DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Development)
++ENDIF()
diff -ruN databases.orig/mariadb55-client.orig/files/patch-scripts_CMakeLists.txt databases/mariadb55-client.orig/files/patch-scripts_CMakeLists.txt
--- databases.orig/mariadb55-client.orig/files/patch-scripts_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-client.orig/files/patch-scripts_CMakeLists.txt	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,78 @@
+--- scripts/CMakeLists.txt.orig	2012-11-28 17:49:47.000000000 +0200
++++ scripts/CMakeLists.txt	2012-12-22 23:26:51.000000000 +0200
+@@ -71,6 +71,7 @@
+ )
+ ENDIF()
+ 
++IF(FALSE)
+ INSTALL(FILES 
+   ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables.sql 
+   ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_data.sql
+@@ -79,6 +80,7 @@
+   ${FIX_PRIVILEGES_SQL}
+   DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server
+ )
++ENDIF()
+ 
+ # TCMalloc hacks
+ IF(MALLOC_LIB)
+@@ -138,6 +140,7 @@
+ SET(HOSTNAME "hostname")
+ SET(MYSQLD_USER "mysql")
+ 
++IF(FALSE)
+ # Required for mysqlbug until autotools are deprecated, once done remove these
+ # and expand default cmake variables
+ SET(CC ${CMAKE_C_COMPILER})
+@@ -174,6 +177,7 @@
+   DESTINATION ${INSTALL_BINDIR}
+   COMPONENT Server
+   )
++ENDIF()
+ 
+ ENDIF(UNIX)
+ 
+@@ -198,6 +202,7 @@
+   SET(localstatedir ${MYSQL_DATADIR})
+ ENDIF()
+ 
++IF()
+ IF(UNIX)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.sh
+   ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY)
+@@ -209,6 +214,7 @@
+   COMPONENT Server
+   )
+ ENDIF()
++ENDIF()
+ 
+ 
+ SET(prefix "${CMAKE_INSTALL_PREFIX}")
+@@ -260,6 +266,8 @@
+           GET_FILENAME_COMPONENT(lib "${lib}" NAME_WE)
+           STRING(REGEX REPLACE "^lib" "" lib "${lib}")
+           SET(${var} "${${var}}-l${lib} " ) 
++        ELSEIF(lib STREQUAL "-pthread")
++          SET(${var} "${${var}}-pthread " )
+         ELSE()
+           SET(${var} "${${var}}-l${lib} " ) 
+         ENDIF()
+@@ -315,18 +323,8 @@
+   SET(BIN_SCRIPTS
+     msql2mysql
+     mysql_config
+-    mysql_fix_extensions
+-    mysql_setpermission
+-    mysql_secure_installation
+-    mysql_zap
+     mysqlaccess
+-    mysql_convert_table_format
+     mysql_find_rows
+-    mytop
+-    mysqlhotcopy
+-    mysqldumpslow
+-    mysqld_multi
+-    mysqld_safe
+   )
+   FOREACH(file ${BIN_SCRIPTS})
+     IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh)
diff -ruN databases.orig/mariadb55-client.orig/files/patch-support-files_CMakeLists.txt databases/mariadb55-client.orig/files/patch-support-files_CMakeLists.txt
--- databases.orig/mariadb55-client.orig/files/patch-support-files_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-client.orig/files/patch-support-files_CMakeLists.txt	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,37 @@
+--- support-files/CMakeLists.txt.orig	2011-01-19 23:37:09.000000000 +0100
++++ support-files/CMakeLists.txt	2011-02-07 22:52:05.238344276 +0100
+@@ -40,15 +40,18 @@
+   SET(inst_location ${INSTALL_SUPPORTFILESDIR})
+ ENDIF()
+ 
++IF(FALSE)
+ FOREACH(inifile my-huge my-innodb-heavy-4G my-large my-medium my-small)
+   CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${inifile}.cnf.sh 
+                  ${CMAKE_CURRENT_BINARY_DIR}/${inifile}.${ini_file_extension} @ONLY)
+   INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${inifile}.${ini_file_extension}
+           DESTINATION ${inst_location} COMPONENT IniFiles)
+ ENDFOREACH()
++ENDIF()
+ 
+ IF(UNIX)
+   SET(prefix ${CMAKE_INSTALL_PREFIX})
++IF(FALSE)
+   FOREACH(script  mysqld_multi.server mysql-log-rotate binary-configure
+     config.medium.ini config.small.ini config.huge.ini ndb-config-2-node.ini)
+     CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${script}.sh 
+@@ -66,8 +69,10 @@
+   IF(INSTALL_SUPPORTFILESDIR)
+     INSTALL(FILES magic DESTINATION ${inst_location} COMPONENT SupportFiles)
+   ENDIF()
++ENDIF()
+ 
+   INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
++IF(FALSE)
+   CONFIGURE_FILE(MySQL-shared-compat.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/MySQL-shared-compat.spec @ONLY)
+   CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.spec @ONLY)
+   CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.${VERSION}.spec @ONLY)
+@@ -85,3 +90,4 @@
+     PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ 
+     GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+ ENDIF()
++ENDIF()
diff -ruN databases.orig/mariadb55-client.orig/pkg-plist databases/mariadb55-client.orig/pkg-plist
--- databases.orig/mariadb55-client.orig/pkg-plist	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-client.orig/pkg-plist	2013-10-01 00:32:28.000000000 +0200
@@ -0,0 +1,91 @@
+bin/msql2mysql
+bin/mysql
+bin/mysql_config
+bin/mysql_find_rows
+bin/mysql_waitpid
+bin/mysqlaccess
+bin/mysqladmin
+bin/mysqlbinlog
+bin/mysqlcheck
+bin/mysqldump
+bin/mysqlimport
+bin/mysqlshow
+bin/mysqlslap
+include/mysql/auth_dialog_client.h
+include/mysql/client_plugin.h
+include/mysql/decimal.h
+include/mysql/errmsg.h
+include/mysql/handler_state.h
+include/mysql/keycache.h
+include/mysql/m_ctype.h
+include/mysql/m_string.h
+include/mysql/ma_dyncol.h
+include/mysql/my_alloc.h
+include/mysql/my_attribute.h
+include/mysql/my_compiler.h
+include/mysql/my_config.h
+include/mysql/my_dbug.h
+include/mysql/my_decimal_limits.h
+include/mysql/my_dir.h
+include/mysql/my_getopt.h
+include/mysql/my_global.h
+include/mysql/my_list.h
+include/mysql/my_net.h
+include/mysql/my_pthread.h
+include/mysql/my_sys.h
+include/mysql/my_valgrind.h
+include/mysql/my_xml.h
+include/mysql/mysql.h
+include/mysql/mysql_com.h
+include/mysql/mysql_embed.h
+include/mysql/mysql_time.h
+include/mysql/mysql_version.h
+include/mysql/mysqld_ername.h
+include/mysql/mysqld_error.h
+include/mysql/plugin.h
+include/mysql/plugin_audit.h
+include/mysql/plugin_auth.h
+include/mysql/plugin_auth_common.h
+include/mysql/plugin_ftparser.h
+include/mysql/psi/mysql_file.h
+include/mysql/psi/mysql_thread.h
+include/mysql/psi/psi.h
+include/mysql/service_debug_sync.h
+include/mysql/service_kill_statement.h
+include/mysql/service_logger.h
+include/mysql/service_my_snprintf.h
+include/mysql/service_progress_report.h
+include/mysql/service_thd_alloc.h
+include/mysql/service_thd_wait.h
+include/mysql/service_thread_scheduler.h
+include/mysql/services.h
+include/mysql/sql_common.h
+include/mysql/sql_state.h
+include/mysql/sslopt-case.h
+include/mysql/sslopt-longopts.h
+include/mysql/sslopt-vars.h
+include/mysql/typelib.h
+lib/mysql/libmysqlclient.a
+lib/mysql/libmysqlclient.so
+lib/mysql/libmysqlclient.so.18
+lib/mysql/libmysqlclient_r.a
+lib/mysql/libmysqlclient_r.so
+lib/mysql/libmysqlclient_r.so.18
+man/man1/msql2mysql.1.gz
+man/man1/mysql.1.gz
+man/man1/mysql_config.1.gz
+man/man1/mysql_find_rows.1.gz
+man/man1/mysql_plugin.1.gz
+man/man1/mysql_waitpid.1.gz
+man/man1/mysqlaccess.1.gz
+man/man1/mysqladmin.1.gz
+man/man1/mysqlbinlog.1.gz
+man/man1/mysqlcheck.1.gz
+man/man1/mysqldump.1.gz
+man/man1/mysqlimport.1.gz
+man/man1/mysqlshow.1.gz
+man/man1/mysqlslap.1.gz
+share/aclocal/mysql.m4
+@dirrmtry lib/mysql
+@dirrm include/mysql/psi
+@dirrm include/mysql
diff -ruN databases.orig/mariadb55-server/Makefile databases/mariadb55-server/Makefile
--- databases.orig/mariadb55-server/Makefile	2013-10-01 00:32:28.000000000 +0200
+++ databases/mariadb55-server/Makefile	2013-10-01 15:24:35.085467022 +0200
@@ -2,7 +2,7 @@
 
 PORTNAME?=	mariadb
 PORTVERSION=	5.5.33a
-PORTREVISION?=	0
+PORTREVISION?=	1
 CATEGORIES=	databases ipv6
 MASTER_SITES=	http://ftp.osuosl.org/pub/mariadb/${PORTNAME}-${PORTVERSION}/kvm-tarbake-jaunty-x86/ \
 		http://mirrors.supportex.net/mariadb/${PORTNAME}-${PORTVERSION}/kvm-tarbake-jaunty-x86/ \
@@ -18,6 +18,9 @@
 MAINTAINER=	never@nevermind.kiev.ua
 COMMENT?=	Multithreaded SQL database (server)
 
+SUB_FILES=	pkg-message
+PKGMESSAGE=	${WRKDIR}/pkg-message
+
 SLAVEDIRS=	databases/mariadb55-client
 USES=		cmake gmake
 NO_OPTIONS_SORT=yes
@@ -136,6 +139,7 @@
 
 post-patch:
 	@${REINPLACE_CMD} 's/*.1/${MAN1}/' ${WRKSRC}/man/CMakeLists.txt
+	@${REINPLACE_CMD} 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/mysys/default.c
 
 .include <bsd.port.pre.mk>
 
diff -ruN databases.orig/mariadb55-server/files/patch-mysys_default.c databases/mariadb55-server/files/patch-mysys_default.c
--- databases.orig/mariadb55-server/files/patch-mysys_default.c	2013-01-05 12:30:51.000000000 +0100
+++ databases/mariadb55-server/files/patch-mysys_default.c	2013-10-01 23:53:44.435933823 +0200
@@ -1,6 +1,6 @@
---- mysys/default.c.orig	2010-11-02 23:01:13.000000000 +0100
-+++ mysys/default.c	2010-11-10 16:39:51.000000000 +0100
-@@ -70,7 +70,7 @@
+--- mysys/default.c.orig	2013-10-01 21:15:03.544135869 +0200
++++ mysys/default.c	2013-10-01 21:15:38.871375504 +0200
+@@ -89,7 +89,7 @@
  
  /* Which directories are searched for options (and in which order) */
  
@@ -9,7 +9,7 @@
  #define DEFAULT_DIRS_SIZE (MAX_DEFAULT_DIRS + 1)  /* Terminate with NULL */
  static const char **default_directories = NULL;
  
-@@ -711,7 +711,7 @@
+@@ -785,7 +785,7 @@
    {
      MY_STAT stat_info;
      if (!my_stat(name,&stat_info,MYF(0)))
@@ -18,14 +18,31 @@
      /*
        Ignore world-writable regular files.
        This is mainly done to protect us to not read a file created by
-@@ -1153,7 +1153,10 @@
+@@ -803,6 +803,14 @@
+   if (!(fp= mysql_file_fopen(key_file_cnf, name, O_RDONLY, MYF(0))))
+     return 1;					/* Ignore wrong files */
  
- #if defined(DEFAULT_SYSCONFDIR)
-   if (DEFAULT_SYSCONFDIR[0])
++  if (strstr(name, "/etc") == name)
 +  {
-     errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
-+    errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs);
++    fprintf(stderr,
++	      "error: Config file %s in invalid location, please move to or merge with %%PREFIX%%%s\n",
++	      name,name);
++      goto err;
 +  }
- #endif /* DEFAULT_SYSCONFDIR */
++
+   while (mysql_file_fgets(buff, sizeof(buff) - 1, fp))
+   {
+     line++;
+@@ -1226,10 +1226,8 @@
+   errors += add_directory(alloc, "/etc/", dirs);
+   errors += add_directory(alloc, "/etc/mysql/", dirs);
+ 
+-#if defined(DEFAULT_SYSCONFDIR)
+-  if (DEFAULT_SYSCONFDIR[0])
+-    errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
+-#endif /* DEFAULT_SYSCONFDIR */
++  errors += add_directory(alloc, "%%PREFIX%%/etc/", dirs);
++  errors += add_directory(alloc, "%%PREFIX%%/etc/mysql/", dirs);
  
  #endif
+ 
diff -ruN databases.orig/mariadb55-server/files/pkg-message.in databases/mariadb55-server/files/pkg-message.in
--- databases.orig/mariadb55-server/files/pkg-message.in	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server/files/pkg-message.in	2013-10-01 23:50:41.526232450 +0200
@@ -0,0 +1,11 @@
+************************************************************************
+
+Remember to run mysql_upgrade (with the optional --datadir=<dbdir> flag)
+the first time you start the MySQL server after an upgrade from an
+earlier version.
+
+MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for
+my.cnf. Please move existing my.cnf files from those paths to
+%%PREFIX%%/etc and %%PREFIX%%/etc/mysql.
+
+************************************************************************
diff -ruN databases.orig/mariadb55-server/pkg-message databases/mariadb55-server/pkg-message
--- databases.orig/mariadb55-server/pkg-message	2013-01-05 12:30:51.000000000 +0100
+++ databases/mariadb55-server/pkg-message	1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +0,0 @@
-************************************************************************
-
-Remember to run mysql_upgrade (with the optional --datadir=<dbdir> flag)
-the first time you start the MySQL server after an upgrade from an
-earlier version.
-
-************************************************************************
diff -ruN databases.orig/mariadb55-server.orig/Makefile databases/mariadb55-server.orig/Makefile
--- databases.orig/mariadb55-server.orig/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/Makefile	2013-10-01 00:32:28.000000000 +0200
@@ -0,0 +1,146 @@
+# $FreeBSD: databases/mariadb55-server/Makefile 328885 2013-09-30 22:32:28Z flo $
+
+PORTNAME?=	mariadb
+PORTVERSION=	5.5.33a
+PORTREVISION?=	0
+CATEGORIES=	databases ipv6
+MASTER_SITES=	http://ftp.osuosl.org/pub/mariadb/${PORTNAME}-${PORTVERSION}/kvm-tarbake-jaunty-x86/ \
+		http://mirrors.supportex.net/mariadb/${PORTNAME}-${PORTVERSION}/kvm-tarbake-jaunty-x86/ \
+		http://mirror.aarnet.edu.au/pub/MariaDB/${PORTNAME}-${PORTVERSION}/kvm-tarbake-jaunty-x86/ \
+		http://mirror2.hs-esslingen.de/pub/Mirrors/mariadb/${PORTNAME}-${PORTVERSION}/kvm-tarbake-jaunty-x86/ \
+		http://gd.tuwien.ac.at/db/mariadb/${PORTNAME}-${PORTVERSION}/kvm-tarbake-jaunty-x86/ \
+		http://mirrors.fe.up.pt/pub/mariadb/${PORTNAME}-${PORTVERSION}/kvm-tarbake-jaunty-x86/ \
+		http://mirror.de.gsnw.de:56431/mariadb/${PORTNAME}-${PORTVERSION}/kvm-tarbake-jaunty-x86/ \
+		http://mirror.layerjet.com/mariadb/${PORTNAME}-${PORTVERSION}/kvm-tarbake-jaunty-x86/ \
+		http://mirror.switch.ch/mirror/mariadb/${PORTNAME}-${PORTVERSION}/kvm-tarbake-jaunty-x86/
+PKGNAMESUFFIX?=	-server
+
+MAINTAINER=	never@nevermind.kiev.ua
+COMMENT?=	Multithreaded SQL database (server)
+
+SLAVEDIRS=	databases/mariadb55-client
+USES=		cmake gmake
+NO_OPTIONS_SORT=yes
+
+OPTIONS_DEFINE+=	SSL OPENSSL PORTSSL FASTMTX
+OPTIONS_DEFAULT+=	SSL
+
+FASTMTX_DESC=	Replace mutexes with spinlocks
+OPENSSL_DESC=	Use OpenSSL instead of bundled yassl
+PORTSSL_DESC=	Use OpenSSL from port (requires OPENSSL to be set)
+
+CMAKE_ARGS+=	-DINSTALL_DOCDIR="share/doc/mysql" \
+		-DINSTALL_DOCREADMEDIR="share/doc/mysql" \
+		-DINSTALL_INCLUDEDIR="include/mysql" \
+		-DINSTALL_INFODIR="info" \
+		-DINSTALL_LIBDIR="lib/mysql" \
+		-DINSTALL_MANDIR="man" \
+		-DINSTALL_MYSQLDATADIR="/var/db/mysql" \
+		-DINSTALL_MYSQLSHAREDIR="share/mysql" \
+		-DINSTALL_MYSQLTESTDIR="share/mysql/tests" \
+		-DINSTALL_PLUGINDIR="lib/mysql/plugin" \
+		-DINSTALL_SBINDIR="libexec" \
+		-DINSTALL_SCRIPTDIR="bin" \
+		-DINSTALL_SHAREDIR="share" \
+		-DINSTALL_SQLBENCHDIR="share/mysql" \
+		-DINSTALL_SUPPORTFILESDIR="share/mysql" \
+		-DWITH_UNIT_TESTS=0 \
+		-DWITH_LIBEDIT=0 \
+		-DWITH_LIBWRAP=1 \
+		-DEXECINFO_ROOT=${LOCALBASE} \
+		-DCOMPILATION_COMMENT="FreeBSD Ports"
+
+.ifdef USE_MYSQL
+.error You have `USE_MYSQL' variable defined either in environment or in make(1) arguments. Please undefine and try again.
+.endif
+
+DATADIR=	${PREFIX}/share/mysql
+USE_LDCONFIG=	${PREFIX}/lib/mysql
+
+# MySQL-Server options
+.if !defined(CLIENT_ONLY)
+OPTIONS_DEFINE+=	OQGRAPH MAXKEY
+
+OQGRAPH_DESC=	Open Query Graph Computation engine
+MAXKEY_DESC=	Change max key length from 1000 to 4000
+
+OPTIONS_DEFAULT+=	MAXKEY
+.endif
+
+.include <bsd.port.options.mk>
+
+.if ${OSVERSION} < 1000052
+LIB_DEPENDS=	libexecinfo.so:${PORTSDIR}/devel/libexecinfo
+.endif
+
+.if ${OSVERSION} < 1000012
+CMAKE_ARGS+=	-DWITH_JEMALLOC="bundled"
+.else
+CMAKE_ARGS+=	-DWITH_JEMALLOC="system"
+.endif
+
+.if ${PORT_OPTIONS:MSSL}
+.if ${PORT_OPTIONS:MOPENSSL}
+USE_OPENSSL=	yes
+.if empty(PORT_OPTIONS:MPORTSSL)
+WITH_OPENSSL_BASE=	yes
+.else
+WITH_OPENSSL_PORT=	yes
+.endif
+CMAKE_ARGS+=	-DWITH_SSL=yes
+.else
+CMAKE_ARGS+=	-DWITH_SSL=bundled
+.endif
+.else
+CMAKE_FLAGS+=	-DWITH_SSL=no
+.endif
+.if ${PORT_OPTIONS:MFASTMTX}
+CMAKE_ARGS+=	-DWITH_FAST_MUTEXES=1
+.endif
+
+# MySQL-Server part
+.if !defined(CLIENT_ONLY)
+USE_MYSQL=	yes
+WANT_MYSQL_VER=	55m
+
+LATEST_LINK=	mariadb55-server
+
+CONFLICTS_INSTALL=	mysql-server-[345].* mariadb-server-5.3.* percona-server-5.*
+
+USE_RC_SUBR=	mysql-server
+
+USERS=		mysql
+GROUPS=		mysql
+
+CMAKE_ARGS+=	-DWITH_EMBEDDED_SERVER="ON" \
+		-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1
+
+post-install:
+.if !defined(PACKAGE_BUILDING)
+	@${CAT} ${PKGMESSAGE}
+.endif
+
+.if empty(PORT_OPTIONS:MOQGRAPH)
+CMAKE_ARGS+=	-DWITHOUT_OQGRAPH_STORAGE_ENGINE=1
+PLIST_SUB+=	OQGRAPH="@comment "
+.else
+USE_GCC?=	yes
+CMAKE_ARGS+=	-DWITH_OQGRAPH_STORAGE_ENGINE=1
+PLIST_SUB+=	OQGRAPH=""
+LIB_DEPENDS+=	boost_system:${PORTSDIR}/devel/boost-libs
+.endif
+.if ${PORT_OPTIONS:MMAXKEY}
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-include_my_compare.h
+.endif
+.endif
+
+post-patch:
+	@${REINPLACE_CMD} 's/*.1/${MAN1}/' ${WRKSRC}/man/CMakeLists.txt
+
+.include <bsd.port.pre.mk>
+
+.if ${ARCH} == "arm"
+BROKEN=		Does not compile on arm
+.endif
+
+.include <bsd.port.post.mk>
diff -ruN databases.orig/mariadb55-server.orig/distinfo databases/mariadb55-server.orig/distinfo
--- databases.orig/mariadb55-server.orig/distinfo	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/distinfo	2013-10-01 00:32:28.000000000 +0200
@@ -0,0 +1,2 @@
+SHA256 (mariadb-5.5.33a.tar.gz) = adf4d04087177fde6568082c3fee77e52e84dc3ae4eb5b994d5defaaa8c83d5b
+SIZE (mariadb-5.5.33a.tar.gz) = 45226492
diff -ruN databases.orig/mariadb55-server.orig/files/extra-patch-include_my_compare.h databases/mariadb55-server.orig/files/extra-patch-include_my_compare.h
--- databases.orig/mariadb55-server.orig/files/extra-patch-include_my_compare.h	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/extra-patch-include_my_compare.h	2013-03-07 21:22:40.000000000 +0100
@@ -0,0 +1,11 @@
+--- include/my_compare.h.orig	2012-11-28 17:49:43.000000000 +0200
++++ include/my_compare.h	2012-12-23 02:45:51.000000000 +0200
+@@ -40,7 +40,7 @@
+   But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and HA_MAX_KEY_LENGTH.
+ */
+ 
+-#define HA_MAX_KEY_LENGTH           1000        /* Max length in bytes */
++#define HA_MAX_KEY_LENGTH           4000        /* Max length in bytes */
+ #define HA_MAX_KEY_SEG              32          /* Max segments for key */
+ 
+ #define HA_MAX_POSSIBLE_KEY_BUFF    (HA_MAX_KEY_LENGTH + 24+ 6+6)
diff -ruN databases.orig/mariadb55-server.orig/files/mysql-server.in databases/mariadb55-server.orig/files/mysql-server.in
--- databases.orig/mariadb55-server.orig/files/mysql-server.in	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/mysql-server.in	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# $FreeBSD: databases/mariadb55-server/files/mysql-server.in 309955 2013-01-05 11:30:51Z flo $
+#
+
+# PROVIDE: mysql
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Add the following line to /etc/rc.conf to enable mysql:
+# mysql_enable (bool):	Set to "NO" by default.
+#			Set it to "YES" to enable MySQL.
+# mysql_limits (bool):	Set to "NO" by default.
+#			Set it to yes to run `limits -e -U mysql`
+#			just before mysql starts.
+# mysql_dbdir (str):	Default to "/var/db/mysql"
+#			Base database directory.
+# mysql_pidfile (str):	Custum PID file path and name.
+#			Default to "${mysql_dbdir}/${hostname}.pid".
+# mysql_args (str):	Custom additional arguments to be passed
+#			to mysqld_safe (default empty).
+#
+
+. /etc/rc.subr
+
+name="mysql"
+rcvar=mysql_enable
+
+load_rc_config $name
+
+: ${mysql_enable="NO"}
+: ${mysql_limits="NO"}
+: ${mysql_dbdir="/var/db/mysql"}
+
+mysql_user="mysql"
+mysql_limits_args="-e -U ${mysql_user}"
+pidfile=${mysql_pidfile:-"${mysql_dbdir}/`/bin/hostname`.pid"}
+command="/usr/sbin/daemon"
+command_args="-c -f %%PREFIX%%/bin/mysqld_safe --defaults-extra-file=${mysql_dbdir}/my.cnf --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args}"
+procname="%%PREFIX%%/libexec/mysqld"
+start_precmd="${name}_prestart"
+start_postcmd="${name}_poststart"
+mysql_install_db="%%PREFIX%%/bin/mysql_install_db"
+mysql_install_db_args="--basedir=%%PREFIX%% --datadir=${mysql_dbdir} --force"
+
+mysql_create_auth_tables()
+{
+	eval $mysql_install_db $mysql_install_db_args >/dev/null 2>/dev/null
+        [ $? -eq 0 ] && chown -R ${mysql_user}:${mysql_user} ${mysql_dbdir}
+}
+
+mysql_prestart()
+{
+	if [ ! -d "${mysql_dbdir}/mysql/." ]; then
+		mysql_create_auth_tables || return 1
+	fi
+	if checkyesno mysql_limits; then
+		eval `/usr/bin/limits ${mysql_limits_args}` 2>/dev/null
+	else
+		return 0
+	fi
+}
+
+mysql_poststart()
+{
+	local timeout=15
+	while [ ! -f "${pidfile}" -a ${timeout} -gt 0 ]; do
+		timeout=$(( timeout - 1 ))
+		sleep 1
+	done
+	return 0
+}
+
+run_rc_command "$1"
diff -ruN databases.orig/mariadb55-server.orig/files/patch-CMakeLists.txt databases/mariadb55-server.orig/files/patch-CMakeLists.txt
--- databases.orig/mariadb55-server.orig/files/patch-CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-CMakeLists.txt	2013-10-01 00:32:28.000000000 +0200
@@ -0,0 +1,44 @@
+--- CMakeLists.txt.orig	2013-09-20 01:34:26.000000000 +0300
++++ CMakeLists.txt	2013-09-27 01:39:19.000000000 +0300
+@@ -310,17 +310,12 @@
+ ADD_SUBDIRECTORY(support-files)
+ 
+ IF(NOT WITHOUT_SERVER)
+-  ADD_SUBDIRECTORY(tests)
+   ADD_SUBDIRECTORY(sql)
+   OPTION (WITH_EMBEDDED_SERVER "Compile MySQL with embedded server" OFF)
+   IF(WITH_EMBEDDED_SERVER) 
+    ADD_SUBDIRECTORY(libmysqld)
+-   ADD_SUBDIRECTORY(libmysqld/examples)
+   ENDIF(WITH_EMBEDDED_SERVER)
+ 
+-  ADD_SUBDIRECTORY(mysql-test)
+-  ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
+-  ADD_SUBDIRECTORY(sql-bench)
+ 
+   IF(EXISTS ${CMAKE_SOURCE_DIR}/internal/CMakeLists.txt)
+     ADD_SUBDIRECTORY(internal)
+@@ -339,7 +334,6 @@
+   ADD_SUBDIRECTORY(win/upgrade_wizard)
+   ADD_SUBDIRECTORY(win/packaging)
+ ENDIF()
+-ADD_SUBDIRECTORY(packaging/solaris)
+ 
+ CONFIGURE_FILE(config.h.cmake   ${CMAKE_BINARY_DIR}/include/my_config.h)
+ CONFIGURE_FILE(config.h.cmake   ${CMAKE_BINARY_DIR}/include/config.h)
+@@ -366,6 +360,7 @@
+   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ )
+ 
++IF(FALSE)
+ INSTALL_DOCUMENTATION(README COPYING COPYING.LESSER
+                       COMPONENT Readme)
+ INSTALL_DOCUMENTATION(${CMAKE_BINARY_DIR}/Docs/INFO_SRC
+@@ -373,6 +368,7 @@
+ IF(UNIX)
+   INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY COMPONENT Readme)
+ ENDIF()
++ENDIF()
+ 
+ INCLUDE(CPack)
+ 
diff -ruN databases.orig/mariadb55-server.orig/files/patch-client_CMakeLists.txt databases/mariadb55-server.orig/files/patch-client_CMakeLists.txt
--- databases.orig/mariadb55-server.orig/files/patch-client_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-client_CMakeLists.txt	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,70 @@
+--- client/CMakeLists.txt.orig	2012-11-28 17:49:47.000000000 +0200
++++ client/CMakeLists.txt	2012-12-23 02:37:04.000000000 +0200
+@@ -26,6 +26,7 @@
+ )
+ 
+ ADD_DEFINITIONS(${SSL_DEFINES})
++IF(FALSE)
+ MYSQL_ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc
+                            ${CMAKE_SOURCE_DIR}/sql/sql_string.cc)
+ TARGET_LINK_LIBRARIES(mysql mysqlclient)
+@@ -33,6 +34,7 @@
+   TARGET_LINK_LIBRARIES(mysql ${MY_READLINE_LIBRARY})
+   SET_TARGET_PROPERTIES(mysql PROPERTIES ENABLE_EXPORTS TRUE)
+ ENDIF(UNIX)
++ENDIF()
+ 
+ MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc COMPONENT Test)
+ SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS")
+@@ -40,6 +42,7 @@
+ SET_TARGET_PROPERTIES(mysqltest PROPERTIES ENABLE_EXPORTS TRUE)
+ 
+ 
++IF(FALSE)
+ MYSQL_ADD_EXECUTABLE(mysqlcheck mysqlcheck.c)
+ TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient)
+ 
+@@ -48,17 +51,21 @@
+ 
+ MYSQL_ADD_EXECUTABLE(mysqlimport mysqlimport.c)
+ TARGET_LINK_LIBRARIES(mysqlimport mysqlclient)
++ENDIF()
+ 
+ MYSQL_ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c COMPONENT Server)
+ TARGET_LINK_LIBRARIES(mysql_upgrade mysqlclient)
+ ADD_DEPENDENCIES(mysql_upgrade GenFixPrivs)
+ 
++IF(FALSE)
+ MYSQL_ADD_EXECUTABLE(mysqlshow mysqlshow.c)
+ TARGET_LINK_LIBRARIES(mysqlshow mysqlclient)
++ENDIF()
+ 
+ MYSQL_ADD_EXECUTABLE(mysql_plugin mysql_plugin.c)
+ TARGET_LINK_LIBRARIES(mysql_plugin mysqlclient)
+ 
++IF(FALSE)
+ MYSQL_ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc)
+ TARGET_LINK_LIBRARIES(mysqlbinlog mysqlclient)
+ 
+@@ -68,17 +75,20 @@
+ MYSQL_ADD_EXECUTABLE(mysqlslap mysqlslap.c)
+ SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
+ TARGET_LINK_LIBRARIES(mysqlslap mysqlclient)
++ENDIF()
+ 
+ # "WIN32" also covers 64 bit. "echo" is used in some files below "mysql-test/".
+ IF(WIN32)
+   MYSQL_ADD_EXECUTABLE(echo echo.c COMPONENT Junk)
+ ENDIF(WIN32)
+ 
++IF(FALSE)
+ # async_example is just a code example, do not install it.
+ ADD_EXECUTABLE(async_example async_example.c)
+ TARGET_LINK_LIBRARIES(async_example mysqlclient)
++ENDIF()
+ 
+-SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysqlslap mysql_plugin 
++SET_TARGET_PROPERTIES (mysql_upgrade mysql_plugin 
+ PROPERTIES HAS_CXX TRUE)
+ 
+ ADD_DEFINITIONS(-DHAVE_DLOPEN)
diff -ruN databases.orig/mariadb55-server.orig/files/patch-cmake__jemalloc.cmake databases/mariadb55-server.orig/files/patch-cmake__jemalloc.cmake
--- databases.orig/mariadb55-server.orig/files/patch-cmake__jemalloc.cmake	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-cmake__jemalloc.cmake	2013-10-01 00:32:28.000000000 +0200
@@ -0,0 +1,14 @@
+--- cmake/jemalloc.cmake.orig	2013-09-20 00:34:22.000000000 +0200
++++ cmake/jemalloc.cmake	2013-09-27 22:46:05.791110010 +0200
+@@ -37,9 +37,9 @@
+     SET(WITH_JEMALLOC "no")
+   ENDIF()
+   IF(WITH_JEMALLOC STREQUAL "system" OR WITH_JEMALLOC STREQUAL "yes")
+-    CHECK_LIBRARY_EXISTS(jemalloc malloc_stats_print "" HAVE_JEMALLOC)
++    CHECK_LIBRARY_EXISTS(c malloc_stats_print "" HAVE_JEMALLOC)
+     IF (HAVE_JEMALLOC)
+-      SET(LIBJEMALLOC jemalloc)
++      SET(LIBJEMALLOC c)
+     ELSEIF (WITH_JEMALLOC STREQUAL "system")
+       MESSAGE(FATAL_ERROR "system jemalloc is not found")
+     ELSEIF (WITH_JEMALLOC STREQUAL "yes")
diff -ruN databases.orig/mariadb55-server.orig/files/patch-cmake_os_FreeBSD.cmake databases/mariadb55-server.orig/files/patch-cmake_os_FreeBSD.cmake
--- databases.orig/mariadb55-server.orig/files/patch-cmake_os_FreeBSD.cmake	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-cmake_os_FreeBSD.cmake	2013-10-01 00:32:28.000000000 +0200
@@ -0,0 +1,16 @@
+--- cmake/os/FreeBSD.cmake.orig	2013-09-27 00:09:44.000000000 +0300
++++ cmake/os/FreeBSD.cmake	2013-09-27 00:09:57.000000000 +0300
+@@ -24,9 +24,10 @@
+ # ADD_DEFINITIONS(-DHAVE_BROKEN_REALPATH)
+ 
+ # Find libexecinfo (library that contains backtrace_symbols etc)
+-INCLUDE_DIRECTORIES(/usr/local/include)
+-SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} /usr/local/include )
+-SET(ENV{LIB} "$ENV{LIB}:/usr/local/lib")
++SET(EXECINFO_ROOT /usr/local CACHE INTERNAL "Where to find execinfo library and header")
++INCLUDE_DIRECTORIES(${EXECINFO_ROOT}/include)
++SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${EXECINFO_ROOT}/include)
++SET(ENV{LIB} "$ENV{LIB}:${EXECINFO_ROOT}/lib")
+ FIND_LIBRARY(EXECINFO NAMES execinfo)
+ IF(EXECINFO)
+  SET(LIBEXECINFO ${EXECINFO})
diff -ruN databases.orig/mariadb55-server.orig/files/patch-extra_CMakeLists.txt databases/mariadb55-server.orig/files/patch-extra_CMakeLists.txt
--- databases.orig/mariadb55-server.orig/files/patch-extra_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-extra_CMakeLists.txt	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,11 @@
+--- extra/CMakeLists.txt.orig	2012-11-28 17:49:47.000000000 +0200
++++ extra/CMakeLists.txt	2012-12-23 02:41:57.000000000 +0200
+@@ -80,6 +80,8 @@
+   MYSQL_ADD_EXECUTABLE(resolve_stack_dump resolve_stack_dump.c)
+   TARGET_LINK_LIBRARIES(resolve_stack_dump mysys)
+ 
++IF(FALSE)
+   MYSQL_ADD_EXECUTABLE(mysql_waitpid mysql_waitpid.c COMPONENT Client)
+   TARGET_LINK_LIBRARIES(mysql_waitpid mysys)
+ ENDIF()
++ENDIF()
diff -ruN databases.orig/mariadb55-server.orig/files/patch-extra_yassl_taocrypt_src_integer.cpp databases/mariadb55-server.orig/files/patch-extra_yassl_taocrypt_src_integer.cpp
--- databases.orig/mariadb55-server.orig/files/patch-extra_yassl_taocrypt_src_integer.cpp	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-extra_yassl_taocrypt_src_integer.cpp	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,11 @@
+--- extra/yassl/taocrypt/src/integer.cpp.orig	2012-04-02 09:37:09.000000000 +0200
++++ extra/yassl/taocrypt/src/integer.cpp	2012-04-02 09:37:41.000000000 +0200
+@@ -73,7 +73,7 @@
+ CPP_TYPENAME AlignedAllocator<T>::pointer AlignedAllocator<T>::allocate(
+                                            size_type n, const void *)
+ {
+-    if (n > max_size())
++    if (n > AlignedAllocator<T>::max_size())
+         return 0;
+     if (n == 0)
+         return 0;
diff -ruN databases.orig/mariadb55-server.orig/files/patch-include_CMakeLists.txt databases/mariadb55-server.orig/files/patch-include_CMakeLists.txt
--- databases.orig/mariadb55-server.orig/files/patch-include_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-include_CMakeLists.txt	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,24 @@
+--- include/CMakeLists.txt.orig	2012-11-28 17:49:47.000000000 +0200
++++ include/CMakeLists.txt	2012-12-23 05:49:42.000000000 +0200
+@@ -54,17 +54,21 @@
+   handler_state.h
+ )
+ 
++IF(FALSE)
+ INSTALL(FILES ${HEADERS} DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development)
+ FOREACH(f ${HEADERS_GEN_CONFIGURE})
+   INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
+ ENDFOREACH(f)
+ INSTALL(DIRECTORY mysql/ DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development FILES_MATCHING PATTERN "*.h")
++ENDIF()
+ 
+ STRING(REPLACE "." "\\." EXCL_RE "${HEADERS};${HEADERS_GEN_CONFIGURE}")
+ STRING(REPLACE ";" "|" EXCL_RE "${EXCL_RE}")
+ 
++IF(FALSE)
+ INSTALL(DIRECTORY . DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Development
+   FILES_MATCHING PATTERN "*.h"
+   PATTERN CMakeFiles EXCLUDE
+   PATTERN mysql EXCLUDE
+   REGEX "\\./(${EXCL_RE}$)" EXCLUDE)
++ENDIF()
diff -ruN databases.orig/mariadb55-server.orig/files/patch-libmysql_CMakeLists.txt databases/mariadb55-server.orig/files/patch-libmysql_CMakeLists.txt
--- databases.orig/mariadb55-server.orig/files/patch-libmysql_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-libmysql_CMakeLists.txt	2013-03-16 01:35:47.000000000 +0100
@@ -0,0 +1,36 @@
+--- libmysql/CMakeLists.txt.orig	2013-03-15 22:24:20.000000000 +0200
++++ libmysql/CMakeLists.txt	2013-03-15 22:24:34.000000000 +0200
+@@ -329,13 +329,14 @@
+ 
+ # Merge several convenience libraries into one big mysqlclient
+ # and link them together into shared library.
+-MERGE_LIBRARIES(mysqlclient STATIC ${LIBS} COMPONENT Development)
++MERGE_LIBRARIES(mysqlclient STATIC ${LIBS} COMPONENT Development NOINSTALL)
+ 
+ # Visual Studio users need debug  static library for debug projects
+ IF(MSVC)
+  INSTALL_DEBUG_TARGET(mysqlclient DESTINATION ${INSTALL_LIBDIR}/debug)
+ ENDIF()
+ 
++IF(FALSE)
+ IF(UNIX)
+   MACRO(GET_VERSIONED_LIBNAME LIBNAME EXTENSION VERSION OUTNAME)
+     SET(DOT_VERSION ".${VERSION}")
+@@ -350,9 +351,11 @@
+   ENDMACRO()
+   INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a mysqlclient ${INSTALL_LIBDIR} Development)
+ ENDIF()
++ENDIF()
+ 
+ IF(NOT DISABLE_SHARED)
+-  MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS} ${CLIENT_API_EXTRA} COMPONENT SharedLibraries)
++  MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS} ${CLIENT_API_EXTRA} COMPONENT SharedLibraries NOINSTALL)
++IF(FALSE)
+   IF(UNIX)
+     # libtool compatability
+     IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR APPLE)
+@@ -399,3 +402,4 @@
+     ENDFOREACH()
+   ENDIF()
+ ENDIF()
++ENDIF()
diff -ruN databases.orig/mariadb55-server.orig/files/patch-libservices_CMakeLists.txt databases/mariadb55-server.orig/files/patch-libservices_CMakeLists.txt
--- databases.orig/mariadb55-server.orig/files/patch-libservices_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-libservices_CMakeLists.txt	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,9 @@
+--- libservices/CMakeLists.txt.orig	2012-11-28 17:49:47.000000000 +0200
++++ libservices/CMakeLists.txt	2012-12-23 17:32:35.000000000 +0200
+@@ -24,4 +24,6 @@
+   debug_sync_service.c)
+ 
+ ADD_CONVENIENCE_LIBRARY(mysqlservices ${MYSQLSERVICES_SOURCES})
++IF(FALSE)
+ INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR} COMPONENT Development)
++ENDIF()
diff -ruN databases.orig/mariadb55-server.orig/files/patch-man_CMakeLists.txt databases/mariadb55-server.orig/files/patch-man_CMakeLists.txt
--- databases.orig/mariadb55-server.orig/files/patch-man_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-man_CMakeLists.txt	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,28 @@
+--- man/CMakeLists.txt.orig	2012-11-28 17:49:47.000000000 +0200
++++ man/CMakeLists.txt	2012-12-23 05:38:24.000000000 +0200
+@@ -16,13 +16,13 @@
+ SET(MAN1_SERVER innochecksum.1 my_print_defaults.1 myisam_ftdump.1 myisamchk.1
+ 		myisamlog.1 myisampack.1 mysql.server.1
+ 		mysql_convert_table_format.1 mysql_fix_extensions.1
+-		mysql_fix_privilege_tables.1 mysql_install_db.1
++		mysql_install_db.1
+ 		mysql_secure_installation.1 mysql_setpermission.1
+ 		mysql_tzinfo_to_sql.1 mysql_upgrade.1 mysql_zap.1
+ 		mysqld_multi.1 mysqld_safe.1 mysqldumpslow.1 mysqlhotcopy.1
+ 		mysqlman.1 mysqltest.1 perror.1 replace.1 resolve_stack_dump.1
+ 		resolveip.1 mysqlbug.1)
+-SET(MAN8_SERVER mysqld.8 mysqlmanager.8)
++SET(MAN8_SERVER mysqld.8)
+ SET(MAN1_CLIENT msql2mysql.1 mysql.1 mysql_find_rows.1 mysql_waitpid.1
+ 		mysqlaccess.1 mysqladmin.1 mysqlbinlog.1 mysqlcheck.1
+ 		mysqldump.1 mysqlimport.1 mysqlshow.1 mysqlslap.1)
+@@ -32,7 +32,9 @@
+ 
+ INSTALL(FILES ${MAN1_SERVER} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT ManPagesServer)
+ INSTALL(FILES ${MAN8_SERVER} DESTINATION ${INSTALL_MANDIR}/man8 COMPONENT ManPagesServer)
++IF(FALSE)
+ INSTALL(FILES ${MAN1_CLIENT} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT ManPagesClient)
+ INSTALL(FILES ${MAN1_DEVEL} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT ManPagesDevelopment)
+ INSTALL(FILES ${MAN1_TEST} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT ManPagesTest)
++ENDIF()
+ 
diff -ruN databases.orig/mariadb55-server.orig/files/patch-mysys_default.c databases/mariadb55-server.orig/files/patch-mysys_default.c
--- databases.orig/mariadb55-server.orig/files/patch-mysys_default.c	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-mysys_default.c	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,31 @@
+--- mysys/default.c.orig	2010-11-02 23:01:13.000000000 +0100
++++ mysys/default.c	2010-11-10 16:39:51.000000000 +0100
+@@ -70,7 +70,7 @@
+ 
+ /* Which directories are searched for options (and in which order) */
+ 
+-#define MAX_DEFAULT_DIRS 6
++#define MAX_DEFAULT_DIRS 7
+ #define DEFAULT_DIRS_SIZE (MAX_DEFAULT_DIRS + 1)  /* Terminate with NULL */
+ static const char **default_directories = NULL;
+ 
+@@ -711,7 +711,7 @@
+   {
+     MY_STAT stat_info;
+     if (!my_stat(name,&stat_info,MYF(0)))
+-      return 1;
++      return 0;
+     /*
+       Ignore world-writable regular files.
+       This is mainly done to protect us to not read a file created by
+@@ -1153,7 +1153,10 @@
+ 
+ #if defined(DEFAULT_SYSCONFDIR)
+   if (DEFAULT_SYSCONFDIR[0])
++  {
+     errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
++    errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs);
++  }
+ #endif /* DEFAULT_SYSCONFDIR */
+ 
+ #endif
diff -ruN databases.orig/mariadb55-server.orig/files/patch-regex_CMakeLists.txt databases/mariadb55-server.orig/files/patch-regex_CMakeLists.txt
--- databases.orig/mariadb55-server.orig/files/patch-regex_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-regex_CMakeLists.txt	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,9 @@
+--- regex/CMakeLists.txt.orig	2012-12-23 06:02:57.000000000 +0200
++++ regex/CMakeLists.txt	2012-12-23 06:03:01.000000000 +0200
+@@ -18,4 +18,6 @@
+ SET(REGEX_SOURCES regcomp.c regerror.c regexec.c regfree.c reginit.c)
+ ADD_CONVENIENCE_LIBRARY(regex ${REGEX_SOURCES})
+ 
++IF(FALSE)
+ INSTALL(FILES "my_regex.h" DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Development)
++ENDIF()
diff -ruN databases.orig/mariadb55-server.orig/files/patch-scripts_CMakeLists.txt databases/mariadb55-server.orig/files/patch-scripts_CMakeLists.txt
--- databases.orig/mariadb55-server.orig/files/patch-scripts_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-scripts_CMakeLists.txt	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,28 @@
+--- scripts/CMakeLists.txt.orig	2012-11-28 17:49:47.000000000 +0200
++++ scripts/CMakeLists.txt	2012-12-23 02:54:04.000000000 +0200
+@@ -260,6 +260,8 @@
+           GET_FILENAME_COMPONENT(lib "${lib}" NAME_WE)
+           STRING(REGEX REPLACE "^lib" "" lib "${lib}")
+           SET(${var} "${${var}}-l${lib} " ) 
++        ELSEIF(lib STREQUAL "-pthread")
++          SET(${var} "${${var}}-pthread " )
+         ELSE()
+           SET(${var} "${${var}}-l${lib} " ) 
+         ENDIF()
+@@ -313,16 +315,11 @@
+ ELSE()
+   # On Unix, most of the files end up in the bin directory
+   SET(BIN_SCRIPTS
+-    msql2mysql
+-    mysql_config
+     mysql_fix_extensions
+     mysql_setpermission
+     mysql_secure_installation
+     mysql_zap
+-    mysqlaccess
+     mysql_convert_table_format
+-    mysql_find_rows
+-    mytop
+     mysqlhotcopy
+     mysqldumpslow
+     mysqld_multi
diff -ruN databases.orig/mariadb55-server.orig/files/patch-scripts_mysqld_safe.sh databases/mariadb55-server.orig/files/patch-scripts_mysqld_safe.sh
--- databases.orig/mariadb55-server.orig/files/patch-scripts_mysqld_safe.sh	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-scripts_mysqld_safe.sh	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,24 @@
+--- scripts/mysqld_safe.sh.orig	2007-10-08 10:39:23.000000000 +0200
++++ scripts/mysqld_safe.sh	2007-10-08 10:40:52.000000000 +0200
+@@ -242,10 +242,10 @@
+ 
+ if test -z "$MYSQL_HOME"
+ then 
+-  if test -r "$MY_BASEDIR_VERSION/my.cnf" && test -r "$DATADIR/my.cnf"
++  if test -r "$MY_BASEDIR_VERSION/etc/my.cnf" && test -r "$DATADIR/my.cnf"
+   then
+     log_error "WARNING: Found two instances of my.cnf -
+-$MY_BASEDIR_VERSION/my.cnf and
++$MY_BASEDIR_VERSION/etc/my.cnf and
+ $DATADIR/my.cnf
+ IGNORING $DATADIR/my.cnf"
+ 
+@@ -254,7 +254,7 @@
+   then
+     log_error "WARNING: Found $DATADIR/my.cnf
+ The data directory is a deprecated location for my.cnf, please move it to
+-$MY_BASEDIR_VERSION/my.cnf"
++$MY_BASEDIR_VERSION/etc/my.cnf"
+     MYSQL_HOME=$DATADIR
+   else
+     MYSQL_HOME=$MY_BASEDIR_VERSION
diff -ruN databases.orig/mariadb55-server.orig/files/patch-sql_CMakeLists.txt databases/mariadb55-server.orig/files/patch-sql_CMakeLists.txt
--- databases.orig/mariadb55-server.orig/files/patch-sql_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-sql_CMakeLists.txt	2013-06-09 16:54:38.000000000 +0200
@@ -0,0 +1,29 @@
+--- sql/CMakeLists.txt.orig	2013-05-22 01:09:51.000000000 +0300
++++ sql/CMakeLists.txt	2013-06-08 14:13:06.000000000 +0300
+@@ -268,6 +268,7 @@
+   VERBATIM
+   )
+ 
++IF(FALSE)
+ IF(INSTALL_LAYOUT STREQUAL "STANDALONE")
+ 
+ # Copy db.opt into data/test/
+@@ -311,6 +312,7 @@
+   INSTALL(FILES ${DUMMY_FILE} DESTINATION data/mysql COMPONENT DataFiles)
+ ENDIF(WIN32 AND MYSQLD_EXECUTABLE)
+ ENDIF(INSTALL_LAYOUT STREQUAL "STANDALONE")
++ENDIF()
+ 
+ IF(WIN32)
+   SET(my_bootstrap_sql ${CMAKE_CURRENT_BINARY_DIR}/my_bootstrap.sql)
+@@ -353,8 +355,10 @@
+   TARGET_LINK_LIBRARIES(mysql_upgrade_service mysys winservice)
+ ENDIF(WIN32)
+ 
++IF(FALSE)
+ INSTALL(DIRECTORY . DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Development
+   FILES_MATCHING PATTERN "*.h"
+   PATTERN examples EXCLUDE
+   PATTERN share EXCLUDE
+   PATTERN CMakeFiles EXCLUDE)
++ENDIF()
diff -ruN databases.orig/mariadb55-server.orig/files/patch-sql_item_subselect.cc databases/mariadb55-server.orig/files/patch-sql_item_subselect.cc
--- databases.orig/mariadb55-server.orig/files/patch-sql_item_subselect.cc	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-sql_item_subselect.cc	2013-10-01 00:32:28.000000000 +0200
@@ -0,0 +1,11 @@
+--- sql/item_subselect.cc.orig	2013-05-21 22:09:51.000000000 +0000
++++ sql/item_subselect.cc	2013-09-26 13:13:01.105197491 +0000
+@@ -1317,7 +1317,7 @@
+   Item_subselect()
+ {
+   DBUG_ENTER("Item_exists_subselect::Item_exists_subselect");
+-  bool val_bool();
++//  bool val_bool();
+   init(select_lex, new select_exists_subselect(this));
+   max_columns= UINT_MAX;
+   null_value= FALSE; //can't be NULL
diff -ruN databases.orig/mariadb55-server.orig/files/patch-sql_sql_trigger.cc databases/mariadb55-server.orig/files/patch-sql_sql_trigger.cc
--- databases.orig/mariadb55-server.orig/files/patch-sql_sql_trigger.cc	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-sql_sql_trigger.cc	2013-10-01 00:32:28.000000000 +0200
@@ -0,0 +1,50 @@
+--- sql/sql_trigger.cc.orig	2013-05-21 22:09:51.000000000 +0000
++++ sql/sql_trigger.cc	2013-09-26 13:15:55.450195525 +0000
+@@ -192,32 +192,32 @@
+ {
+   {
+     { C_STRING_WITH_LEN("triggers") },
+-    my_offsetof(class Table_triggers_list, definitions_list),
++    static_cast<int>(my_offsetof(class Table_triggers_list, definitions_list)),
+     FILE_OPTIONS_STRLIST
+   },
+   {
+     { C_STRING_WITH_LEN("sql_modes") },
+-    my_offsetof(class Table_triggers_list, definition_modes_list),
++    static_cast<int>(my_offsetof(class Table_triggers_list, definition_modes_list)),
+     FILE_OPTIONS_ULLLIST
+   },
+   {
+     { C_STRING_WITH_LEN("definers") },
+-    my_offsetof(class Table_triggers_list, definers_list),
++    static_cast<int>(my_offsetof(class Table_triggers_list, definers_list)),
+     FILE_OPTIONS_STRLIST
+   },
+   {
+     { C_STRING_WITH_LEN("client_cs_names") },
+-    my_offsetof(class Table_triggers_list, client_cs_names),
++    static_cast<int>(my_offsetof(class Table_triggers_list, client_cs_names)),
+     FILE_OPTIONS_STRLIST
+   },
+   {
+     { C_STRING_WITH_LEN("connection_cl_names") },
+-    my_offsetof(class Table_triggers_list, connection_cl_names),
++    static_cast<int>(my_offsetof(class Table_triggers_list, connection_cl_names)),
+     FILE_OPTIONS_STRLIST
+   },
+   {
+     { C_STRING_WITH_LEN("db_cl_names") },
+-    my_offsetof(class Table_triggers_list, db_cl_names),
++    static_cast<int>(my_offsetof(class Table_triggers_list, db_cl_names)),
+     FILE_OPTIONS_STRLIST
+   },
+   { { 0, 0 }, 0, FILE_OPTIONS_STRING }
+@@ -226,7 +226,7 @@
+ File_option sql_modes_parameters=
+ {
+   { C_STRING_WITH_LEN("sql_modes") },
+-  my_offsetof(class Table_triggers_list, definition_modes_list),
++  static_cast<int>(my_offsetof(class Table_triggers_list, definition_modes_list)),
+   FILE_OPTIONS_ULLLIST
+ };
+ 
diff -ruN databases.orig/mariadb55-server.orig/files/patch-sql_sql_view.cc databases/mariadb55-server.orig/files/patch-sql_sql_view.cc
--- databases.orig/mariadb55-server.orig/files/patch-sql_sql_view.cc	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-sql_sql_view.cc	2013-10-01 00:32:28.000000000 +0200
@@ -0,0 +1,63 @@
+--- sql/sql_view.cc.orig	2013-05-21 22:09:51.000000000 +0000
++++ sql/sql_view.cc	2013-09-26 13:16:16.065195172 +0000
+@@ -742,46 +742,46 @@
+ */
+ static File_option view_parameters[]=
+ {{{ C_STRING_WITH_LEN("query")},
+-  my_offsetof(TABLE_LIST, select_stmt),
++  static_cast<int>(my_offsetof(TABLE_LIST, select_stmt)),
+   FILE_OPTIONS_ESTRING},
+  {{ C_STRING_WITH_LEN("md5")},
+-  my_offsetof(TABLE_LIST, md5),
++  static_cast<int>(my_offsetof(TABLE_LIST, md5)),
+   FILE_OPTIONS_STRING},
+  {{ C_STRING_WITH_LEN("updatable")},
+-  my_offsetof(TABLE_LIST, updatable_view),
++  static_cast<int>(my_offsetof(TABLE_LIST, updatable_view)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("algorithm")},
+-  my_offsetof(TABLE_LIST, algorithm),
++  static_cast<int>(my_offsetof(TABLE_LIST, algorithm)),
+   FILE_OPTIONS_VIEW_ALGO},
+  {{ C_STRING_WITH_LEN("definer_user")},
+-  my_offsetof(TABLE_LIST, definer.user),
++  static_cast<int>(my_offsetof(TABLE_LIST, definer.user)),
+   FILE_OPTIONS_STRING},
+  {{ C_STRING_WITH_LEN("definer_host")},
+-  my_offsetof(TABLE_LIST, definer.host),
++  static_cast<int>(my_offsetof(TABLE_LIST, definer.host)),
+   FILE_OPTIONS_STRING},
+  {{ C_STRING_WITH_LEN("suid")},
+-  my_offsetof(TABLE_LIST, view_suid),
++  static_cast<int>(my_offsetof(TABLE_LIST, view_suid)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("with_check_option")},
+-  my_offsetof(TABLE_LIST, with_check),
++  static_cast<int>(my_offsetof(TABLE_LIST, with_check)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("timestamp")},
+-  my_offsetof(TABLE_LIST, timestamp),
++  static_cast<int>(my_offsetof(TABLE_LIST, timestamp)),
+   FILE_OPTIONS_TIMESTAMP},
+  {{ C_STRING_WITH_LEN("create-version")},
+-  my_offsetof(TABLE_LIST, file_version),
++  static_cast<int>(my_offsetof(TABLE_LIST, file_version)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("source")},
+-  my_offsetof(TABLE_LIST, source),
++  static_cast<int>(my_offsetof(TABLE_LIST, source)),
+   FILE_OPTIONS_ESTRING},
+  {{(char*) STRING_WITH_LEN("client_cs_name")},
+-  my_offsetof(TABLE_LIST, view_client_cs_name),
++  static_cast<int>(my_offsetof(TABLE_LIST, view_client_cs_name)),
+   FILE_OPTIONS_STRING},
+  {{(char*) STRING_WITH_LEN("connection_cl_name")},
+-  my_offsetof(TABLE_LIST, view_connection_cl_name),
++  static_cast<int>(my_offsetof(TABLE_LIST, view_connection_cl_name)),
+   FILE_OPTIONS_STRING},
+  {{(char*) STRING_WITH_LEN("view_body_utf8")},
+-  my_offsetof(TABLE_LIST, view_body_utf8),
++  static_cast<int>(my_offsetof(TABLE_LIST, view_body_utf8)),
+   FILE_OPTIONS_ESTRING},
+  {{NullS, 0},			0,
+   FILE_OPTIONS_STRING}
diff -ruN databases.orig/mariadb55-server.orig/files/patch-sql_sys_vars.cc databases/mariadb55-server.orig/files/patch-sql_sys_vars.cc
--- databases.orig/mariadb55-server.orig/files/patch-sql_sys_vars.cc	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-sql_sys_vars.cc	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,38 @@
+--- sql/sys_vars.cc.orig	2012-06-15 17:03:32.000000000 +0200
++++ sql/sys_vars.cc	2012-06-15 17:16:23.000000000 +0200
+@@ -900,7 +900,7 @@
+        "connection before closing it",
+        SESSION_VAR(net_interactive_timeout),
+        CMD_LINE(REQUIRED_ARG),
+-       VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_WAIT_TIMEOUT), BLOCK_SIZE(1));
++       VALID_RANGE(1, INT_MAX32/1000), DEFAULT(NET_WAIT_TIMEOUT), BLOCK_SIZE(1));
+ 
+ static Sys_var_ulong Sys_join_buffer_size(
+        "join_buffer_size",
+@@ -1401,7 +1401,7 @@
+        "Number of seconds to wait for more data from a connection before "
+        "aborting the read",
+        SESSION_VAR(net_read_timeout), CMD_LINE(REQUIRED_ARG),
+-       VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_READ_TIMEOUT), BLOCK_SIZE(1),
++       VALID_RANGE(1, INT_MAX32/1000), DEFAULT(NET_READ_TIMEOUT), BLOCK_SIZE(1),
+        NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+        ON_UPDATE(fix_net_read_timeout));
+ 
+@@ -1416,7 +1416,7 @@
+        "Number of seconds to wait for a block to be written to a connection "
+        "before aborting the write",
+        SESSION_VAR(net_write_timeout), CMD_LINE(REQUIRED_ARG),
+-       VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_WRITE_TIMEOUT), BLOCK_SIZE(1),
++       VALID_RANGE(1, INT_MAX32/1000), DEFAULT(NET_WRITE_TIMEOUT), BLOCK_SIZE(1),
+        NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+        ON_UPDATE(fix_net_write_timeout));
+ 
+@@ -2257,7 +2257,7 @@
+        "The number of seconds the server waits for activity on a "
+        "connection before closing it",
+        SESSION_VAR(net_wait_timeout), CMD_LINE(REQUIRED_ARG),
+-       VALID_RANGE(1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT)),
++       VALID_RANGE(1, INT_MAX32/1000),
+        DEFAULT(NET_WAIT_TIMEOUT), BLOCK_SIZE(1));
+ 
+ /** propagates changes to the relevant flag of @@optimizer_switch */
diff -ruN databases.orig/mariadb55-server.orig/files/patch-support-files_CMakeLists.txt databases/mariadb55-server.orig/files/patch-support-files_CMakeLists.txt
--- databases.orig/mariadb55-server.orig/files/patch-support-files_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/files/patch-support-files_CMakeLists.txt	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,15 @@
+--- support-files/CMakeLists.txt.orig	2012-11-28 17:49:47.000000000 +0200
++++ support-files/CMakeLists.txt	2012-12-23 05:40:39.000000000 +0200
+@@ -66,10 +66,11 @@
+   ENDFOREACH()
+   IF(INSTALL_SUPPORTFILESDIR)
+     INSTALL(FILES magic DESTINATION ${inst_location} COMPONENT SupportFiles)
+-    INSTALL(DIRECTORY RHEL4-SElinux/ DESTINATION ${inst_location}/SELinux/RHEL4 COMPONENT SupportFiles)
+   ENDIF()
+ 
++IF(FALSE)
+   INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
++ENDIF()
+   CONFIGURE_FILE(MySQL-shared-compat.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/MySQL-shared-compat.spec @ONLY)
+   CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.spec @ONLY)
+   
diff -ruN databases.orig/mariadb55-server.orig/pkg-descr databases/mariadb55-server.orig/pkg-descr
--- databases.orig/mariadb55-server.orig/pkg-descr	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/pkg-descr	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,14 @@
+MariaDB is a database server that offers drop-in replacement functionality for
+MySQL1. MariaDB is built by some of the original authors of MySQL, with
+assistance from the broader community of Free and open source software
+developers. In addition to the core functionality of MySQL, MariaDB offers a
+rich set of feature enhancements including alternate storage engines, server
+optimizations, and patches.
+
+MariaDB is primarily driven by developers at Monty Program, a company founded by
+Michael "Monty" Widenius, the original author of MySQL, but this is not the
+whole story about MariaDB. On the "About MariaDB" page you will find more
+information about all participants in the MariaDB community, including storage
+engines XtraDB and PBXT.
+
+WWW: http://mariadb.org/
diff -ruN databases.orig/mariadb55-server.orig/pkg-message databases/mariadb55-server.orig/pkg-message
--- databases.orig/mariadb55-server.orig/pkg-message	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/pkg-message	2013-01-05 12:30:51.000000000 +0100
@@ -0,0 +1,7 @@
+************************************************************************
+
+Remember to run mysql_upgrade (with the optional --datadir=<dbdir> flag)
+the first time you start the MySQL server after an upgrade from an
+earlier version.
+
+************************************************************************
diff -ruN databases.orig/mariadb55-server.orig/pkg-plist databases/mariadb55-server.orig/pkg-plist
--- databases.orig/mariadb55-server.orig/pkg-plist	1970-01-01 01:00:00.000000000 +0100
+++ databases/mariadb55-server.orig/pkg-plist	2013-10-01 00:32:28.000000000 +0200
@@ -0,0 +1,185 @@
+@stopdaemon mysql-server
+bin/aria_chk
+bin/aria_dump_log
+bin/aria_ftdump
+bin/aria_pack
+bin/aria_read_log
+bin/innochecksum
+bin/my_print_defaults
+bin/myisam_ftdump
+bin/myisamchk
+bin/myisamlog
+bin/myisampack
+bin/mysql_convert_table_format
+bin/mysql_fix_extensions
+bin/mysql_install_db
+bin/mysql_plugin
+bin/mysql_secure_installation
+bin/mysql_setpermission
+bin/mysql_tzinfo_to_sql
+bin/mysql_upgrade
+bin/mysql_zap
+bin/mysqlbug
+bin/mysqld_multi
+bin/mysqld_safe
+bin/mysqldumpslow
+bin/mysqlhotcopy
+bin/mysqltest
+bin/perror
+bin/replace
+bin/resolve_stack_dump
+bin/resolveip
+lib/mysql/libmysqld.a
+lib/mysql/libmysqld.so
+lib/mysql/libmysqld.so.18
+lib/mysql/plugin/adt_null.so
+lib/mysql/plugin/auth_0x0100.so
+lib/mysql/plugin/auth_pam.so
+lib/mysql/plugin/auth_test_plugin.so
+lib/mysql/plugin/daemon_example.ini
+lib/mysql/plugin/dialog.so
+lib/mysql/plugin/dialog_examples.so
+lib/mysql/plugin/feedback.so
+lib/mysql/plugin/ha_archive.so
+lib/mysql/plugin/ha_blackhole.so
+lib/mysql/plugin/ha_federated.so
+lib/mysql/plugin/ha_federatedx.so
+lib/mysql/plugin/ha_innodb.so
+%%OQGRAPH%%lib/mysql/plugin/ha_oqgraph.so
+lib/mysql/plugin/ha_sphinx.so
+lib/mysql/plugin/handlersocket.so
+lib/mysql/plugin/libdaemon_example.so
+lib/mysql/plugin/mypluglib.so
+lib/mysql/plugin/mysql_clear_password.so
+lib/mysql/plugin/qa_auth_client.so
+lib/mysql/plugin/qa_auth_interface.so
+lib/mysql/plugin/qa_auth_server.so
+lib/mysql/plugin/query_cache_info.so
+lib/mysql/plugin/semisync_master.so
+lib/mysql/plugin/semisync_slave.so
+lib/mysql/plugin/sphinx.so
+lib/mysql/plugin/sql_errlog.so
+libexec/mysqld
+man/man1/innochecksum.1.gz
+man/man1/my_print_defaults.1.gz
+man/man1/myisam_ftdump.1.gz
+man/man1/myisamchk.1.gz
+man/man1/myisamlog.1.gz
+man/man1/myisampack.1.gz
+man/man1/mysql.server.1.gz
+man/man1/mysql_convert_table_format.1.gz
+man/man1/mysql_fix_extensions.1.gz
+man/man1/mysql_install_db.1.gz
+man/man1/mysql_secure_installation.1.gz
+man/man1/mysql_setpermission.1.gz
+man/man1/mysql_tzinfo_to_sql.1.gz
+man/man1/mysql_upgrade.1.gz
+man/man1/mysql_zap.1.gz
+man/man1/mysqlbug.1.gz
+man/man1/mysqld_multi.1.gz
+man/man1/mysqld_safe.1.gz
+man/man1/mysqldumpslow.1.gz
+man/man1/mysqlhotcopy.1.gz
+man/man1/mysqlman.1.gz
+man/man1/mysqltest.1.gz
+man/man1/perror.1.gz
+man/man1/replace.1.gz
+man/man1/resolve_stack_dump.1.gz
+man/man1/resolveip.1.gz
+man/man8/mysqld.8.gz
+%%DATADIR%%/binary-configure
+%%DATADIR%%/charsets/Index.xml
+%%DATADIR%%/charsets/README
+%%DATADIR%%/charsets/armscii8.xml
+%%DATADIR%%/charsets/ascii.xml
+%%DATADIR%%/charsets/cp1250.xml
+%%DATADIR%%/charsets/cp1251.xml
+%%DATADIR%%/charsets/cp1256.xml
+%%DATADIR%%/charsets/cp1257.xml
+%%DATADIR%%/charsets/cp850.xml
+%%DATADIR%%/charsets/cp852.xml
+%%DATADIR%%/charsets/cp866.xml
+%%DATADIR%%/charsets/dec8.xml
+%%DATADIR%%/charsets/geostd8.xml
+%%DATADIR%%/charsets/greek.xml
+%%DATADIR%%/charsets/hebrew.xml
+%%DATADIR%%/charsets/hp8.xml
+%%DATADIR%%/charsets/keybcs2.xml
+%%DATADIR%%/charsets/koi8r.xml
+%%DATADIR%%/charsets/koi8u.xml
+%%DATADIR%%/charsets/latin1.xml
+%%DATADIR%%/charsets/latin2.xml
+%%DATADIR%%/charsets/latin5.xml
+%%DATADIR%%/charsets/latin7.xml
+%%DATADIR%%/charsets/macce.xml
+%%DATADIR%%/charsets/macroman.xml
+%%DATADIR%%/charsets/swe7.xml
+%%DATADIR%%/config.huge.ini
+%%DATADIR%%/config.medium.ini
+%%DATADIR%%/config.small.ini
+%%DATADIR%%/czech/errmsg.sys
+%%DATADIR%%/danish/errmsg.sys
+%%DATADIR%%/dutch/errmsg.sys
+%%DATADIR%%/english/errmsg.sys
+%%DATADIR%%/errmsg-utf8.txt
+%%DATADIR%%/estonian/errmsg.sys
+%%DATADIR%%/fill_help_tables.sql
+%%DATADIR%%/french/errmsg.sys
+%%DATADIR%%/german/errmsg.sys
+%%DATADIR%%/greek/errmsg.sys
+%%DATADIR%%/hungarian/errmsg.sys
+%%DATADIR%%/italian/errmsg.sys
+%%DATADIR%%/japanese/errmsg.sys
+%%DATADIR%%/korean/errmsg.sys
+%%DATADIR%%/magic
+%%DATADIR%%/my-huge.cnf
+%%DATADIR%%/my-innodb-heavy-4G.cnf
+%%DATADIR%%/my-large.cnf
+%%DATADIR%%/my-medium.cnf
+%%DATADIR%%/my-small.cnf
+%%DATADIR%%/mysql-log-rotate
+%%DATADIR%%/mysql.server
+%%DATADIR%%/mysql_performance_tables.sql
+%%DATADIR%%/mysql_system_tables.sql
+%%DATADIR%%/mysql_system_tables_data.sql
+%%DATADIR%%/mysql_test_data_timezone.sql
+%%DATADIR%%/mysqld_multi.server
+%%DATADIR%%/ndb-config-2-node.ini
+%%DATADIR%%/norwegian-ny/errmsg.sys
+%%DATADIR%%/norwegian/errmsg.sys
+%%DATADIR%%/polish/errmsg.sys
+%%DATADIR%%/portuguese/errmsg.sys
+%%DATADIR%%/romanian/errmsg.sys
+%%DATADIR%%/russian/errmsg.sys
+%%DATADIR%%/serbian/errmsg.sys
+%%DATADIR%%/slovak/errmsg.sys
+%%DATADIR%%/spanish/errmsg.sys
+%%DATADIR%%/swedish/errmsg.sys
+%%DATADIR%%/ukrainian/errmsg.sys
+@dirrm %%DATADIR%%/ukrainian
+@dirrm %%DATADIR%%/swedish
+@dirrm %%DATADIR%%/spanish
+@dirrm %%DATADIR%%/slovak
+@dirrm %%DATADIR%%/serbian
+@dirrm %%DATADIR%%/russian
+@dirrm %%DATADIR%%/romanian
+@dirrm %%DATADIR%%/portuguese
+@dirrm %%DATADIR%%/polish
+@dirrm %%DATADIR%%/norwegian-ny
+@dirrm %%DATADIR%%/norwegian
+@dirrm %%DATADIR%%/korean
+@dirrm %%DATADIR%%/japanese
+@dirrm %%DATADIR%%/italian
+@dirrm %%DATADIR%%/hungarian
+@dirrm %%DATADIR%%/greek
+@dirrm %%DATADIR%%/german
+@dirrm %%DATADIR%%/french
+@dirrm %%DATADIR%%/estonian
+@dirrm %%DATADIR%%/english
+@dirrm %%DATADIR%%/dutch
+@dirrm %%DATADIR%%/danish
+@dirrm %%DATADIR%%/czech
+@dirrm %%DATADIR%%/charsets
+@dirrm %%DATADIR%%
+@dirrm lib/mysql/plugin
+@dirrm lib/mysql