# 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]
recipe = slapos.recipe.cmmi
version = 10.0.11
revision = 1
url = https://downloads.mariadb.org/f/mariadb-${:version}/source/mariadb-${:version}.tar.gz/from/http:/ftp.osuosl.org/pub/mariadb
md5sum = faa2ea3f9c6f7bc5f021d299367a7a8d
# compile directory is required to build mysql plugins.
keep-compile-dir = true
patch-options = -p0
patches =
  ${:_profile_base_location_}/mariadb_10.0.8_create_system_tables__no_test.patch#a176d491cf45fccd53ee397c70393bc4
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 -Wl,-rpath=${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-4.02.tar.gz
md5sum = aebd30a3cec90182ee474693216ac1dc
configure-options =
  --with-mysql-source=${mariadb:location}__compile__/mariadb-${mariadb:version}
  --with-mysql-config=${mariadb:location}/bin/mysql_config
  --disable-static
  --disable-document
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
  LDFLAGS=-L${groonga:location}/lib
  PKG_CONFIG_PATH=${groonga:location}/lib/pkgconfig:${groonga-normalizer-mysql:location}/lib/pkgconfig