Author: rjung Date: Sat Oct 31 11:11:25 2015 New Revision: 1711593 URL: http://svn.apache.org/viewvc?rev=1711593&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
Backport of r1711591 from trunk. Modified: tomcat/native/branches/1.1.x/ (props changed) tomcat/native/branches/1.1.x/native/buildconf Propchange: tomcat/native/branches/1.1.x/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Oct 31 11:11:25 2015 @@ -1,3 +1,3 @@ -/tomcat/native/trunk:815411,988395,988402,988428,992208,1043611,1043696,1205445,1295445,1342003,1342008,1342013,1342020,1342024,1394258,1394342,1424947,1424971,1430753,1437081,1438342,1439337,1441884,1441886,1442579,1442581,1445972,1507113,1532577,1532590,1539594,1555184,1559180,1588195,1607262,1607267,1607278,1607291,1607477,1648821,1650119,1650304,1658557,1658641-1658642,1658724,1669302,1669496,1681126,1681147,1681150-1681151,1681172,1681189,1681218,1681295,1681298,1681314,1681323,1681419,1681505,1681507,1681509,1681520 +/tomcat/native/trunk:815411,988395,988402,988428,992208,1043611,1043696,1205445,1295445,1342003,1342008,1342013,1342020,1342024,1394258,1394342,1424947,1424971,1430753,1437081,1438342,1439337,1441884,1441886,1442579,1442581,1445972,1507113,1532577,1532590,1539594,1555184,1559180,1588195,1607262,1607267,1607278,1607291,1607477,1648821,1650119,1650304,1658557,1658641-1658642,1658724,1669302,1669496,1681126,1681147,1681150-1681151,1681172,1681189,1681218,1681295,1681298,1681314,1681323,1681419,1681505,1681507,1681509,1681520,1711591 /tomcat/tc7.0.x/trunk:1199985,1200164,1349932,1434887,1435769 /tomcat/trunk:815418,832198,1001939,1033916,1043103,1044729,1078522,1145209,1145285,1149092,1241356,1241406-1241407,1242254,1292671,1299980,1300102,1434905,1437083 Modified: tomcat/native/branches/1.1.x/native/buildconf URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/buildconf?rev=1711593&r1=1711592&r2=1711593&view=diff ============================================================================== --- tomcat/native/branches/1.1.x/native/buildconf (original) +++ tomcat/native/branches/1.1.x/native/buildconf Sat Oct 31 11:11:25 2015 @@ -21,7 +21,7 @@ # --with-apr=[directory] apr_src_dir=`pwd`/srclib/apr-1.3.9 -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: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org