[buildout]
extends =
  ../mysql-tritonn-5.0/buildout.cfg
  ../mariadb/buildout.cfg
  ../patch/buildout.cfg
  ../perl-Devel-CheckLib/buildout.cfg

parts =
  perl-DBD-MySQL

[perl-DBD-MySQL-common]
recipe = slapos.recipe.cmmi
depends =
  ${perl-DBI:location}
  ${perl-Devel-CheckLib:location}
url = http://www.cpan.org/modules/by-module/DBD/DBD-mysql-4.042.tar.gz
md5sum = a144bd950b55af68835d44bc4ea6e5aa
patches =
  ${:_profile_base_location_}/DBD-mysql-4.027.rpathsupport.patch#a932982b7725e6621cfce3a3d7917e03
  ${:_profile_base_location_}/DBD-mysql-4.042.mariadb.patch#5864d36d19c4a05034b3a4873f7c659a
patch-options = -p1
configure-command =
  ${perl:location}/bin/perl Makefile.PL --libs="-L${zlib:location}/lib -L${openssl:location}/lib $(mysql_config --libs)"

[perl-DBD-MySQL]
<= perl-DBD-MySQL-common
environment =
  OTHERLDFLAGS=-Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${mysql-tritonn-5.0:location}/lib/mysql -Wl,-rpath=${openssl:location}/lib
  PATH=${mysql-tritonn-5.0:location}/bin:${patch:location}/bin:%(PATH)s

[perl-DBD-mariadb]
<= perl-DBD-MySQL-common
environment =
  OTHERLDFLAGS=-Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${mariadb:location}/lib -Wl,-rpath=${openssl:location}/lib
  PATH=${mariadb:location}/bin:${patch:location}/bin:%(PATH)s
