#!/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
#
-# binbuild.sh - Builds an Apache binary distribution.
-# Initially written by Lars Eilebrecht <lars@apache.org>.
+# 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.
#
-# 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`
+OS=`./build/config.guess`
+PRINTPATH="build/PrintPath"
APFULLDIR=`pwd`
BUILD_DIR="$APFULLDIR/bindist"
DEFAULT_DIR="/usr/local/apache2"
-APDIR=$APFULLDIR
+APDIR="$APFULLDIR"
APDIR=`basename $APDIR`
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`"
+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
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!"
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