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

@ -29,37 +29,30 @@ build:
dependencies: dependencies:
gnu.org/libtool: '*' gnu.org/libtool: '*'
gnu.org/autoconf: '*' gnu.org/autoconf: '*'
script: | script:
./configure $ARGS - ./configure $ARGS
make - make
make install - make install
HTTPD_CONF=$(tea httpd -V 2>/dev/null | grep SERVER_CONFIG_FILE | sed 's/.*"\(.*\)"/\1/') - HTTPD_CONF=$({{prefix}}/bin/httpd -V 2>/dev/null | grep SERVER_CONFIG_FILE | sed 's/.*"\(.*\)"/\1/')
port=8080 - |
while lsof -i:$port >/dev/null 2>&1; do sed -i.bak 's/#ServerName www.example.com:8080/ServerName localhost:8080/g' {{prefix}}/$HTTPD_CONF
((port++)) rm {{prefix}}/$HTTPD_CONF.bak
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" - run: |
sed -i.bak \ sed -i.bak \
-e "s_{{prefix}}_\$(cd \$(dirname \$0)/.. \&\& pwd)_g" \ -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"/' \ -e 's/^HTTPD='\''\(.*\)'\''$/HTTPD="$(cd $(dirname $0)\/.. \&\& pwd)\/bin\/httpd"/' \
apachectl envvars envvars-std apachectl envvars envvars-std
rm apachectl.bak envvars.bak envvars-std.bak rm apachectl.bak envvars.bak envvars-std.bak
cd ../conf working-directory: ${{prefix}}/bin
- run: |
sed -i.bak \ sed -i.bak \
-e 's_{{prefix}}_\${HTTPD\_ROOT}_' \ -e 's|{{prefix}}|\${HTTPD_ROOT}|' \
httpd.conf httpd.conf
rm httpd.conf.bak rm httpd.conf.bak
working-directory: ${{prefix}}/conf
env: env:
ARGS: ARGS:
@ -105,6 +98,6 @@ provides:
- bin/suexec - bin/suexec
test: test:
script: | script:
httpd -v | grep {{version}} - httpd -v | grep {{version}}
apachectl -t -f "$APACHE_CONFDIR/httpd.conf" - apachectl -t -f "$APACHE_CONFDIR/httpd.conf"