[buildout]
parts =
  apache
  apache-antiloris

extends =
  ../libexpat/buildout.cfg
  ../libuuid/buildout.cfg
  ../gdbm/buildout.cfg
  ../openssl/buildout.cfg
  ../pcre/buildout.cfg
  ../pkgconfig/buildout.cfg
  ../sqlite3/buildout.cfg
  ../zlib/buildout.cfg

[apr]
recipe = hexagonit.recipe.download
version = 1.5.0
url = http://mir2.ovh.net/ftp.apache.org/dist/apr/apr-${:version}.tar.bz2
md5sum = cc93bd2c12d0d037f68e21cc6385dc31

[apr-util]
recipe = hexagonit.recipe.download
version = 1.5.3
url = http://mir2.ovh.net/ftp.apache.org/dist/apr/apr-util-${:version}.tar.bz2
md5sum = 6f3417691c7a27090f36e7cf4d94b36e

[apache]
# inspired on http://old.aclark.net/team/aclark/blog/a-lamp-buildout-for-wordpress-and-other-php-apps/
recipe = slapos.recipe.cmmi
depends =
  ${gdbm:version}
version = 2.4.9
revision = 1
url = http://mir2.ovh.net/ftp.apache.org/dist/httpd/httpd-${:version}.tar.bz2
md5sum = 2ef4e65353497606b24fa9bb3e5a3c40
configure-command = cp -ar ${apr:location}/apr-${apr:version} srclib/apr/; cp -ar ${apr-util:location}/apr-util-${apr-util:version} srclib/apr-util; ./configure
configure-options = --prefix=${buildout:parts-directory}/${:_buildout_section_name_}
                    --disable-static
                    --enable-authn-alias
                    --enable-bucketeer
                    --enable-cache
                    --enable-case-filter
                    --enable-case-filter-in
                    --enable-cgid
                    --enable-charset-lite
                    --enable-disk-cache
                    --enable-mem-cache
                    --enable-echo
                    --enable-exception-hook
                    --enable-mods-shared=all
                    --enable-optional-fn-export
                    --enable-optional-fn-import
                    --enable-optional-hook-export
                    --enable-optional-hook-import
                    --enable-proxy
                    --enable-proxy-ajp
                    --enable-proxy-balancer
                    --enable-proxy-connect
                    --enable-proxy-ftp
                    --enable-proxy-http
                    --enable-proxy-scgi
                    --enable-dav
                    --enable-dav-fs
                    --enable-so
                    --enable-ssl
                    --disable-lua
                    --with-included-apr
                    --with-ssl=${openssl:location}
                    --with-z=${zlib:location}
                    --with-expat=${libexpat:location}
                    --with-pcre=${pcre:location}
                    --with-sqlite3=${sqlite3:location}
                    --with-gdbm=${gdbm:location}
                    --without-lber
                    --without-ldap
                    --without-ndbm
                    --without-berkeley-db
                    --without-pgsql
                    --without-mysql
                    --without-sqlite2
                    --without-oracle
                    --without-freedts
                    --without-odbc
                    --without-iconv

environment =
  PATH=${pkgconfig:location}/bin:%(PATH)s
  PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig
  CPPFLAGS =-I${libuuid:location}/include -I${openssl:location}/include
  LDFLAGS =-Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${openssl:location}/lib -L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib -Wl,-rpath=${libexpat:location}/lib -Wl,-rpath=${pcre:location}/lib -Wl,-rpath=${sqlite3:location}/lib -Wl,-rpath=${gdbm:location}/lib

[apache-antiloris]
# Note: Shall react on each build of apache and reinstall itself
recipe = slapos.recipe.cmmi
url = http://downloads.sourceforge.net/project/mod-antiloris/mod_antiloris-0.4.tar.bz2
md5sum = 66862bf10e9be3a023e475604a28a0b4
patch-options = -p0
# http://www.apachelounge.com/viewtopic.php?p=19139
# http://www.apachelounge.com/viewtopic.php?p=20551
patches =
  ${:_profile_base_location_}/mod_antiloris-apache-2.4.patch#4f074f035d3b37f3f3e71cd9616440f3
depends =
  ${apache:version}
  ${apache:revision}
  ${gdbm:version}
configure-command = ${apache:location}/bin/apxs
configure-options = -c mod_antiloris.c
make-binary = ${:configure-command}
make-options = -i -a -n antiloris mod_antiloris.la
make-targets =

[apache-2.2]
# inspired on http://old.aclark.net/team/aclark/blog/a-lamp-buildout-for-wordpress-and-other-php-apps/
recipe = slapos.recipe.cmmi
version = 2.2.26
url = http://mir2.ovh.net/ftp.apache.org/dist/httpd/httpd-${:version}.tar.bz2
md5sum = 254eda547f8d624604e4bf403241e617
patch-options = -p1
configure-options = --disable-static
                    --enable-authn-alias
                    --enable-bucketeer
                    --enable-cache
                    --enable-case-filter
                    --enable-case-filter-in
                    --enable-cgid
                    --enable-charset-lite
                    --enable-disk-cache
                    --enable-mem-cache
                    --enable-echo
                    --enable-exception-hook
                    --enable-mods-shared=all
                    --enable-optional-fn-export
                    --enable-optional-fn-import
                    --enable-optional-hook-export
                    --enable-optional-hook-import
                    --enable-proxy
                    --enable-proxy-ajp
                    --enable-proxy-balancer
                    --enable-proxy-connect
                    --enable-proxy-ftp
                    --enable-proxy-http
                    --enable-proxy-scgi
                    --enable-dav
                    --enable-dav-fs
                    --enable-dav-lock
                    --enable-so
                    --enable-ssl
                    --with-included-apr
                    --with-ssl=${openssl:location}
                    --with-z=${zlib:location}
                    --with-expat=${libexpat:location}
                    --with-pcre=${pcre:location}
                    --with-sqlite3=${sqlite3:location}
                    --with-gdbm=${gdbm:location}
                    --without-lber
                    --without-ldap
                    --without-ndbm
                    --without-berkeley-db
                    --without-pgsql
                    --without-mysql
                    --without-sqlite2
                    --without-oracle
                    --without-freedts
                    --without-odbc
                    --without-iconv

environment =
  PATH=${pkgconfig:location}/bin:%(PATH)s
  PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig
  CPPFLAGS =-I${libuuid:location}/include
  LDFLAGS =-Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${openssl:location}/lib -L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib -Wl,-rpath=${libexpat:location}/lib -Wl,-rpath=${pcre:location}/lib -Wl,-rpath=${sqlite3:location}/lib -Wl,-rpath=${gdbm:location}/lib

[apache-antiloris-apache-2.2]
# Note: Shall react on each build of apache and reinstall itself
recipe = slapos.recipe.cmmi
url = http://downloads.sourceforge.net/project/mod-antiloris/mod_antiloris-0.4.tar.bz2
md5sum = 66862bf10e9be3a023e475604a28a0b4
depends =
  ${apache-2.2:version}
configure-command = ${apache-2.2:location}/bin/apxs
configure-options = -c mod_antiloris.c
make-binary = ${:configure-command}
make-options = -i -a -n antiloris mod_antiloris.la
make-targets =