]> granicus.if.org Git - apache/blobdiff - build/binbuild.sh
update after backport
[apache] / build / binbuild.sh
index ddcafbf8c82083adab8e78f94affc716d7d7444e..92fe0a723e99eccd45a9f9f549585427649b4f34 100755 (executable)
@@ -1,21 +1,43 @@
 #!/bin/sh
+#      
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 #
-# binbuild.sh - Builds an Apache binary distribution.
-# Initially written by Lars Eilebrecht <lars@apache.org>.
 #
-# This script falls under the Apache License.
-# See http://www.apache.org/docs/LICENSE
+# binbuild.sh - Builds an Apache binary distribution.
+# Initially written by Lars Eilebrecht <lars apache.org>.
 
-OS=`./srclib/apr/build/config.guess`
-BUILD_DIR="`pwd`/bindist"
+OS=`./build/config.guess`
+PRINTPATH="build/PrintPath"
+APFULLDIR=`pwd`
+BUILD_DIR="$APFULLDIR/bindist"
 DEFAULT_DIR="/usr/local/apache2"
-CONFIGPARAM="--with-layout=BinaryDistribution --prefix=$BUILD_DIR --enable-mods-shared=most"
-APDIR=`pwd`
+APDIR="$APFULLDIR"
 APDIR=`basename $APDIR`
-VER=`echo $APDIR |sed s/httpd-//`
-TAR="`srclib/apr/build/PrintPath tar`"
-GTAR="`srclib/apr/build/PrintPath gtar`"
-GZIP="`srclib/apr/build/PrintPath gzip`"
+CONFIGPARAM="--enable-layout=Apache --prefix=$BUILD_DIR --enable-mods-shared=most --with-expat=$APFULLDIR/srclib/apr-util/xml/expat --enable-static-support"
+VER=`echo $APDIR | sed s/httpd-//`
+TAR="`$PRINTPATH tar`"
+GZIP="`$PRINTPATH gzip`"
+COMPRESS="`$PRINTPATH compress`"
+MD5="`$PRINTPATH md5`"
+if [ x$MD5 = x ]; then
+  OPENSSL="`$PRINTPATH openssl`"
+  if [ x$OPENSSL != x ]; then
+    MD5="$OPENSSL md5"
+  fi
+fi
 
 if [ x$1 != x ]; then
   USER=$1
@@ -23,17 +45,15 @@ else
   USER="`build/buildinfo.sh -n %u@%h%d`"
 fi
 
-if [ ! -f ./ABOUT_APACHE ]
-then
+if [ ! -f ./ABOUT_APACHE ]; then
   echo "ERROR: The current directory contains no valid Apache distribution."
   echo "Please change the directory to the top level directory of a freshly"
   echo "unpacked Apache 2.0 source distribution and re-execute the script"
-  echo "'./build/bindbuild.sh'." 
+  echo "'./build/binbuild.sh'." 
   exit 1;
 fi
 
-if [ -d ./CVS ]
-then
+if [ -d ./CVS ]; then
   echo "ERROR: The current directory is a CVS checkout of Apache."
   echo "Only a standard Apache 2.0 source distribution should be used to"
   echo "create a binary distribution."
@@ -59,8 +79,7 @@ echo "Platform is \"$OS\"..."
   echo "[EOF]" \
 ) 2>&1 | tee build.log
 
-if [ ! -f ./bindist/bin/httpd ]
-then
+if [ ! -f ./bindist/bin/httpd ]; then
   echo "ERROR: Failed to build Apache. See \"build.log\" for details."
   exit 1;
 fi
@@ -87,13 +106,12 @@ echo "Creating supplementary files..."
   echo " " && \
   echo "NOTE: Please do not send support-related mails to the address mentioned" && \
   echo "      above or to any member of the Apache Group! Support questions" && \
-  echo "      should be directed to the \"comp.infosystems.www.servers.unix\"" && \
-  echo "      or \"comp.infosystems.www.servers.ms-windows\" newsgroup" && \
-  echo "      (as appropriate for the platform you use), where some of the" && \
-  echo "      Apache team lurk, in the company of many other Apache gurus" && \
-  echo "      who should be able to help." && \
+  echo "      should be directed to the forums mentioned at" && \
+  echo "      http://httpd.apache.org/lists.html#http-users" && \
+  echo "      where some of the Apache team lurk, in the company of many other" && \
+  echo "      Apache gurus who should be able to help." && \
   echo "      If you think you found a bug in Apache or have a suggestion please" && \
