From 4916acab59f531a0c9c5d7af312922fb9a870cd8 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Wed, 28 Nov 2001 19:41:07 +0000 Subject: [PATCH] get binbuild.sh working enough to create a binary which serves the It Works! page * change seds for apachectl and httpd*.conf to do the right thing * use /usr/local/apache2 for the default install directory * use a shell variable for the above, in case it needs to change again * use httpd-std.conf in place of httpd.conf.default * get rid of the httpd -R option in apachectl (not valid in 2.0) * don't overlay httpd.conf if it already exists (1.3 does this - wtf?!?!) not done in this commit: * install manual/ and error/ correctly * switch to --enable-mods-shared=most now that it works (thanks, aaron!) * investigate weird behavior when .tar.gz already exists in parent dir * investigate setting a Group directive that actually works in httpd*.conf git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92223 13f79535-47bb-0310-9956-ffa450edef68 --- build/binbuild.sh | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/build/binbuild.sh b/build/binbuild.sh index 6d3eec04c1..0ee3c11b23 100755 --- a/build/binbuild.sh +++ b/build/binbuild.sh @@ -7,7 +7,9 @@ # See http://www.apache.org/docs/LICENSE OS=`./srclib/apr/build/config.guess` -CONFIGPARAM="--with-layout=BinaryDistribution --prefix=`pwd`/bindist" +BUILD_DIR="`pwd`/bindist" +DEFAULT_DIR="/usr/local/apache2" +CONFIGPARAM="--with-layout=BinaryDistribution --prefix=$BUILD_DIR" APDIR=`pwd` APDIR=`basename $APDIR` VER=`echo $APDIR |sed s/httpd-//` @@ -107,8 +109,8 @@ cp README.bindist ../httpd-$VER-$OS.README echo "script \"install-bindist.sh\" in the top-level directory of the distribution." && \ echo " " && \ echo "The script takes the ServerRoot directory into which you want to install" && \ - echo "Apache as an option. If you ommit the option the default path" && \ - echo "\"/usr/local/apache\" is used." && \ + echo "Apache as an option. If you omit the option the default path" && \ + echo "\"$DEFAULT_DIR\" is used." && \ echo "Make sure you have write permissions in the target directory, e.g. switch" && \ echo "to user \"root\" before you execute the script." && \ echo " " && \ @@ -187,7 +189,7 @@ cp README.bindist ../httpd-$VER-$OS.README echo " " && \ echo "if [ .\$1 = . ]" && \ echo "then" && \ - echo " SR=/usr/local/apache" && \ + echo " SR=$DEFAULT_DIR" && \ echo "else" && \ echo " SR=\$1" && \ echo "fi" && \ @@ -208,9 +210,10 @@ cp README.bindist ../httpd-$VER-$OS.README echo "if [ -d \$SR/conf ]" && \ echo "then" && \ echo " echo \"[Preserving existing configuration files.]\"" && \ - echo " cp bindist/conf/*.default \$SR/conf/" && \ + echo " cp bindist/conf/*-std.conf \$SR/conf/" && \ echo "else" && \ echo " lcopy bindist/conf \$SR/conf 750 640" && \ + echo " sed -e \"s%$DEFAULT_DIR%\$SR%\" \$SR/conf/httpd-std.conf > \$SR/conf/httpd.conf" && \ echo "fi" && \ echo "if [ -d \$SR/htdocs ]" && \ echo "then" && \ @@ -229,8 +232,8 @@ cp README.bindist ../httpd-$VER-$OS.README echo " -e \"s;\@libexecdir\@;\$SR/libexec;\" -e \"s;\@includedir\@;\$SR/include;\" \\" && \ echo " -e \"s;\@sysconfdir\@;\$SR/conf;\" bindist/bin/apxs > \$SR/bin/apxs" && \ echo "sed -e \"s;^#!/.*;#!\$PERL;\" bindist/bin/dbmmanage > \$SR/bin/dbmmanage" && \ - echo "sed -e \"s%/usr/local/apache%\$SR%\" \$SR/conf/httpd-std.conf > \$SR/conf/httpd.conf" && \ - echo "sed -e \"s%PIDFILE=%PIDFILE=\$SR/%\" -e \"s%HTTPD=%HTTPD=\\\"\$SR/%\" -e \"s%httpd\$%httpd -d \$SR -R \$SR/libexec\\\"%\" bindist/bin/apachectl > \$SR/bin/apachectl" && \ + echo "sed -e \"s%$DEFAULT_DIR%\$SR%\" \\" && \ + echo " -e \"s%^HTTPD=.*\$%HTTPD=\\\"\$SR/bin/httpd -d \$SR\\\"%\" bindist/bin/apachectl > \$SR/bin/apachectl" && \ echo " " && \ echo "echo \"Ready.\"" && \ echo "echo \" +--------------------------------------------------------+\"" && \ @@ -253,15 +256,15 @@ cp README.bindist ../httpd-$VER-$OS.README ) > install-bindist.sh chmod 755 install-bindist.sh -sed -e "s%\"htdocs%\"/usr/local/apache/htdocs%" \ - -e "s%\"icons%\"/usr/local/apache/icons%" \ - -e "s%\"cgi-bin%\"/usr/local/apache/cgi-bin%" \ - -e "s%\"proxy%\"/usr/local/apache/proxy%" \ +sed -e "s%$BUILD_DIR%$DEFAULT_DIR%" \ -e "s%^ServerAdmin.*%ServerAdmin you@your.address%" \ -e "s%#ServerName.*%#ServerName localhost%" \ - -e "s%Port 8080%Port 80%" \ bindist/conf/httpd-std.conf > bindist/conf/httpd.conf -cp bindist/conf/httpd.conf bindist/conf/httpd.conf.default +cp bindist/conf/httpd.conf bindist/conf/httpd-std.conf + +sed -e "s%$BUILD_DIR%$DEFAULT_DIR%" \ + bindist/bin/apachectl > bindist/bin/apachectl.tmp +mv bindist/bin/apachectl.tmp bindist/bin/apachectl echo "Creating distribution archive and readme file..." -- 2.50.1