diff --git a/projects/apache.org/httpd/package.yml b/projects/apache.org/httpd/package.yml index c08b9649..7fc9ebf2 100644 --- a/projects/apache.org/httpd/package.yml +++ b/projects/apache.org/httpd/package.yml @@ -18,6 +18,12 @@ dependencies: pcre.org/v2: '*' gnome.org/libxml2: '*' zlib.net: '*' + libexpat.github.io: '*' + +runtime: + env: + HTTPD_ROOT: '{{prefix}}' + APACHE_CONFDIR: '{{prefix}}/conf' build: dependencies: @@ -29,23 +35,48 @@ build: ./configure $ARGS make make install + + HTTPD_CONF=$(tea httpd -V 2>/dev/null | grep SERVER_CONFIG_FILE | sed 's/.*"\(.*\)"/\1/') + port=8080 + while lsof -i:$port >/dev/null 2>&1; do + ((port++)) + done + if [ "$port" -ne 8080 ]; then + sed -i '' "s/Listen 8080/Listen $port/" {{prefix}}/$HTTPD_CONF + fi + sed -i.bak 's/#ServerName www.example.com:8080/ServerName localhost:'"$port"'/g' {{prefix}}/$HTTPD_CONF + + cd "{{prefix}}/bin" + sed -i.bak \ + -e "s_{{prefix}}_\$(cd \$(dirname \$0)/.. \&\& pwd)_g" \ + -e "s/^HTTPD=\'\(.*\)\'$/HTTPD=\"\1\"/" \ + apachectl envvars envvars-std + sed -i.bak \ + -e 's_{{prefix}}_$(cd $(dirname $0)/.. && pwd)_g' \ + -e 's/^HTTPD='\''\(.*\)'\''$/HTTPD="$(cd $(dirname $0)\/.. \&\& pwd)\/bin\/httpd"/' \ + apachectl envvars envvars-std + + rm apachectl.bak envvars.bak envvars-std.bak + cd ../conf + sed -i.bak \ + -e 's_{{prefix}}_\${HTTPD\_ROOT}_' \ + httpd.conf + rm httpd.conf.bak + env: ARGS: - --prefix="{{prefix}}" - - --enable-layout=Slackware-FHS - - --sbindir={{prefix}}/bin - - --mandir={{prefix}}/man - - --sysconfdir={{prefix}}/etc/httpd - - --datadir={{prefix}}/var/www - - --localstatedir={{prefix}}/var + - --enable-layout="Apache" - --enable-mpms-shared=all - --enable-mods-shared=all - --enable-authnz-fcgi + - --enable-so + - --enable-ssl - --enable-cgi - --enable-pie - --enable-suexec - - --with-suexec-bin={{prefix}}/suexec - --with-suexec-caller=_www + - --with-suexec-bin={{prefix}}/suexec - --with-port=8080 - --with-sslport=8443 - --with-apr={{deps.apache.org/apr.prefix}} @@ -62,6 +93,7 @@ build: provides: - bin/ab + - bin/apachectl - bin/checkgid - bin/fcgistarter - bin/htcacheclean @@ -74,5 +106,7 @@ provides: - bin/rotatelogs - bin/suexec -test: - httpd -v | grep {{version}} \ No newline at end of file +test: + script: | + httpd -v | grep {{version}} + apachectl -t -f "$APACHE_CONFDIR/httpd.conf"