# MariaDB - a database server that offers drop-in replacement functionality for MySQL.
# http://mariadb.org/

[buildout]
extends =
  ../zlib/buildout.cfg
  ../groonga/buildout.cfg
  ../libevent/buildout.cfg
  ../ncurses/buildout.cfg
  ../pkgconfig/buildout.cfg
  ../readline/buildout.cfg

parts =
  mariadb

[mariadb-no_test-patch]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
md5sum = d65f61829cfbcd5062f49db2b00bd6fe
filename = mysql_create_system_tables__no_test.patch
download-only = true

[mariadb]
recipe = hexagonit.recipe.cmmi
version = 5.3.3-rc
url = http://downloads.askmonty.org/f/mariadb-${:version}/kvm-tarbake-jaunty-x86/mariadb-${:version}.tar.gz/from/http:/ftp.osuosl.org/pub/mariadb
md5sum = 715c61bb101acc7d37e893f6a9de9267
# compile directory is required to build mysql plugins.
keep-compile-dir = true
# configure: how to avoid searching for my.cnf?
#  - like in mysql part in http://svn.zope.org/zodbshootout/trunk/buildout.cfg?view=markup
# we use embeded yassl instead of openssl to avoid compilation errors on sphinx search engine.
configure-options =
  --prefix=${buildout:parts-directory}/${:_buildout_section_name_}
  --disable-static
  --enable-thread-safe-client
  --enable-local-infile
  --enable-assembler
  --with-pic
  --with-fast-mutexes
  --with-charset=utf8
  --with-extra-charsets=complex
  --with-collation=utf8_unicode_ci
  --with-big-tables
  --with-embedded-server
  --with-plugins=max-no-ndb
  --with-aria-tmp-tables
  --without-plugin-innodb_plugin
  --without-plugin-oqgraph
  --without-readline
  --with-ssl
  --with-libevent=${libevent:location}
  --with-zlib-dir=${zlib:location}

patch-options = -p0
patches =
  ${mariadb-no_test-patch:location}/${mariadb-no_test-patch:filename}
environment =
  CPPFLAGS=-I${ncurses:location}/include -I${readline5:location}/include
  LDFLAGS=-Wl,-rpath=${libevent:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${readline5:location}/lib -Wl,-rpath=${readline5:location}/lib -Wl,-rpath=${zlib:location}/lib

[mroonga-mariadb]
recipe = hexagonit.recipe.cmmi
url = https://github.com/downloads/mroonga/mroonga/mroonga-1.11.tar.gz
md5sum = 69e56246226e0b9969ee7f99e08aa7da
configure-options =
  --with-mysql-source=${mariadb:location}__compile__/mariadb-${mariadb:version}
  --with-mysql-config=${mariadb:location}/bin/mysql_config
environment =
  PATH=${groonga:location}/bin:${pkgconfig:location}/bin:%(PATH)s
  CPPFLAGS=-I${groonga:location}/include/groonga
  LDFLAGS=-L${groonga:location}/lib
  PKG_CONFIG_PATH=${groonga:location}/lib/pkgconfig