-  echo "      visit the bug report page at http://www.apache.org/bug_report.html" && \
+  echo "      visit the bug report page at http://httpd.apache.org/bug_report.html" && \
   echo " " && \
   echo "----------------------------------------------------------------------" && \
   ./bindist/bin/httpd -V && \
@@ -136,48 +154,53 @@ sed -e "s%$BUILD_DIR%$DEFAULT_DIR%" \
     bindist/conf/httpd-std.conf > bindist/conf/httpd.conf
 cp bindist/conf/httpd.conf bindist/conf/httpd-std.conf
 
-sed -e "s%$BUILD_DIR%$DEFAULT_DIR%" \
-    -e "s%^#binbuild %%" \
-    bindist/bin/apachectl > bindist/bin/apachectl.tmp
-mv bindist/bin/apachectl.tmp bindist/bin/apachectl
+for one_file in apachectl envvars envvars-std; do
+    sed -e "s%$BUILD_DIR%$DEFAULT_DIR%" \
+        bindist/bin/$one_file > bindist/bin/$one_file.tmp
+    mv bindist/bin/$one_file.tmp bindist/bin/$one_file
+done
 
 echo "Creating distribution archive and readme file..."
  
-if [ ".`grep -i error build.log > /dev/null`" != . ]
-then
+if [ ".`grep -i error build.log > /dev/null`" != . ]; then
   echo "ERROR: Failed to build Apache. See \"build.log\" for details."
   exit 1;
 else
-  if [ "x$GTAR" != "x" ]
-  then
-    $GTAR -zcf ../httpd-$VER-$OS.tar.gz -C .. httpd-$VER
-  else
-    if [ "x$TAR" != "x" ]
-    then
-      case "x$OS" in
-        x*390*) $TAR -cfU ../httpd-$VER-$OS.tar -C .. httpd-$VER;;
-           *) (cd .. && $TAR -cf httpd-$VER-$OS.tar httpd-$VER);;
-      esac
-      if [ "x$GZIP" != "x" ]
-      then
-        $GZIP ../httpd-$VER-$OS.tar
-      fi
+  if [ "x$TAR" != "x" ]; then
+    case "x$OS" in
+      x*os390*) $TAR -cfU ../httpd-$VER-$OS.tar -C .. httpd-$VER;;
+      *) (cd .. && $TAR -cf httpd-$VER-$OS.tar httpd-$VER);;
+    esac
+    if [ "x$GZIP" != "x" ]; then
+      $GZIP -9 ../httpd-$VER-$OS.tar
+      ARCHIVE=../httpd-$VER-$OS.tar.gz
+    elif [ "x$COMPRESS" != "x" ]; then
+      $COMPRESS ../httpd-$VER-$OS.tar
+      ARCHIVE=../httpd-$VER-$OS.tar.Z
     else
-      echo "ERROR: Could not find a 'tar' program!"
-      echo "       Please execute the following commands manually:"
-      echo "         tar -cf ../httpd-$VER-$OS.tar ."
-      echo "         gzip ../httpd-$VER-$OS.tar"
+      echo "WARNING: Could not find a 'gzip' program!"
+      echo "       tar archive is not compressed."
+      ARCHIVE=../httpd-$VER-$OS.tar
     fi
+  else
+    echo "ERROR: Could not find a 'tar' program!"
+    echo "       Please execute the following commands manually:"
+    echo "         tar -cf ../httpd-$VER-$OS.tar ."
+    echo "         gzip -9 ../httpd-$VER-$OS.tar"
+  fi
+
+  if [ "x$MD5" != "x" ]; then
+    $MD5 $ARCHIVE > $ARCHIVE.md5
   fi
 
-  if [ -f ../httpd-$VER-$OS.tar.gz ] && [ -f ../httpd-$VER-$OS.README ]
-  then
+  if [ -f $ARCHIVE ] && [ -f ../httpd-$VER-$OS.README ]; then
     echo "Ready."
-    echo "You can find the binary archive (httpd-$VER-$OS.tar.gz)"
+    echo "You can find the binary archive ($ARCHIVE)"
     echo "and the readme file (httpd-$VER-$OS.README) in the"
     echo "parent directory."
     exit 0;
   else
+    echo "ERROR: Archive or README is missing."
     exit 1;
   fi
 fi