[mapguide-commits] r6593 - trunk/Installer/scripts

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Apr 26 09:37:58 EDT 2012


Author: jng
Date: 2012-04-26 06:37:58 -0700 (Thu, 26 Apr 2012)
New Revision: 6593

Removed:
   trunk/Installer/scripts/setvars.sh
Modified:
   trunk/Installer/scripts/build.sh
   trunk/Installer/scripts/dpkgmapguide.sh
Log:
Gave up trying to pass vars to elevated shells. Just put the needed vars back in build.sh and dpkgmapguide.sh

Modified: trunk/Installer/scripts/build.sh
===================================================================
--- trunk/Installer/scripts/build.sh	2012-04-25 21:32:14 UTC (rev 6592)
+++ trunk/Installer/scripts/build.sh	2012-04-26 13:37:58 UTC (rev 6593)
@@ -1,21 +1,53 @@
 #!/bin/bash
 
-# Make sure setvars.sh is called first before running this script
+# Global vars for this script. Modify as necessary
+APIVERSION=2.4
+BUILDNUM=${APIVERSION}.0
+BUILDROOT=`pwd`
+INSTALLROOT=/usr/local/mapguideopensource-${BUILDNUM}
+LOCKFILEDIR=/var/lock/mgserver
+MGSOURCE=${BUILDROOT}/mgdev
+VERFILE=${MGSOURCE}/Common/ProductVersion.h
+# Use LOCALSVN=1 if you want to build from an existing copy instead of building
+# from an export (saves bandwidth and faster)
+LOCALSVN=1
+SVNROOT=/home/user
+#SVNRELPATH=/mg-2.4/MgDev
+#SVNROOT="svn://svn.bld.mgproto.net"
+#SVNROOT="http://svn.osgeo.org"
+SVNRELPATH=/mapguide/trunk/MgDev
+MY_MAKE_OPTS="-j 4"
+UBUNTU=1
+PRESERVE_BUILD_ROOT=1
 
+echo "******************************************************************"
+echo " MapGuide will be installed to: ${INSTALLROOT}"
+echo " SVN Source is: ${SVNROOT}${SVNRELPATH}"
+echo " Make Options: ${MY_MAKE_OPTS}"
+echo " Is Ubuntu?: ${UBUNTU}"
+echo " Preserving the build dir?: ${PRESERVE_BUILD_ROOT}"
+echo " JAVA_HOME: ${JAVA_HOME}"
+echo "******************************************************************"
+
+# Need JAVA_HOME for JavaApi
 if [ ! -d ${JAVA_HOME} ];
 then
 echo "ERROR: Environment variable JAVA_HOME not set. Please set this enviroment variable first"
 exit
 fi
 
-if [ ! ${MG_BUILD_VARS_SET:-0} -eq 1 ];
-then
-echo "Please call setvars.sh first (source ./setvars.sh)"
-exit 1
-fi
+check_build()
+{
+    error=$?
+    if [ $error -ne 0 ]; then
+        echo "$BUILD_COMPONENT: Error build failed ($error)................."
+        exit $error
+    fi
+}
 
 if [ ! ${PRESERVE_BUILD_ROOT} -eq 1 ]
 then
+    echo "Removing existing build dir at ${MGSOURCE}"
     rm -rf ${MGSOURCE}
 else
     echo "Preserving existing build dir"
@@ -31,14 +63,16 @@
     	echo "Build root ${MGSOURCE} does not exist. Doing svn export"
     fi
     echo "Exporting svn revision ${REVISION}"
-    if [ ${LOCALSVN} = 1 ] 
+    if [ ${LOCALSVN} -eq 1 ] 
     then
-        echo "Making local SVN copy to ${MGSOURCE}"
+        echo "Making local SVN copy of ${SVNROOT}${SVNRELPATH} to ${MGSOURCE}"
         cp -R ${SVNROOT}${SVNRELPATH} ${MGSOURCE}
         echo "Cleaning out .svn directories"
+	pushd ${MGSOURCE}
         find . -name .svn -exec rm -rf {} \;
+	popd
     else
-        echo "Performing fresh SVN export to ${MGSOURCE}"
+        echo "Performing fresh SVN export of ${SVNROOT}${SVNRELPATH} (r${REVISION}) to ${MGSOURCE}"
         svn export -q -r ${REVISION} ${SVNROOT}${SVNRELPATH} ${MGSOURCE}
     fi
 fi
