diff --git a/projects/apache.org/httpd/package.yml b/projects/apache.org/httpd/package.yml index 20ad69ff..aba0e384 100644 --- a/projects/apache.org/httpd/package.yml +++ b/projects/apache.org/httpd/package.yml @@ -22,44 +22,37 @@ dependencies: runtime: env: - HTTPD_ROOT: '{{prefix}}' - APACHE_CONFDIR: '{{prefix}}/conf' + HTTPD_ROOT: '{{prefix}}' + APACHE_CONFDIR: '{{prefix}}/conf' build: dependencies: gnu.org/libtool: '*' gnu.org/autoconf: '*' - script: | - ./configure $ARGS - make - make install + script: + - ./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 + - HTTPD_CONF=$({{prefix}}/bin/httpd -V 2>/dev/null | grep SERVER_CONFIG_FILE | sed 's/.*"\(.*\)"/\1/') + - | + sed -i.bak 's/#ServerName www.example.com:8080/ServerName localhost:8080/g' {{prefix}}/$HTTPD_CONF + rm {{prefix}}/$HTTPD_CONF.bak - 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 + - run: | + 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 + working-directory: ${{prefix}}/bin - rm apachectl.bak envvars.bak envvars-std.bak - cd ../conf - sed -i.bak \ - -e 's_{{prefix}}_\${HTTPD\_ROOT}_' \ - httpd.conf - rm httpd.conf.bak + - run: | + sed -i.bak \ + -e 's|{{prefix}}|\${HTTPD_ROOT}|' \ + httpd.conf + rm httpd.conf.bak + working-directory: ${{prefix}}/conf env: ARGS: @@ -104,7 +97,7 @@ provides: - bin/rotatelogs - bin/suexec -test: - script: | - httpd -v | grep {{version}} - apachectl -t -f "$APACHE_CONFDIR/httpd.conf" +test: + script: + - httpd -v | grep {{version}} + - apachectl -t -f "$APACHE_CONFDIR/httpd.conf"