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

[buildout]
extends =
  ../cmake/buildout.cfg
  ../zlib/buildout.cfg
  ../groonga/buildout.cfg
  ../libaio/buildout.cfg
  ../libevent/buildout.cfg
  ../ncurses/buildout.cfg
  ../openssl/buildout.cfg
  ../pkgconfig/buildout.cfg
  ../readline/buildout.cfg
  ../libxml2/buildout.cfg

parts =
  mariadb

[mariadb-10.0.5-no_test-patch]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
md5sum = acc065292320f0c2805ce6bbdc3af0b5
filename = mariadb_10.0.5_create_system_tables__no_test.patch
download-only = true

[mariadb]
recipe = slapos.recipe.cmmi
version = 10.0.5
revision = 1
url = http://downloads.askmonty.org/f/mariadb-${:version}/kvm-tarbake-jaunty-x86/mariadb-${:version}.tar.gz/from/http://ftp.osuosl.org/pub/mariadb
md5sum = 299fd67d5f193ac30a30a60b579d8bec
# compile directory is required to build mysql plugins.
keep-compile-dir = true
patch-options = -p0
patches =
  ${mariadb-10.0.5-no_test-patch:location}/${mariadb-10.0.5-no_test-patch:filename}
configure-command = ${cmake:location}/bin/cmake
configure-options =
  -DCMAKE_INSTALL_PREFIX=${buildout:parts-directory}/${:_buildout_section_name_}
  -DBUILD_CONFIG=mysql_release
  -DDEFAULT_CHARSET=utf8
  -DDEFAULT_COLLATION=utf8_unicode_ci
  -DWITH_SSL=system
  -DWITH_ZLIB=system
  -DWITH_READLINE=0
  -DWITH_PIC=1
  -DENABLE_DTRACE=0
  -DWITH_EXTRA_CHARSETS=complex
  -DWITH_EMBEDDED_SERVER=0
  -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1
  -DWITHOUT_DAEMON_EXAMPLE=1
  -DCMAKE_C_FLAGS="-I${libaio:location}/include -I${libxml2:location}/include -I${ncurses:location}/include -I${openssl:location}/include -I${readline5:location}/include -I${zlib:location}/include"
  -DCMAKE_CXX_FLAGS="-I${libaio:location}/include -I${libxml2:location}/include -I${ncurses:location}/include -I${openssl:location}/include -I${readline5:location}/include -I${zlib:location}/include"
  -DCMAKE_INSTALL_RPATH=${libaio:location}/lib:${libxml2:location}/lib:${ncurses:location}/lib:${openssl:location}/lib:${readline5:location}/lib:${zlib:location}/lib
environment =
  CMAKE_PROGRAM_PATH=${cmake:location}/bin
  CMAKE_INCLUDE_PATH=${libaio:location}/include:${libxml2:location}/include:${ncurses:location}/include:${openssl:location}/include:${readline5:location}/include:${zlib:location}/include
  CMAKE_LIBRARY_PATH=${libaio:location}/lib:${libxml2:location}/lib:${ncurses:location}/lib:${openssl:location}/lib:${readline5:location}/lib:${zlib:location}/lib
  LDFLAGS=-L${libaio:location}/lib -L${zlib:location}/lib

[mroonga-mariadb]
# mroonga - a storage engine for MySQL. It provides fast fulltext search feature to all MySQL users.
# http://mroonga.github.com/
recipe = slapos.recipe.cmmi
url = http://packages.groonga.org/source/mroonga/mroonga-3.09.tar.gz
md5sum = bdcd1d86185a64520881d33e12b7d7a7
configure-options =
  --with-mysql-source=${mariadb:location}__compile__/mariadb-${mariadb:version}
  --with-mysql-config=${mariadb:location}/bin/mysql_config
depends =
  ${mariadb:version}
  ${mariadb:revision}
  ${groonga-normalizer-mysql:version}
environment =
  PATH=${groonga:location}/bin:${pkgconfig:location}/bin:%(PATH)s
  CPPFLAGS=-I${groonga:location}/include/groonga -I${mariadb:location}__compile__/mariadb-${mariadb:version}/pcre
  LDFLAGS=-L${groonga:location}/lib
  PKG_CONFIG_PATH=${groonga:location}/lib/pkgconfig:${groonga-normalizer-mysql:location}/lib/pkgconfig