@@ -53,7 +87,9 @@
 
 echo "Building LinuxApt"
 pushd ${MGSOURCE}/Oem/LinuxApt
+BUILD_COMPONENT="LinuxApt"
 ./build_apt.sh --prefix ${INSTALLROOT} --with-tomcat
+check_build
 popd
 
 # Need an ubuntu-flavoured build_oem.sh if we're doing ubuntu
@@ -62,26 +98,36 @@
     cp ${BUILDROOT}/build_oem_ubuntu.sh .
     chmod +x build_oem_ubuntu.sh
     echo "Building Oem (Ubuntu)"
+    BUILD_COMPONENT="Oem (Ubuntu)"
     ./build_oem_ubuntu.sh --prefix ${INSTALLROOT}
+    check_build
 else
     echo "Building Oem (Regular)"
+    BUILD_COMPONENT="Oem (Regular)"
     ./build_oem.sh --prefix ${INSTALLROOT}
+    check_build
 fi
 
 echo "Building Fusion"
 pushd ${MGSOURCE}/Oem/fusion
+BUILD_COMPONENT="Fusion"
 ant prepare
 ant compress
+check_build
 popd
 
 echo "Building MapGuide"
+BUILD_COMPONENT="MapGuide"
 aclocal
 libtoolize --force
 automake --add-missing --copy
 autoconf
 ./configure --enable-optimized --prefix=${INSTALLROOT}
 make $MY_MAKE_OPTS
+check_build
+BUILD_COMPONENT="MapGuide Install"
 make install
+check_build
 
 echo "Preparing binaries for packaging"
 # Prepare binaries for packaging by removing unnecessary

Modified: trunk/Installer/scripts/dpkgmapguide.sh
===================================================================
--- trunk/Installer/scripts/dpkgmapguide.sh	2012-04-25 21:32:14 UTC (rev 6592)
+++ trunk/Installer/scripts/dpkgmapguide.sh	2012-04-26 13:37:58 UTC (rev 6593)
@@ -32,14 +32,8 @@
 #
 # Make sure setvars.sh is called first before running this script
 
-if [ ! ${MG_BUILD_VARS_SET:-0} -eq 1 ]
-then
-echo "Please call setvars.sh first (source ./setvars.sh)"
-exit 1
-fi
-
 BUILDROOT=`pwd`
-MGBUILD=${BUILDNUM}
+MGBUILD=2.4.0
 MGINST=usr/local/mapguideopensource-${MGBUILD}
 ROOT=${BUILDROOT}/debian/mapguidecommon
 TREE=${BUILDROOT}/debian

Deleted: trunk/Installer/scripts/setvars.sh
===================================================================
--- trunk/Installer/scripts/setvars.sh	2012-04-25 21:32:14 UTC (rev 6592)
+++ trunk/Installer/scripts/setvars.sh	2012-04-26 13:37:58 UTC (rev 6593)
@@ -1,31 +0,0 @@
-#!/bin/bash
-
-# Sets the common set of vars used throughout these build scripts
-
-export APIVERSION=2.4
-export BUILDNUM=${APIVERSION}.0
-export BUILDROOT=`pwd`
-export INSTALLROOT=/usr/local/mapguideopensource-${BUILDNUM}
-export LOCKFILEDIR=/var/lock/mgserver
-export MGSOURCE=${BUILDROOT}/mgdev
-export VERFILE=${MGSOURCE}/Common/ProductVersion.h
-# Use LOCALSVN=1 if you want to build from an existing copy instead of building
-# from an export
-export LOCALSVN=1
-export SVNROOT=/home/jackie
-export SVNRELPATH=/mg-2.4/MgDev
-#export SVNROOT="svn://svn.bld.mgproto.net"
-#export SVNROOT="http://svn.osgeo.org"
-#export SVNRELPATH=/mapguide/trunk/MgDev
-export MY_MAKE_OPTS="-j 4"
-export UBUNTU=0
-export PRESERVE_BUILD_ROOT=1
-
-echo "******************************************************************"
-echo " MapGuide will be installed to: ${INSTALLROOT}"
-echo " SVN Source is: ${SVNROOT}${SVNRELPATH}"
-echo " Make Options: ${MY_MAKE_OPTS}"
-echo " Is Ubuntu?: ${UBUNTU}"
-echo " Preserving the build dir?: ${PRESERVE_BUILD_ROOT}"
-echo "******************************************************************"
-export MG_BUILD_VARS_SET=1



More information about the mapguide-commits mailing list