[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.4.6
url = http://mir2.ovh.net/ftp.apache.org/dist/apr/apr-${:version}.tar.bz2
md5sum = ffee70a111fd07372982b0550bbb14b7

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

[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.4
revision = 1
url = http://mir2.ovh.net/ftp.apache.org/dist/httpd/httpd-${:version}.tar.bz2
md5sum = 0e712ee2119cd798c8ae39d5f11a9206
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

[mod_antiloris-apache-2.4.patch]
# http://www.apachelounge.com/viewtopic.php?p=19139
# http://www.apachelounge.com/viewtopic.php?p=20551
recipe = hexagonit.recipe.download
url =${:_profile_base_location_}/${:filename}
filename = mod_antiloris-apache-2.4.patch
download-only = true
md5sum = 4f074f035d3b37f3f3e71cd9616440f3

[apache-antiloris]
# Note: Shall react on each build of apache and reinstall itself
recipe = slapos.recipe.cmmi
url = http://sourceforge.net/projects/mod-antiloris/files/mod_antiloris-0.4.tar.bz2/download
md5sum = 66862bf10e9be3a023e475604a28a0b4
patch-options = -p0
patches =
  ${mod_antiloris-apache-2.4.patch:location}/${mod_antiloris-apache-2.4.patch:filename}
depends =
  ${apache:version}
  ${apache:revision}
  ${mod_antiloris-apache-2.4.patch:md5sum}
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.25
url = http://mir2.ovh.net/ftp.apache.org/dist/httpd/httpd-${:version}.tar.bz2
md5sum = 9ebe3070c0bb4311f21a0cd0e34f0045
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://sourceforge.net/projects/mod-antiloris/files/mod_antiloris-0.4.tar.bz2/download
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 =