fix(httpd) (#3723)

* fix(httpd)

simplify

closes #3722

* wip

* wip
This commit is contained in:
Jacob Heider 2023-10-19 17:37:18 -04:00 committed by GitHub
parent 6b33636d4c
commit 49eb02b291
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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:
@ -105,6 +98,6 @@ provides:
- bin/suexec
test:
script: |
httpd -v | grep {{version}}
apachectl -t -f "$APACHE_CONFDIR/httpd.conf"
script:
- httpd -v | grep {{version}}
- apachectl -t -f "$APACHE_CONFDIR/httpd.conf"