Author: rjung
Date: Sat Oct 31 10:48:35 2015
New Revision: 1711591
URL: http://svn.apache.org/viewvc?rev=1711591&view=rev
Log:
buildconf updates:
- don't use "test" when not needed
- indent "case"
- add some checks for contents needed in apr
source directory
- add success check for gen-build.py
- rewrite autoconf success check using same
style
- replace use of "cut" with "sed", which is
already used in other places
- remove unneeded subshell "()" construct
- add console output for final version and
release number used in spec file
Modified:
tomcat/native/trunk/native/buildconf
Modified: tomcat/native/trunk/native/buildconf
URL:
http://svn.apache.org/viewvc/tomcat/native/trunk/native/buildconf?rev=1711591&r1=1711590&r2=1711591&view=diff
==============================================================================
--- tomcat/native/trunk/native/buildconf (original)
+++ tomcat/native/trunk/native/buildconf Sat Oct 31 10:48:35 2015
@@ -21,7 +21,7 @@
# --with-apr=[directory]
apr_src_dir=`pwd`/srclib/apr-1.5.2
-while test $# -gt 0
+while [ $# -gt 0 ]
do
# Normalize
case "$1" in
@@ -31,15 +31,14 @@ do
case "$1" in
--with-apr=*)
- apr_src_dir=$optarg
- ;;
+ apr_src_dir=$optarg
+ ;;
esac
shift
done
-if test -d "$apr_src_dir"
-then
+if [ -d "$apr_src_dir" ]; then
echo ""
echo "Looking for apr source in $apr_src_dir"
else
@@ -50,21 +49,29 @@ else
exit 1
fi
+if [ ! -d "$apr_src_dir/build" ]; then
+ echo "Directory '$apr_src_dir/build' missing - wrong apr source directory?"
+ exit 1
+fi
+
# Remove some files, then copy them from apr source tree
-rm -f build/apr_common.m4 build/find_apr.m4 build/install.sh \
- build/config.guess build/config.sub
-cp $apr_src_dir/build/apr_common.m4 $apr_src_dir/build/find_apr.m4 \
- $apr_src_dir/build/install.sh $apr_src_dir/build/config.guess \
- $apr_src_dir/build/config.sub build
+for file in apr_common.m4 find_apr.m4 install.sh config.guess config.sub
+do
+ if [ ! -f "$apr_src_dir/build/$file" ]; then
+ echo "File '$apr_src_dir/build/$file' missing - wrong apr source
directory?"
+ exit 1
+ fi
+ rm -f build/$file
+ cp $apr_src_dir/build/$file build/
+done
# Remove aclocal.m4 as it'll break some builds...
rm -rf aclocal.m4 autom4te*.cache
echo "Creating configure ..."
### do some work to toss config.cache?
-if ${AUTOCONF:-autoconf}; then
- :
-else
+${AUTOCONF:-autoconf}
+if [ $? -gt 0 ]; then
echo "autoconf failed"
exit 1
fi
@@ -74,23 +81,27 @@ fi
#
echo "Generating 'make' outputs ..."
$apr_src_dir/build/gen-build.py make
+if [ $? -gt 0 ]; then
+ echo "Creating build-outputs.mk failed"
+ exit 1
+fi
# Remove autoconf cache again
rm -rf autom4te*.cache
# Create RPM Spec file
-if [ -f `which cut` ]; then
- echo rebuilding rpm spec file
- ( REVISION=`build/get-version.sh all include/tcn_version.h TCN`
- VERSION=`echo $REVISION | cut -d- -s -f1`
- RELEASE=`echo $REVISION | cut -d- -s -f2`
- if [ "x$VERSION" = "x" ]; then
- VERSION=$REVISION
- RELEASE=1
- fi
- cat ./build/rpm/tcnative.spec.in | \
- sed -e "s/TCN_VERSION/$VERSION/" \
- -e "s/TCN_RELEASE/$RELEASE/" \
- > tcnative.spec )
+echo rebuilding rpm spec file
+REVISION=`build/get-version.sh all include/tcn_version.h TCN`
+# Strip everything behind "-"
+VERSION=`echo $REVISION | sed -e 's/-.*//'`
+# Strip everything before "-"
+RELEASE=`echo $REVISION | sed -e 's/.*-//'`
+# Handle case of no "-" in REVISION
+if [ "x$RELEASE" = "xREVISION" ]; then
+ RELEASE=1
fi
-
+echo "Using version '$VERSION' and release '$RELEASE' in RPM spec file"
+sed -e "s/TCN_VERSION/$VERSION/" \
+ -e "s/TCN_RELEASE/$RELEASE/" \
+ ./build/rpm/tcnative.spec.in \
+ > tcnative.spec
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]