]> granicus.if.org Git - apache/blobdiff - build/binbuild.sh
update after backport
[apache] / build / binbuild.sh
index 2d580fc47855046953bd76353384ae30add07a46..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"
-APDIR=`pwd`
+APDIR="$APFULLDIR"
 APDIR=`basename $APDIR`
-APFULLDIR=`pwd`
 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="`srclib/apr/build/PrintPath tar`"
-GZIP="`srclib/apr/build/PrintPath gzip`"
+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
@@ -151,10 +173,14 @@ else
     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 "WARNING: Could not find a 'gzip' program!"
-      echo "       Please execute the following command manually:"
-      echo "         gzip -9 ../httpd-$VER-$OS.tar"
+      echo "       tar archive is not compressed."
+      ARCHIVE=../httpd-$VER-$OS.tar
     fi
   else
     echo "ERROR: Could not find a 'tar' program!"
@@ -163,13 +189,18 @@ else
     echo "         gzip -9 ../httpd-$VER-$OS.tar"
   fi
 
-  if [ -f ../httpd-$VER-$OS.tar.gz ] && [ -f ../httpd-$VER-$OS.README ]; then
+  if [ "x$MD5" != "x" ]; then
+    $MD5 $ARCHIVE > $ARCHIVE.md5
+  fi
+
+  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