[buildout]
parts =
  apache
  apache-antiloris

extends =
  ../nghttp2/buildout.cfg
  ../gdbm/buildout.cfg
  ../libexpat/buildout.cfg
  ../util-linux/buildout.cfg
  ../libxml2/buildout.cfg
  ../openssl/buildout.cfg
  ../patch/buildout.cfg
  ../pcre/buildout.cfg
  ../perl/buildout.cfg
  ../pkgconfig/buildout.cfg
  ../sqlite3/buildout.cfg
  ../zlib/buildout.cfg
  ./buildout.hash.cfg


[apr]
recipe = slapos.recipe.cmmi
shared = true
version = 1.7.2
md5sum = 9a00835e4da8c215348e263b550fc130
url = https://archive.apache.org/dist/apr/apr-${:version}.tar.bz2
environment =
  LDFLAGS=-Wl,-rpath=${libuuid:location}/lib

[apr-util]
recipe = slapos.recipe.cmmi
shared = true
version = 1.6.3
url = https://archive.apache.org/dist/apr/apr-util-${:version}.tar.bz2
md5sum = b6e8c9b31d938fe5797ceb0d1ff2eb69
configure-options =
    --with-apr=${apr:location}
    --with-expat=${libexpat:location}
    --without-sqlite3
environment =
  LDFLAGS=-Wl,-rpath=${libuuid:location}/lib

[apache]
recipe = slapos.recipe.cmmi
shared = true
version = 2.4.54
url = https://archive.apache.org/dist/httpd/httpd-${:version}.tar.bz2
md5sum = 861b43073ab416d689f1fc4dfa087711
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-http2
                    --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-ssl=${openssl:location}
                    --with-z=${zlib:location}
                    --with-expat=${libexpat:location}
                    --with-libxml2=${libxml2:location}/include/libxml2
                    --with-pcre=${pcre:location}/bin/pcre-config
                    --with-sqlite3=${sqlite3:location}
                    --with-gdbm=${gdbm:location}
                    --with-nghttp2=${nghttp2:location}
                    --without-lber
                    --without-ldap
                    --without-ndbm
                    --without-berkeley-db
                    --without-pgsql
                    --without-mysql
                    --without-sqlite2
                    --without-oracle
                    --without-freedts
                    --without-odbc
                    --without-iconv
                    --with-apr=${apr:location}
                    --with-apr-util=${apr-util:location}

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

[apache-antiloris]
# Note: This component tries to write in a [apache] parts, which is now
# shared. To use this component in a software, apache parts have to be made
# not shared in the software.
recipe = slapos.recipe.cmmi
shared = false
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
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 =
environment =
  PATH=${patch:location}/bin:%(PATH)s

[template-apache-backend-conf]
recipe = slapos.recipe.build:download
shared = true
url = ${:_profile_base_location_}/${:filename}
