[buildout]
parts = apache-php

extends =
  ../apache/buildout.cfg
  ../bzip2/buildout.cfg
  ../cclient/buildout.cfg
  ../curl/buildout.cfg
  ../freetype/buildout.cfg
  ../gettext/buildout.cfg
  ../libiconv/buildout.cfg
  ../libjpeg/buildout.cfg
  ../libpng/buildout.cfg
  ../libtool/buildout.cfg
  ../mariadb/buildout.cfg
  ../openldap/buildout.cfg
  ../pkgconfig/buildout.cfg
  ../zlib/buildout.cfg
  ../libzip/buildout.cfg
  ../autoconf/buildout.cfg
  ../automake/buildout.cfg
  ../imagemagick/buildout.cfg
  ../icu/buildout.cfg
  ../openssl/buildout.cfg

[php-redis]
recipe = slapos.recipe.cmmi
url = https://github.com/phpredis/phpredis/archive/5.0.0.tar.gz
md5sum = 4f11e0567a10c29394aae52a4fa8bb40
configure-command = 
  phpize && ./configure
environment =
  PATH=${autoconf:location}/bin:${automake:location}/bin:${m4:location}/bin:${apache-php:location}/bin:%(PATH)s

[php-imagick]
recipe = slapos.recipe.cmmi
url = https://github.com/Imagick/imagick/archive/3.4.4.tar.gz
md5sum = ef6cbadd834eb306bd91874a8f5dea03
configure-command = 
  phpize && ./configure
configure-options =
  --prefix=${buildout:parts-directory}/${:_buildout_section_name_}
environment =
  PKG_CONFIG_PATH=${imagemagick:location}/lib/pkgconfig
  PATH=${pkgconfig:location}/bin:${imagemagick:location}/bin:${autoconf:location}/bin:${automake:location}/bin:${m4:location}/bin:${apache-php:location}/bin:%(PATH)s
  IM_IMAGEMAGICK_PREFIX=${imagemagick:location}

[php-apcu]
recipe = slapos.recipe.cmmi
url = https://github.com/krakjoe/apcu/archive/v5.1.17.tar.gz
md5sum = f64b6cd5108aea63df2d5cc301c58b2b
configure-command = 
  phpize && ./configure
configure-options =
  --with-php-config=${apache-php:location}/bin/php-config
environment =
  PATH=${autoconf:location}/bin:${automake:location}/bin:${m4:location}/bin:${apache-php:location}/bin:%(PATH)s

[apache-php]
# Note: Shall react on each build of apache and reinstall itself
recipe = slapos.recipe.cmmi
url = https://www.php.net/distributions/php-7.3.6.tar.bz2
md5sum = bde9a912fb311182cd460dad1abbc247
configure-options =
  --prefix=${buildout:parts-directory}/${:_buildout_section_name_}
  --with-apxs2=${apache:location}/bin/apxs
  --with-libxml-dir=${libxml2:location}
  --with-mysql=${mariadb:location}
  --with-zlib-dir=${zlib:location}
  --with-bz2=${bzip2:location}
  --with-mcrypt=${libmcrypt:location}
  --with-gd
  --with-jpeg-dir=${libjpeg:location}
  --with-png-dir=${libpng:location}
  --enable-gd-native-ttf
  --with-freetype-dir=${freetype:location}
  --with-pdo-mysql=mysqlnd
  --with-mysqli=mysqlnd
  --with-curl=${curl:location}
  --with-imap=${cclient:location}
  --with-iconv-dir=${libiconv:location}
  --with-gettext=${gettext:location}
  --with-ldap=${openldap:location}
  --with-imap-ssl
  --with-openssl=${openssl:location}
  --with-libzip=${libzip:location}
  --with-icu-dir=${icu:location}
  --enable-apcu-bc
  --enable-intl
  --enable-libxml
  --enable-json
  --enable-mbstring
  --enable-pcntl
  --enable-session
  --enable-exif
  --enable-ftp
  --enable-zip
  --disable-zend-test
  --disable-static

# Changing TMPDIR is required for PEAR installation.
# It will create a pear/temp directory under the SR instead of a shared /tmp/pear/temp.
# XXX we could mkdir tmp there

environment =
  PKG_CONFIG_PATH=${libxml2:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig:${libzip:location}/lib/pkgconfig
  PATH=${pkgconfig:location}/bin:${bzip2:location}/bin:${libxml2:location}/bin:%(PATH)s
  CPPFLAGS=-I${libzip:location}/include
  LDFLAGS=-L${bzip2:location}/lib -Wl,-rpath -Wl,${bzip2:location}/lib -Wl,-rpath -Wl,${curl:location}/lib -L${libtool:location}/lib -Wl,-rpath -Wl,${libtool:location}/lib -L${mariadb:location}/lib -Wl,-rpath -Wl,${mariadb:location}/lib -L${zlib:location}/lib -Wl,-rpath -Wl,${zlib:location}/lib -L${libmcrypt:location}/lib -Wl,-rpath -Wl,${libmcrypt:location}/libblkid -L${libzip:location}/lib -Wl,-rpath -Wl,${libzip:location}/lib
  TMPDIR=${buildout:parts-directory}/${:_buildout_section_name_}
  HOME=${apache:location}



[apache-php-postgres]
# Note: Shall react on each build of apache and reinstall itself
recipe = slapos.recipe.cmmi
url = http://fr2.php.net/distributions/php-5.4.12.tar.bz2
md5sum = 5c7b614242ae12e9cacca21c8ab84818
configure-options =
  --with-apxs2=${apache:location}/bin/apxs
  --with-libxml-dir=${libxml2:location}
  --with-zlib-dir=${zlib:location}
  --with-bz2=${bzip2:location}
  --with-mcrypt=${libmcrypt:location}
  --with-gd
  --with-jpeg-dir=${libjpeg:location}
  --with-png-dir=${libpng:location}
  --enable-gd-native-ttf
  --with-freetype-dir=${freetype:location}
  --with-curl=${curl:location}
  --with-imap=${cclient:location}
  --with-iconv-dir=${libiconv:location}
  --with-gettext=${gettext:location}
  --with-ldap=${openldap:location}
  --with-imap-ssl
  --with-openssl=${openssl:location}
  --enable-libxml
  --enable-mbstring
  --enable-session
  --enable-exif
  --enable-zip
  --enable-ftp
  --with-pgsql=${postgresql:location}

# Changing TMPDIR is required for PEAR installation.
# It will create a pear/temp directory under the SR instead of a shared /tmp/pear/temp.
# XXX we could mkdir tmp there

environment =
  PKG_CONFIG_PATH=${libxml2:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig
  PATH=${pkgconfig:location}/bin:${bzip2:location}/bin:${libxml2:location}/bin:%(PATH)s
  LDFLAGS =-L${bzip2:location}/lib -Wl,-rpath -Wl,${bzip2:location}/lib -L${libtool:location}/lib -Wl,-rpath -Wl,${libtool:location}/lib -L${zlib:location}/lib -Wl,-rpath -Wl,${zlib:location}/lib -L${libmcrypt:location}/lib -Wl,-rpath -Wl,${libmcrypt:location}/libblkid
  TMPDIR=${buildout:parts-directory}/${:_buildout_section_name_}
  HOME=${apache:location}



[libmcrypt]
recipe = slapos.recipe.cmmi
url = http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.bz2
md5sum = c4f491dd411a09e9de3b8702ea6f73eb

[xml-rpc]
recipe = slapos.recipe.cmmi
url = http://downloads.sourceforge.net/project/phpxmlrpc/phpxmlrpc/2.2.2/xmlrpc-2.2.2.tar.gz
md5sum = 59a644c636c6d98267d0c99b406ae9e8