[mapguide-commits] r8370 - in trunk/Tools/Vagrant: . centos/x64 centos/x86 scripts sources/patches sources/patches/fdo/Thirdparty sources/patches/mapguide/Oem support ubuntu/x64 ubuntu/x86

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Sep 30 04:37:11 PDT 2014


Author: jng
Date: 2014-09-30 04:37:11 -0700 (Tue, 30 Sep 2014)
New Revision: 8370

Added:
   trunk/Tools/Vagrant/scripts/csmap_optimize.sh
   trunk/Tools/Vagrant/scripts/dpkgfdo.sh
   trunk/Tools/Vagrant/scripts/dpkgfdocore.sh
   trunk/Tools/Vagrant/scripts/dpkgfdoprovider.sh
   trunk/Tools/Vagrant/scripts/mapguidecommon_excludes.txt
   trunk/Tools/Vagrant/scripts/mginstallcentos.sh
   trunk/Tools/Vagrant/scripts/mginstallubuntu.sh
   trunk/Tools/Vagrant/scripts/mguninstallubuntu.sh
   trunk/Tools/Vagrant/scripts/platformbase_excludes.txt
   trunk/Tools/Vagrant/scripts/prepare_dpkg_fdo.sh
Removed:
   trunk/Tools/Vagrant/scripts/build_oem_ubuntu.sh
   trunk/Tools/Vagrant/sources/patches/fdo/Thirdparty/boost/
   trunk/Tools/Vagrant/sources/patches/mapguide/Oem/CsMap/
Modified:
   trunk/Tools/Vagrant/build.bat
   trunk/Tools/Vagrant/centos/x64/Vagrantfile
   trunk/Tools/Vagrant/centos/x86/Vagrantfile
   trunk/Tools/Vagrant/clean.bat
   trunk/Tools/Vagrant/scripts/build.sh
   trunk/Tools/Vagrant/scripts/build_fdo.sh
   trunk/Tools/Vagrant/scripts/dpkgbuild.sh
   trunk/Tools/Vagrant/scripts/dpkgmapguide.sh
   trunk/Tools/Vagrant/sources/patches/patchinfo.txt
   trunk/Tools/Vagrant/support/apt_list.txt
   trunk/Tools/Vagrant/ubuntu/x64/Vagrantfile
   trunk/Tools/Vagrant/ubuntu/x86/Vagrantfile
Log:
Sync vagrant configurations to match trunk

Modified: trunk/Tools/Vagrant/build.bat
===================================================================
--- trunk/Tools/Vagrant/build.bat	2014-09-29 13:58:02 UTC (rev 8369)
+++ trunk/Tools/Vagrant/build.bat	2014-09-30 11:37:11 UTC (rev 8370)
@@ -1,4 +1,12 @@
 @echo off
+
+rem build.bat
+rem
+rem Builds MapGuide/FDO in CentOS and Ubuntu VMs all driven by vagrant
+rem
+rem NOTE: CentOS builds must *always* precede the Ubuntu builds as Ubuntu builds may depend
+rem on the package FDO SDK tarball produced by the CentOS build
+
 SET BUILD_UBUNTU_32=1
 SET BUILD_UBUNTU_64=0
 SET BUILD_CENTOS_32=1
@@ -9,16 +17,45 @@
 SET TEARDOWN_CENTOS_64=0
 SET ROOT=%CD%
 SET COMPONENT=
+echo **************** Build Summary *********************
+echo Building Ubuntu (32-bit): %BUILD_UBUNTU_32% (teardown=%TEARDOWN_UBUNTU_32%)
+echo Building Ubuntu (64-bit): %BUILD_UBUNTU_64% (teardown=%TEARDOWN_UBUNTU_64%)
+echo Building CentOS (32-bit): %BUILD_CENTOS_32% (teardown=%TEARDOWN_CENTOS_32%)
+echo Building CentOS (64-bit): %BUILD_CENTOS_64% (teardown=%TEARDOWN_CENTOS_64%)
+echo ****************************************************
 :prepare
 echo [build]: Prepare scripts for provisioning
-if %BUILD_CENTOS_32% == 1 copy /Y scripts\*.* %ROOT%\centos\x86
-if %BUILD_UBUNTU_32% == 1 copy /Y scripts\*.* %ROOT%\ubuntu\x86
-if %BUILD_CENTOS_64% == 1 copy /Y scripts\*.* %ROOT%\centos\x64
-if %BUILD_UBUNTU_64% == 1 copy /Y scripts\*.* %ROOT%\ubuntu\x64
+if %BUILD_CENTOS_32% == 1 xcopy /S /Y /I scripts\* %ROOT%\centos\x86
+if %BUILD_UBUNTU_32% == 1 xcopy /S /Y /I scripts\* %ROOT%\ubuntu\x86
+if %BUILD_CENTOS_64% == 1 xcopy /S /Y /I scripts\* %ROOT%\centos\x64
+if %BUILD_UBUNTU_64% == 1 xcopy /S /Y /I scripts\* %ROOT%\ubuntu\x64
+:check_centos_32
+echo [build]: Checking if we're building for CentOS 32-bit
+if %BUILD_CENTOS_32% == 1 goto build_centos_32
+goto check_ubuntu_32
+:build_centos_32
+pushd centos\x86
+SET COMPONENT=CentOS Build 32-bit
+echo [build]: MapGuide CentOS build 32-bit
+if exist build rd /S /Q build
+call vagrant up
+echo [build]: vagrant returned %errorlevel%
+if "%errorlevel%"=="1" goto error
+if %TEARDOWN_CENTOS_32% == 1 (
+    echo [build]: Tearing down CentOS 32 VM
+    goto destroy_centos_32
+) else (
+    echo [build]: Not tearing down CentOS 32 VM
+    goto centos_32_done
+)
+:destroy_centos_32
+call vagrant destroy -f
+:centos_32_done
+popd
 :check_ubuntu_32
 echo [build]: Checking if we're building for Ubuntu 32-bit
 if %BUILD_UBUNTU_32% == 1 goto build_ubuntu_32
-goto check_centos_32
+goto check_centos_64
 :build_ubuntu_32
 pushd ubuntu\x86
 SET COMPONENT=Ubuntu Build 32-bit
@@ -38,33 +75,33 @@
 call vagrant destroy -f
 :ubuntu_32_done
 popd
-:check_centos_32
-echo [build]: Checking if we're building for CentOS 32-bit
-if %BUILD_CENTOS_32% == 1 goto build_centos_32
+:check_centos_64
+echo [build]: Checking if we're building for CentOS 64-bit
+if %BUILD_CENTOS_64% == 1 goto build_centos_64
 goto check_ubuntu_64
-:build_centos_32
-pushd centos\x86
-SET COMPONENT=CentOS Build 32-bit
-echo [build]: MapGuide CentOS build 32-bit
+:build_centos_64
+pushd centos\x64
+SET COMPONENT=CentOS Build 64-bit
+echo [build]: MapGuide CentOS build 64-bit
 if exist build rd /S /Q build
 call vagrant up
 echo [build]: vagrant returned %errorlevel%
 if "%errorlevel%"=="1" goto error
-if %TEARDOWN_CENTOS_32% == 1 (
-    echo [build]: Tearing down CentOS 32 VM
-    goto destroy_centos_32
+if %TEARDOWN_CENTOS_64% == 1 (
+    echo [build]: Tearing down CentOS 64 VM
+    goto destroy_centos_64
 ) else (
-    echo [build]: Not tearing down CentOS 32 VM
-    goto centos_32_done
+    echo [build]: Not tearing down CentOS 64 VM
+    goto centos_64_done
 )
-:destroy_centos_32
+:destroy_centos_64
 call vagrant destroy -f
-:centos_32_done
+:centos_64_done
 popd
 :check_ubuntu_64
 echo [build]: Checking if we're building for Ubuntu 64-bit
 if %BUILD_UBUNTU_64% == 1 goto build_ubuntu_64
-goto check_centos_64
+goto quit
 :build_ubuntu_64
 pushd ubuntu\x64
 SET COMPONENT=Ubuntu Build 64-bit
@@ -84,30 +121,7 @@
 call vagrant destroy -f
 :ubuntu_64_done
 popd
-:check_centos_64
-echo [build]: Checking if we're building for CentOS 64-bit
-if %BUILD_CENTOS_64% == 1 goto build_centos_64
 goto quit
-:build_centos_64
-pushd centos\x64
-SET COMPONENT=CentOS Build 64-bit
-echo [build]: MapGuide CentOS build 64-bit
-if exist build rd /S /Q build
-call vagrant up
-echo [build]: vagrant returned %errorlevel%
-if "%errorlevel%"=="1" goto error
-if %TEARDOWN_CENTOS_64% == 1 (
-    echo [build]: Tearing down CentOS 64 VM
-    goto destroy_centos_64
-) else (
-    echo [build]: Not tearing down CentOS 64 VM
-    goto centos_64_done
-)
-:destroy_centos_64
-call vagrant destroy -f
-:centos_64_done
-popd
-goto quit
 :error
 echo [ERROR]: There was an error building the component %COMPONENT%
 exit /B 1

Modified: trunk/Tools/Vagrant/centos/x64/Vagrantfile
===================================================================
--- trunk/Tools/Vagrant/centos/x64/Vagrantfile	2014-09-29 13:58:02 UTC (rev 8369)
+++ trunk/Tools/Vagrant/centos/x64/Vagrantfile	2014-09-30 11:37:11 UTC (rev 8370)
@@ -126,6 +126,14 @@
 		exit $error
 	fi
 }
+check_test()
+{
+	error=$?
+	if [ $error -ne 0 ]; then
+		echo "[warning]: ${BUILD_COMPONENT} - Unit Tests failed ($error)"
+		echo "[warning]: ${BUILD_COMPONENT} - Unit Tests failed ($error)" >> ~/unit_test_status.log
+	fi
+}
 if hash scons 2>/dev/null; then
 	echo [provision]: We have scons
 else
@@ -139,13 +147,22 @@
 HAVE_FDO=0
 HAVE_FDO_LIBS=0
 HAVE_MAPGUIDE=0
-MG_UNIT_TEST=0
+MG_UNIT_TEST=1
+FDO_UNIT_TEST=1
+MAKE_FDO_SDK=0
 SCRIPT_ROOT=~/scripts
 FDO_SRC_ROOT=~/fdo
-FDO_SRC=$FDO_SRC_ROOT/trunk
+FDO_VER_MM=3.9
+FDO_VER_FULL=${FDO_VER_MM}.0
+MG_VER_MM=3.0
+MG_VER_FULL=${MG_VER_MM}.0
+FDO_SRC_DIR=trunk
+FDO_SRC=$FDO_SRC_ROOT/$FDO_SRC_DIR
 FDO_LIB_SRC=~/fdo_rdbms_thirdparty
 MG_SRC_ROOT=~/mapguide/trunk
 MG_SRC=$MG_SRC_ROOT/MgDev
+FDO_TARBALL=fdo-checkout.tar.gz
+MG_TARBALL=mapguide-checkout.tar.gz
 if [ -d $FDO_SRC ]; 
 then
     HAVE_FDO=1
@@ -158,12 +175,25 @@
 then
     HAVE_MAPGUIDE=1
 fi
-echo [provision]: Checking all tools and libs are in place
-yum install -y gcc-* gd-* automake bison byacc flex doxygen expat expat-devel libtool libjpeg-devel libpng libpng-devel libxml2 libxml2-devel openssl curl curl-devel libxslt libxslt-devel subversion java-1.7.0-openjdk java-1.7.0-openjdk-devel ant dos2unix openssh-server openldap-devel alsa-lib-devel pcre-devel unixODBC-devel libcom_err-devel krb5-devel openssl-devel mysql-devel postgresql-devel unixODBC
+if [ -f /usr/include/asm/atomic.h ];
+then
+    echo [provision]: atomic.h exists. Doing nothing
+else
+    echo [provision]: Copy atomic.h
+    sudo mkdir -p /usr/include/asm
+    sudo cp /mapguide_sources/atomic.h /usr/include/asm
+fi
+#echo [provision]: Checking all tools and libs are in place
+#yum install -y gcc-* gd-* automake bison byacc flex doxygen expat expat-devel libtool libjpeg-devel libpng libpng-devel libxml2 libxml2-devel openssl curl curl-devel libxslt libxslt-devel subversion java-1.7.0-openjdk java-1.7.0-openjdk-devel ant dos2unix openssh-server openldap-devel alsa-lib-devel pcre-devel unixODBC-devel libcom_err-devel krb5-devel openssl-devel mysql-devel postgresql-devel unixODBC
+echo [provision]: Clean line endings
+sudo dos2unix /vagrant/*.sh
+sudo dos2unix /vagrant/*.pl
+sudo dos2unix /vagrant/*.txt
 echo [provision]: Copying shell scripts
 mkdir -p $SCRIPT_ROOT
 cp -f /vagrant/*.sh $SCRIPT_ROOT
 cp -f /vagrant/*.pl $SCRIPT_ROOT
+cp -f /vagrant/*.txt $SCRIPT_ROOT
 echo [provision]: Flip Ubuntu switch
 cd $SCRIPT_ROOT
 sed -i 's/UBUNTU=1/UBUNTU=0/g' build.sh
@@ -179,15 +209,15 @@
 fi
 if [ $HAVE_FDO -eq 0 ];
 then
-    echo [provision]: Extracting FDO trunk working copy
-    mkdir -p ~/fdo
-    tar -zxf /mapguide_sources/fdo-checkout.tar.gz -C ~/fdo
+    echo [provision]: Extracting FDO working copy
+    mkdir -p $FDO_SRC_ROOT
+    tar -zxf /mapguide_sources/$FDO_TARBALL -C $FDO_SRC_ROOT
 fi
 if [ $HAVE_MAPGUIDE -eq 0 ];
 then
-    echo [provision]: Extracting MapGuide trunk working copy
+    echo [provision]: Extracting MapGuide working copy
     mkdir -p $MG_SRC_ROOT
-    tar -zxf /mapguide_sources/mapguide-checkout.tar.gz -C $MG_SRC_ROOT
+    tar -zxf /mapguide_sources/$MG_TARBALL -C $MG_SRC_ROOT
 fi
 echo [provision]: svn update FDO
 BUILD_COMPONENT="svn update FDO"
@@ -207,6 +237,8 @@
     echo [provision]: Applying MapGuide source patches
     cp -R /mapguide_sources/patches/mapguide/* $MG_SRC
 fi
+echo [provision]: Making sure swig is executable
+chmod +x $MG_SRC/Oem/SWIGEx/Linux/swig
 cd ~/scripts
 BUILD_COMPONENT="FDO"
 sudo -E ./build_fdo.sh 2>&1 | tee ~/fdo_build.log
@@ -214,27 +246,99 @@
 BUILD_COMPONENT="MapGuide"
 sudo -E ./build.sh 2>&1 | tee ~/mapguide_build.log
 check_build
+FDO_REV=`svn info $FDO_SRC | perl revnum.pl`
+MG_REV=`svn info $MG_SRC | perl revnum.pl`
+> ~/unit_test_status.log
+if [ $FDO_UNIT_TEST -eq 1 ];
+then
+    export NLSPATH=/usr/local/fdo-${FDO_VER_FULL}/nls/%N
+    echo [provision]: Unit test FDO
+    BUILD_COMPONENT="Unit Test FDO Core"
+    cd $SCRIPT_ROOT/fdo_build_area/Fdo/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_core_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test SHP Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/SHP/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_shp_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test SDF Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/SDF/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_sdf_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test SQLite Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/SQLite/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_sqlite_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test GDAL Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/GDAL/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_gdal_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test WMS Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/WMS/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_wms_unit_test.log
+    check_test
+fi
 if [ $MG_UNIT_TEST -eq 1 ];
 then
     echo [provision]: Unit test MapGuide
-    cd $SCRIPT_ROOT/mgdev
-    sudo make check 2>&1 | tee ~/mapguide_unit_test.log
+    BUILD_COMPONENT="Unit Test MapGuide Server"
+    # HACK: Tile and Resource Service tests are known to freeze our VMs when driven by vagrant (why? who knows? 
+    # All we know is that those tests involve threads)
+    # So test everything *but* the above services. If required, this can be tested under a manually controlled
+    # VM
+    #
+    # build the individual targets that would comprise "make check" sans execution of unittest.sh
+    cd $SCRIPT_ROOT/mgdev/Server/src/UnitTesting
+    sudo make libMgUnitTesting.la
+    cd $SCRIPT_ROOT/mgdev/Server/src/Core
+    sudo make unittest.sh
+    # Run the test suites individually except for TileService/ResourceService for reasons already stated
+    for comp in CoordinateSystem FeatureService Geometry KmlService LogManager MdfModel Misc RenderingService ServerAdminService ServerManager ServiceManager SiteManager SiteService ProfilingService TransformMesh
+    do
+        sudo -E ./mgserver test $comp UnitTestResults_${comp}.xml 2>&1 | tee ~/mapguide_${comp}_unit_test.log
+        check_test
+        if [ -f UnitTestResults_${comp}.xml ]; then
+            sudo mv UnitTestResults_${comp}.xml ~/UnitTestResults_${comp}.xml
+        fi
+    done
 fi
 cd $SCRIPT_ROOT
+echo [provision]: Make output dir
 sudo mkdir -p /vagrant/build
+echo [provision]: Copy log files to output dir
 sudo mv -f ~/*.log /vagrant/build
+echo [provision]: Copy tarballs to output dir
 sudo cp bin/*.tar.gz /vagrant/build
-sudo cp fdosdk*.tar.gz /vagrant/build
+sudo cp fdosdk-centos6-i386-${FDO_VER_FULL}_${FDO_REV}.tar.gz /vagrant/build
+if [ $MAKE_FDO_SDK -eq 1 ]; then
+    echo [provision]: Copy FDO SDK for Ubuntu builds
+    # Copy SDK also to sources, so Ubuntu can pick it up
+    sudo rm -f /mapguide_sources/fdosdk*.tar.gz
+    sudo cp fdosdk-centos6-amd64-${FDO_VER_FULL}_${FDO_REV}.tar.gz /mapguide_sources
+    # Record file name so Ubuntu knows what tarball to extract from
+    sudo echo fdosdk-centos6-amd64-${FDO_VER_FULL}_${FDO_REV}.tar.gz > /mapguide_sources/fdosdk_filename
+    sudo echo ${FDO_REV} > /mapguide_sources/fdosdk_rev
+    # Export filelist to Ubuntu can deb package this SDK if needed
+    sudo cp -R $SCRIPT_ROOT/fdo_build_area/install/filelist /mapguide_sources
+fi
+echo [provision]: Copy unit test logs to output dir
+sudo mv ~/unit_test_status.log /vagrant/build/unit_test_status.log
+sudo mv ~/fdo_*_unit_test.log /vagrant/build
+sudo mv ~/UnitTestResults_*.xml /vagrant/build
+echo [provision]: Copy install/uninstall scripts to output dir
+sudo cp /vagrant/mginstallcentos.sh /vagrant/build/mginstallcentos.sh
+sudo sed -i 's/FDOVER_REV=0/FDOVER_REV='"$FDO_REV"'/g' /vagrant/build/mginstallcentos.sh
+sudo sed -i 's/MGVER_REV=0/MGVER_REV='"$MG_REV"'/g' /vagrant/build/mginstallcentos.sh
 if [ ! -d /mapguide_sources/updated ]; then
     sudo mkdir -p /mapguide_sources/updated
-    cd ~/mapguide/trunk
+    cd $MG_SRC_ROOT
     echo [provision]: Updating mapguide source tarball
-    tar -zcf mapguide-checkout.tar.gz MgDev
-    sudo mv mapguide-checkout.tar.gz /mapguide_sources/updated
-    cd ~/fdo
+    tar -zcf $MG_TARBALL MgDev
+    sudo mv $MG_TARBALL /mapguide_sources/updated
+    cd $FDO_SRC_ROOT
     echo [provision]: Updating fdo source tarball
-    tar -zcf fdo-checkout.tar.gz trunk
-    sudo mv fdo-checkout.tar.gz /mapguide_sources/updated
+    tar -zcf $FDO_TARBALL $FDO_SRC_DIR
+    sudo mv $FDO_TARBALL /mapguide_sources/updated
 else
     echo [provision]: Updated tarballs already exist. Doing nothing
 fi

Modified: trunk/Tools/Vagrant/centos/x86/Vagrantfile
===================================================================
--- trunk/Tools/Vagrant/centos/x86/Vagrantfile	2014-09-29 13:58:02 UTC (rev 8369)
+++ trunk/Tools/Vagrant/centos/x86/Vagrantfile	2014-09-30 11:37:11 UTC (rev 8370)
@@ -126,6 +126,14 @@
 		exit $error
 	fi
 }
+check_test()
+{
+	error=$?
+	if [ $error -ne 0 ]; then
+		echo "[warning]: ${BUILD_COMPONENT} - Unit Tests failed ($error)"
+		echo "[warning]: ${BUILD_COMPONENT} - Unit Tests failed ($error)" >> ~/unit_test_status.log
+	fi
+}
 if hash scons 2>/dev/null; then
 	echo [provision]: We have scons
 else
@@ -139,13 +147,22 @@
 HAVE_FDO=0
 HAVE_FDO_LIBS=0
 HAVE_MAPGUIDE=0
-MG_UNIT_TEST=0
+MG_UNIT_TEST=1
+FDO_UNIT_TEST=1
+MAKE_FDO_SDK=0
 SCRIPT_ROOT=~/scripts
 FDO_SRC_ROOT=~/fdo
-FDO_SRC=$FDO_SRC_ROOT/trunk
+FDO_VER_MM=3.9
+FDO_VER_FULL=${FDO_VER_MM}.0
+MG_VER_MM=3.0
+MG_VER_FULL=${MG_VER_MM}.0
+FDO_SRC_DIR=trunk
+FDO_SRC=$FDO_SRC_ROOT/$FDO_SRC_DIR
 FDO_LIB_SRC=~/fdo_rdbms_thirdparty
 MG_SRC_ROOT=~/mapguide/trunk
 MG_SRC=$MG_SRC_ROOT/MgDev
+FDO_TARBALL=fdo-checkout.tar.gz
+MG_TARBALL=mapguide-checkout.tar.gz
 if [ -d $FDO_SRC ]; 
 then
     HAVE_FDO=1
@@ -158,12 +175,25 @@
 then
     HAVE_MAPGUIDE=1
 fi
-echo [provision]: Checking all tools and libs are in place
-yum install -y gcc-* gd-* automake bison byacc flex doxygen expat expat-devel libtool libjpeg-devel libpng libpng-devel libxml2 libxml2-devel openssl curl curl-devel libxslt libxslt-devel subversion java-1.7.0-openjdk java-1.7.0-openjdk-devel ant dos2unix openssh-server openldap-devel alsa-lib-devel pcre-devel unixODBC-devel libcom_err-devel krb5-devel openssl-devel mysql-devel postgresql-devel unixODBC
+if [ -f /usr/include/asm/atomic.h ];
+then
+    echo [provision]: atomic.h exists. Doing nothing
+else
+    echo [provision]: Copy atomic.h
+    sudo mkdir -p /usr/include/asm
+    sudo cp /mapguide_sources/atomic.h /usr/include/asm
+fi
+#echo [provision]: Checking all tools and libs are in place
+#yum install -y gcc-* gd-* automake bison byacc flex doxygen expat expat-devel libtool libjpeg-devel libpng libpng-devel libxml2 libxml2-devel openssl curl curl-devel libxslt libxslt-devel subversion java-1.7.0-openjdk java-1.7.0-openjdk-devel ant dos2unix openssh-server openldap-devel alsa-lib-devel pcre-devel unixODBC-devel libcom_err-devel krb5-devel openssl-devel mysql-devel postgresql-devel unixODBC
+echo [provision]: Clean line endings
+sudo dos2unix /vagrant/*.sh
+sudo dos2unix /vagrant/*.pl
+sudo dos2unix /vagrant/*.txt
 echo [provision]: Copying shell scripts
 mkdir -p $SCRIPT_ROOT
 cp -f /vagrant/*.sh $SCRIPT_ROOT
 cp -f /vagrant/*.pl $SCRIPT_ROOT
+cp -f /vagrant/*.txt $SCRIPT_ROOT
 echo [provision]: Flip Ubuntu switch
 cd $SCRIPT_ROOT
 sed -i 's/UBUNTU=1/UBUNTU=0/g' build.sh
@@ -179,15 +209,15 @@
 fi
 if [ $HAVE_FDO -eq 0 ];
 then
-    echo [provision]: Extracting FDO trunk working copy
-    mkdir -p ~/fdo
-    tar -zxf /mapguide_sources/fdo-checkout.tar.gz -C ~/fdo
+    echo [provision]: Extracting FDO working copy
+    mkdir -p $FDO_SRC_ROOT
+    tar -zxf /mapguide_sources/$FDO_TARBALL -C $FDO_SRC_ROOT
 fi
 if [ $HAVE_MAPGUIDE -eq 0 ];
 then
-    echo [provision]: Extracting MapGuide trunk working copy
+    echo [provision]: Extracting MapGuide working copy
     mkdir -p $MG_SRC_ROOT
-    tar -zxf /mapguide_sources/mapguide-checkout.tar.gz -C $MG_SRC_ROOT
+    tar -zxf /mapguide_sources/$MG_TARBALL -C $MG_SRC_ROOT
 fi
 echo [provision]: svn update FDO
 BUILD_COMPONENT="svn update FDO"
@@ -207,6 +237,8 @@
     echo [provision]: Applying MapGuide source patches
     cp -R /mapguide_sources/patches/mapguide/* $MG_SRC
 fi
+echo [provision]: Making sure swig is executable
+chmod +x $MG_SRC/Oem/SWIGEx/Linux/swig
 cd ~/scripts
 BUILD_COMPONENT="FDO"
 sudo -E ./build_fdo.sh 2>&1 | tee ~/fdo_build.log
@@ -214,27 +246,99 @@
 BUILD_COMPONENT="MapGuide"
 sudo -E ./build.sh 2>&1 | tee ~/mapguide_build.log
 check_build
+FDO_REV=`svn info $FDO_SRC | perl revnum.pl`
+MG_REV=`svn info $MG_SRC | perl revnum.pl`
+> ~/unit_test_status.log
+if [ $FDO_UNIT_TEST -eq 1 ];
+then
+    export NLSPATH=/usr/local/fdo-${FDO_VER_FULL}/nls/%N
+    echo [provision]: Unit test FDO
+    BUILD_COMPONENT="Unit Test FDO Core"
+    cd $SCRIPT_ROOT/fdo_build_area/Fdo/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_core_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test SHP Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/SHP/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_shp_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test SDF Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/SDF/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_sdf_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test SQLite Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/SQLite/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_sqlite_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test GDAL Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/GDAL/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_gdal_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test WMS Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/WMS/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_wms_unit_test.log
+    check_test
+fi
 if [ $MG_UNIT_TEST -eq 1 ];
 then
     echo [provision]: Unit test MapGuide
-    cd $SCRIPT_ROOT/mgdev
-    sudo make check 2>&1 | tee ~/mapguide_unit_test.log
+    BUILD_COMPONENT="Unit Test MapGuide Server"
+    # HACK: Tile and Resource Service tests are known to freeze our VMs when driven by vagrant (why? who knows? 
+    # All we know is that those tests involve threads)
+    # So test everything *but* the above services. If required, this can be tested under a manually controlled
+    # VM
+    #
+    # build the individual targets that would comprise "make check" sans execution of unittest.sh
+    cd $SCRIPT_ROOT/mgdev/Server/src/UnitTesting
+    sudo make libMgUnitTesting.la
+    cd $SCRIPT_ROOT/mgdev/Server/src/Core
+    sudo make unittest.sh
+    # Run the test suites individually except for TileService/ResourceService for reasons already stated
+    for comp in CoordinateSystem FeatureService Geometry KmlService LogManager MdfModel Misc RenderingService ServerAdminService ServerManager ServiceManager SiteManager SiteService ProfilingService TransformMesh
+    do
+        sudo -E ./mgserver test $comp UnitTestResults_${comp}.xml 2>&1 | tee ~/mapguide_${comp}_unit_test.log
+        check_test
+        if [ -f UnitTestResults_${comp}.xml ]; then
+            sudo mv UnitTestResults_${comp}.xml ~/UnitTestResults_${comp}.xml
+        fi
+    done
 fi
 cd $SCRIPT_ROOT
+echo [provision]: Make output dir
 sudo mkdir -p /vagrant/build
+echo [provision]: Copy log files to output dir
 sudo mv -f ~/*.log /vagrant/build
+echo [provision]: Copy tarballs to output dir
 sudo cp bin/*.tar.gz /vagrant/build
-sudo cp fdosdk*.tar.gz /vagrant/build
+sudo cp fdosdk-centos6-i386-${FDO_VER_FULL}_${FDO_REV}.tar.gz /vagrant/build
+if [ $MAKE_FDO_SDK -eq 1 ]; then
+    echo [provision]: Copy FDO SDK for Ubuntu builds
+    # Copy SDK also to sources, so Ubuntu can pick it up
+    sudo rm -f /mapguide_sources/fdosdk*.tar.gz
+    sudo cp fdosdk-centos6-i386-${FDO_VER_FULL}_${FDO_REV}.tar.gz /mapguide_sources
+    # Record file name so Ubuntu knows what tarball to extract from
+    sudo echo fdosdk-centos6-i386-${FDO_VER_FULL}_${FDO_REV}.tar.gz > /mapguide_sources/fdosdk_filename
+    sudo echo ${FDO_REV} > /mapguide_sources/fdosdk_rev
+    # Export filelist to Ubuntu can deb package this SDK if needed
+    sudo cp -R $SCRIPT_ROOT/fdo_build_area/install/filelist /mapguide_sources
+fi
+echo [provision]: Copy unit test logs to output dir
+sudo mv ~/unit_test_status.log /vagrant/build/unit_test_status.log
+sudo mv ~/fdo_*_unit_test.log /vagrant/build
+sudo mv ~/UnitTestResults_*.xml /vagrant/build
+echo [provision]: Copy install/uninstall scripts to output dir
+sudo cp /vagrant/mginstallcentos.sh /vagrant/build/mginstallcentos.sh
+sudo sed -i 's/FDOVER_REV=0/FDOVER_REV='"$FDO_REV"'/g' /vagrant/build/mginstallcentos.sh
+sudo sed -i 's/MGVER_REV=0/MGVER_REV='"$MG_REV"'/g' /vagrant/build/mginstallcentos.sh
 if [ ! -d /mapguide_sources/updated ]; then
     sudo mkdir -p /mapguide_sources/updated
-    cd ~/mapguide/trunk
+    cd $MG_SRC_ROOT
     echo [provision]: Updating mapguide source tarball
-    tar -zcf mapguide-checkout.tar.gz MgDev
-    sudo mv mapguide-checkout.tar.gz /mapguide_sources/updated
-    cd ~/fdo
+    tar -zcf $MG_TARBALL MgDev
+    sudo mv $MG_TARBALL /mapguide_sources/updated
+    cd $FDO_SRC_ROOT
     echo [provision]: Updating fdo source tarball
-    tar -zcf fdo-checkout.tar.gz trunk
-    sudo mv fdo-checkout.tar.gz /mapguide_sources/updated
+    tar -zcf $FDO_TARBALL $FDO_SRC_DIR
+    sudo mv $FDO_TARBALL /mapguide_sources/updated
 else
     echo [provision]: Updated tarballs already exist. Doing nothing
 fi

Modified: trunk/Tools/Vagrant/clean.bat
===================================================================
--- trunk/Tools/Vagrant/clean.bat	2014-09-29 13:58:02 UTC (rev 8369)
+++ trunk/Tools/Vagrant/clean.bat	2014-09-30 11:37:11 UTC (rev 8370)
@@ -1,36 +1,51 @@
 @echo off
 SET ROOT=%CD%
 SET COMPONENT=
+pushd sources
+if exist updated rd /S /Q updated
+if exist filelist rd /S /Q filelist
+if exist fdosdk_filename del /F fdosdk_filename
+if exist fdosdk_rev del /F fdosdk_rev
+del /F fdosdk*.tar.gz
+popd
 pushd ubuntu\x86
 SET COMPONENT=Ubuntu Build 32-bit
 echo [clean]: MapGuide Ubuntu build 32-bit
 if exist build rd /S /Q build
+if exist filelist rd /S /Q filelist
 if exist *.sh del *.sh
 if exist *.pl del *.pl
+if exist *.txt del *.txt
 call vagrant destroy -f
 popd
 pushd centos\x86
 SET COMPONENT=CentOS Build 32-bit
 echo [clean]: MapGuide CentOS build 32-bit
 if exist build rd /S /Q build
+if exist filelist rd /S /Q filelist
 if exist *.sh del *.sh
 if exist *.pl del *.pl
+if exist *.txt del *.txt
 call vagrant destroy -f
 popd
 pushd ubuntu\x64
 SET COMPONENT=Ubuntu Build 64-bit
 echo [clean]: MapGuide Ubuntu build 64-bit
 if exist build rd /S /Q build
+if exist filelist rd /S /Q filelist
 if exist *.sh del *.sh
 if exist *.pl del *.pl
+if exist *.txt del *.txt
 call vagrant destroy -f
 popd
 pushd centos\x64
 SET COMPONENT=CentOS Build 64-bit
 echo [clean]: MapGuide CentOS build 64-bit
 if exist build rd /S /Q build
+if exist filelist rd /S /Q filelist
 if exist *.sh del *.sh
 if exist *.pl del *.pl
+if exist *.txt del *.txt
 call vagrant destroy -f
 popd
 goto quit

Modified: trunk/Tools/Vagrant/scripts/build.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/build.sh	2014-09-29 13:58:02 UTC (rev 8369)
+++ trunk/Tools/Vagrant/scripts/build.sh	2014-09-30 11:37:11 UTC (rev 8370)
@@ -1,10 +1,11 @@
 #!/bin/bash
 
 # Global vars for this script. Modify as necessary
-APIVERSION=2.6
+APIVERSION=3.0
 BUILDNUM=${APIVERSION}.0
 BUILDROOT=`pwd`
 MGCPUPLATFORM=i386
+MGDEBUG=0
 INSTALLROOT=/usr/local/mapguideopensource-${BUILDNUM}
 #INSTALLROOT=/usr/local/mapguideopensource-trunk
 LOCKFILEDIR=/var/lock/mgserver
@@ -26,6 +27,7 @@
 echo " SVN Source is: ${SVNROOT}${SVNRELPATH}"
 echo " Make Options: ${MY_MAKE_OPTS}"
 echo " Is Ubuntu?: ${UBUNTU}"
+echo " Debug Build?: ${MGDEBUG}"
 echo " Preserving the build dir?: ${PRESERVE_BUILD_ROOT}"
 echo " JAVA_HOME: ${JAVA_HOME}"
 echo "******************************************************************"
@@ -61,7 +63,7 @@
 then
     if [ ! -d ${MGSOURCE} ];
     then
-    	echo "Build root ${MGSOURCE} does not exist. Doing svn export"
+        echo "Build root ${MGSOURCE} does not exist. Doing svn export"
     fi
     echo "Exporting svn revision ${REVISION}"
     if [ ${LOCALSVN} -eq 1 ] 
@@ -69,15 +71,53 @@
         echo "Making local SVN copy of ${SVNROOT}${SVNRELPATH} to ${MGSOURCE}"
         cp -R ${SVNROOT}${SVNRELPATH} ${MGSOURCE}
         echo "Cleaning out .svn directories"
-	pushd ${MGSOURCE}
+    pushd ${MGSOURCE}
         find . -name .svn -exec rm -rf {} \;
-	popd
+    popd
     else
         echo "Performing fresh SVN export of ${SVNROOT}${SVNRELPATH} (r${REVISION}) to ${MGSOURCE}"
         svn export -q -r ${REVISION} ${SVNROOT}${SVNRELPATH} ${MGSOURCE}
     fi
 fi
 
+if [ ${UBUNTU} -eq 1 ];
+then
+    echo "[info]: Performing Ubuntu-specific modifications"
+    # GCC 4.8 is causing too much instability, so downgrade one version
+    #GCCVER=4.7
+    #export GCCVER
+    #CC=gcc-$GCCVER
+    #export CC
+    #CXX=g++-$GCCVER
+    #export CXX
+    #echo "[info]: Using GCC $GCCVER for Ubuntu"
+
+    # Patch some build scripts and makefiles to accept our chosen compiler
+
+    # CS-Map Dictionary Compiler
+    #echo "[info]: Patch CS-Map compiler makefile"
+    #sed -i 's/gcc \$/'"$CC"' \$/g' ${MGSOURCE}/Oem/CsMap/Dictionaries/Compiler.mak
+    #sed -i 's/gcc -v/'"$CC"' -v/g' ${MGSOURCE}/Oem/CsMap/Dictionaries/Compiler.mak
+
+    # libpng makefile
+    #echo "[info]: Patch libpng makefile"
+    #sed -i 's/CC=cc/CC='"$CC"'/g' ${MGSOURCE}/Oem/gd/lpng/scripts/makefile.std
+
+    # AGG 2.4 Linux Makefile
+    #echo "[info]: Replace agg-2.4 makefile"
+    #echo "AGGLIBS= -lagg " > ${MGSOURCE}/Oem/agg-2.4/Makefile.in.Linux
+    #echo "AGGCXXFLAGS = -O3 -I/usr/X11R6/include -L/usr/X11R6/lib" >> ${MGSOURCE}/Oem/agg-2.4/Makefile.in.Linux
+    #echo "CXX = $CXX" >> ${MGSOURCE}/Oem/agg-2.4/Makefile.in.Linux
+    #echo "C = $CC" >> ${MGSOURCE}/Oem/agg-2.4/Makefile.in.Linux
+    #echo "LIB = ar cr" >> ${MGSOURCE}/Oem/agg-2.4/Makefile.in.Linux
+    #echo "" >> ${MGSOURCE}/Oem/agg-2.4/Makefile.in.Linux
+    #echo ".PHONY : clean" >> ${MGSOURCE}/Oem/agg-2.4/Makefile.in.Linux
+else
+    echo "[info]: Performing CentOS-specific modifications"
+    #sed -i 's/sh .\/buildall.sh/sh .\/buildall.sh --with-xerces-conf=--enable-transcoder-iconv/g' ${MGSOURCE}/build_oem.sh
+    #sed -i 's/sh .\/buildall.sh --with-xerces-conf=--enable-transcoder-iconv --clean/sh .\/buildall.sh --clean/g' ${MGSOURCE}/build_oem.sh
+fi
+
 start_time=`date +%s`
 
 echo "Building Revision ${BUILDNUM}.${REVISION}" 
@@ -89,6 +129,7 @@
 echo 'const STRING ApiVersion     = L"'${APIVERSION}'";' >> ${VERFILE}
 echo '#endif' >> ${VERFILE}
 
+# Note: Remove for trunk as this has been included into build_oem.sh
 echo "Building LinuxApt"
 pushd ${MGSOURCE}/Oem/LinuxApt
 BUILD_COMPONENT="LinuxApt"
@@ -98,9 +139,25 @@
 
 echo "Building Oem"
 BUILD_COMPONENT="Oem"
-./build_oem.sh --prefix ${INSTALLROOT}
-check_build
+if [ $(uname -m) = "x86_64" ]; then
+    if [ ${MGDEBUG} -eq 1 ]; then
+        ./build_oem.sh --prefix ${INSTALLROOT} --build 64 --config debug
+        check_build
+    else
+        ./build_oem.sh --prefix ${INSTALLROOT} --build 64
+        check_build
+    fi
+else
+    if [ ${MGDEBUG} -eq 1 ]; then
+        ./build_oem.sh --prefix ${INSTALLROOT} --config debug
+        check_build
+    else
+        ./build_oem.sh --prefix ${INSTALLROOT}
+        check_build
+    fi
+fi
 
+# Note: Remove for trunk as this has been included into build_oem.sh
 echo "Building Fusion"
 pushd ${MGSOURCE}/Oem/fusion
 BUILD_COMPONENT="Fusion"
@@ -117,10 +174,18 @@
 autoconf
 if [ $(uname -m) = "x86_64" ]; then
     MGCPUPLATFORM=amd64
-    ./configure --enable-optimized --enable-silent-rules --enable-64bit --prefix=${INSTALLROOT}
+    if [ ${MGDEBUG} -eq 1 ]; then
+        ./configure --disable-optimized --enable-silent-rules --enable-64bit --prefix=${INSTALLROOT}
+    else
+        ./configure --enable-optimized --enable-silent-rules --enable-64bit --prefix=${INSTALLROOT}
+    fi
 else
     MGCPUPLATFORM=i386
-    ./configure --enable-optimized --enable-silent-rules --prefix=${INSTALLROOT}
+    if [ ${MGDEBUG} -eq 1 ]; then
+        ./configure --disable-optimized --enable-silent-rules --prefix=${INSTALLROOT}
+    else
+        ./configure --enable-optimized --enable-silent-rules --prefix=${INSTALLROOT}
+    fi
 fi
 make $MY_MAKE_OPTS
 check_build

Modified: trunk/Tools/Vagrant/scripts/build_fdo.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/build_fdo.sh	2014-09-29 13:58:02 UTC (rev 8369)
+++ trunk/Tools/Vagrant/scripts/build_fdo.sh	2014-09-30 11:37:11 UTC (rev 8370)
@@ -7,6 +7,8 @@
 # Modify setenvironment.sh to point to the correct Oracle, MySQL and PostgreSQL paths
 # before building
 
+FDO_DEBUG=0
+
 FDO_BUILD_COMPONENT=
 
 # FDO version. Make sure this matches your FDO build source
@@ -14,6 +16,14 @@
 FDO_VER_MINOR=9
 FDO_VER_REV=0
 
+# Extra flags to pass to FDO build scripts
+FDO_BUILD_FLAGS=
+if [ $FDO_DEBUG -eq 1 ]; then
+    FDO_BUILD_FLAGS="--config debug"
+else
+    FDO_BUILD_FLAGS="--config release"
+fi
+
 UBUNTU=0
 FDO_CPU=x86
 FDO_PLATFORM=32
@@ -26,65 +36,65 @@
 
 check_build()
 {
-	error=$?
-	if [ $error -ne 0 ]; then
-		echo "[error]: ${FDO_BUILD_COMPONENT} - Error build failed ($error)"
-		exit $error
-	fi
+    error=$?
+    if [ $error -ne 0 ]; then
+        echo "[error]: ${FDO_BUILD_COMPONENT} - Error build failed ($error)"
+        exit $error
+    fi
 }
 
 check_fdo_lib()
 {
-	libname=$1-${FDO_VER_FULL}.so
-	libpath=${FDO_INST}/lib/${libname}
-	if [ ! -e ${libpath} ]; then
-		echo "[error]: Error building ${libname}"
-		exit 1
-	fi
+    libname=$1-${FDO_VER_FULL}.so
+    libpath=${FDO_INST}/lib/${libname}
+    if [ ! -e ${libpath} ]; then
+        echo "[error]: Error building ${libname}"
+        exit 1
+    fi
 }
 
 save_current_file_list()
 {
-	echo "[info]: Saving current FDO dir file list"
-	pushd $FDO_INST
-	# For lazy folks who build from svn working copies instead of svn exports, we need to weed out any .svn dirs before compiling the file-list
-	find . -name .svn -exec rm -rf {} \;
-	find . -type f -print > ${FDO_FILELIST}/temp.lst
-	find . -type l -print >> ${FDO_FILELIST}/temp.lst
-	sort ${FDO_FILELIST}/temp.lst > ${FDO_FILELIST}/orig.lst
-	find . -type d -print | sort > ${FDO_FILELIST}/origdir.lst
-	popd
+    echo "[info]: Saving current FDO dir file list"
+    pushd $FDO_INST
+    # For lazy folks who build from svn working copies instead of svn exports, we need to weed out any .svn dirs before compiling the file-list
+    find . -name .svn -exec rm -rf {} \;
+    find . -type f -print > ${FDO_FILELIST}/temp.lst
+    find . -type l -print >> ${FDO_FILELIST}/temp.lst
+    sort ${FDO_FILELIST}/temp.lst > ${FDO_FILELIST}/orig.lst
+    find . -type d -print | sort > ${FDO_FILELIST}/origdir.lst
+    popd
 }
 
 update_fdocore_file_list()
 {
-	echo "[info]: Updating FDO core file list for deb packaging"
-	pushd $FDO_INST
-	# For lazy folks who build from svn working copies instead of svn exports, we need to weed out any .svn dirs before compiling the file-list
-	find . -name .svn -exec rm -rf {} \;
-	find . -type f -print > ${FDO_FILELIST}/temp.lst
-	find . -type l -print >> ${FDO_FILELIST}/temp.lst
-	sort ${FDO_FILELIST}/temp.lst > ${FDO_FILELIST}/fdocore.lst
-	find . -type d -print | sort > ${FDO_FILELIST}/fdocoredir.lst
-	popd
+    echo "[info]: Updating FDO core file list for deb packaging"
+    pushd $FDO_INST
+    # For lazy folks who build from svn working copies instead of svn exports, we need to weed out any .svn dirs before compiling the file-list
+    find . -name .svn -exec rm -rf {} \;
+    find . -type f -print > ${FDO_FILELIST}/temp.lst
+    find . -type l -print >> ${FDO_FILELIST}/temp.lst
+    sort ${FDO_FILELIST}/temp.lst > ${FDO_FILELIST}/fdocore.lst
+    find . -type d -print | sort > ${FDO_FILELIST}/fdocoredir.lst
+    popd
 }
 
 update_provider_file_list()
 {
-	PROVIDER=$1
-	echo "[info]: Updating $PROVIDER file list for deb packaging"
-	pushd $FDO_INST
-	# For lazy folks who build from svn working copies instead of svn exports, we need to weed out any .svn dirs before compiling the file-list
-	find . -name .svn -exec rm -rf {} \;
-	#mkdir -p $BUILDLIST
-	find . -type f -print > ${FDO_FILELIST}/temp.lst
-	find . -type l -print >> ${FDO_FILELIST}/temp.lst
-	cat ${FDO_FILELIST}/orig.lst >> ${FDO_FILELIST}/temp.lst
-	sort ${FDO_FILELIST}/temp.lst | uniq -u > ${FDO_FILELIST}/${PROVIDER}.lst
-	find . -type d -print | sort > ${FDO_FILELIST}/temp.lst
-	cat ${FDO_FILELIST}/origdir.lst >> ${FDO_FILELIST}/temp.lst
-	sort ${FDO_FILELIST}/temp.lst | uniq -u > ${FDO_FILELIST}/${PROVIDER}dir.lst
-	popd
+    PROVIDER=$1
+    echo "[info]: Updating $PROVIDER file list for deb packaging"
+    pushd $FDO_INST
+    # For lazy folks who build from svn working copies instead of svn exports, we need to weed out any .svn dirs before compiling the file-list
+    find . -name .svn -exec rm -rf {} \;
+    #mkdir -p $BUILDLIST
+    find . -type f -print > ${FDO_FILELIST}/temp.lst
+    find . -type l -print >> ${FDO_FILELIST}/temp.lst
+    cat ${FDO_FILELIST}/orig.lst >> ${FDO_FILELIST}/temp.lst
+    sort ${FDO_FILELIST}/temp.lst | uniq -u > ${FDO_FILELIST}/${PROVIDER}.lst
+    find . -type d -print | sort > ${FDO_FILELIST}/temp.lst
+    cat ${FDO_FILELIST}/origdir.lst >> ${FDO_FILELIST}/temp.lst
+    sort ${FDO_FILELIST}/temp.lst | uniq -u > ${FDO_FILELIST}/${PROVIDER}dir.lst
+    popd
 }
 
 BUILDROOT=`pwd`
@@ -93,16 +103,16 @@
 PRESERVE_BUILD_ROOT=1
 CMAKE=0
 
-FDO_SRC=/home/vagrant/fdo/trunk
+MY_HOME_DIR=/home/vagrant
+FDO_SRC=${MY_HOME_DIR}/fdo/trunk
 #FDO_SRC=http://svn.osgeo.org/fdo/trunk
 FDO_BUILD_AREA=${BUILDROOT}/fdo_build_area
 FDO_FILELIST=${FDO_BUILD_AREA}/install/filelist
 
 shim_thirdparty_lib_paths()
 {
+    # Note: This is an Ubuntu-only code path
     echo "[info]: Shimming include/lib paths"
-    # Note:
-    #
     # FDO assumes you're going to be linking against an SDK whose directory structure
     # is different from how system dev libraries are installed on Ubuntu, so we leverage the
     # power of symlinks to set up the expected directory structure that points to the system
@@ -113,41 +123,47 @@
     #
     #   libmysqlclient-dev libpq-dev
     #
-    mkdir -p ~/fdo_rdbms_thirdparty_system/pgsql/$FDO_CPU
+    mkdir -p ${MY_HOME_DIR}/fdo_rdbms_thirdparty_system/pgsql/$FDO_CPU
     # PostgreSQL include path
-    if [ ! -d ~/fdo_rdbms_thirdparty_system/pgsql/$FDO_CPU/include ];
+    if [ ! -d ${MY_HOME_DIR}/fdo_rdbms_thirdparty_system/pgsql/$FDO_CPU/include ];
     then
-        ln -s /usr/include/postgresql ~/fdo_rdbms_thirdparty_system/pgsql/$FDO_CPU/include
+        ln -s /usr/include/postgresql ${MY_HOME_DIR}/fdo_rdbms_thirdparty_system/pgsql/$FDO_CPU/include
         echo "[info]: Symlinked PostgreSQL include path"
     else
         echo "[info]: PostgreSQL include path already symlinked"
     fi
     # PostgreSQL lib path
-    if [ ! -d ~/fdo_rdbms_thirdparty_system/pgsql/$FDO_CPU/$LIB_DIRNAME ];
+    if [ ! -d ${MY_HOME_DIR}/fdo_rdbms_thirdparty_system/pgsql/$FDO_CPU/$LIB_DIRNAME ];
     then
-        ln -s /usr/lib ~/fdo_rdbms_thirdparty_system/pgsql/$FDO_CPU/$LIB_DIRNAME
-        echo "[info]: Symlinked PostgreSQL lib path"
+        if [ ${FDO_PLATFORM} -eq 32 ];
+        then 
+            ln -s /usr/lib ${MY_HOME_DIR}/fdo_rdbms_thirdparty_system/pgsql/$FDO_CPU/$LIB_DIRNAME
+            echo "[info]: Symlinked PostgreSQL lib path (x86)"
+        else
+            ln -s /usr/lib64 ${MY_HOME_DIR}/fdo_rdbms_thirdparty_system/pgsql/$FDO_CPU/$LIB_DIRNAME
+            echo "[info]: Symlinked PostgreSQL lib path (x64)"
+        fi
     else
         echo "[info]: PostgreSQL lib path already symlinked"
     fi
-    mkdir -p ~/fdo_rdbms_thirdparty_system/mysql/$FDO_CPU
+    mkdir -p ${MY_HOME_DIR}/fdo_rdbms_thirdparty_system/mysql/$FDO_CPU
     # MySQL include path
-    if [ ! -d ~/fdo_rdbms_thirdparty_system/mysql/$FDO_CPU/include ];
+    if [ ! -d ${MY_HOME_DIR}/fdo_rdbms_thirdparty_system/mysql/$FDO_CPU/include ];
     then
-        ln -s /usr/include/mysql ~/fdo_rdbms_thirdparty_system/mysql/$FDO_CPU/include
+        ln -s /usr/include/mysql ${MY_HOME_DIR}/fdo_rdbms_thirdparty_system/mysql/$FDO_CPU/include
         echo "[info]: Symlinked MySQL include path"
     else
         echo "[info]: MySQL include path already symlinked"
     fi
     # MySQL lib path
-    if [ ! -d ~/fdo_rdbms_thirdparty_system/mysql/$FDO_CPU/$LIB_DIRNAME ];
+    if [ ! -d ${MY_HOME_DIR}/fdo_rdbms_thirdparty_system/mysql/$FDO_CPU/$LIB_DIRNAME ];
     then
         if [ ${FDO_PLATFORM} -eq 32 ]; 
         then
-            ln -s /usr/lib/i386-linux-gnu ~/fdo_rdbms_thirdparty_system/mysql/$FDO_CPU/$LIB_DIRNAME
+            ln -s /usr/lib/i386-linux-gnu ${MY_HOME_DIR}/fdo_rdbms_thirdparty_system/mysql/$FDO_CPU/$LIB_DIRNAME
             echo "[info]: Symlinked MySQL lib path (x86)"
         else
-            ln -s /usr/lib/x86_64-linux-gnu ~/fdo_rdbms_thirdparty_system/mysql/$FDO_CPU/$LIB_DIRNAME
+            ln -s /usr/lib/x86_64-linux-gnu ${MY_HOME_DIR}/fdo_rdbms_thirdparty_system/mysql/$FDO_CPU/$LIB_DIRNAME
             echo "[info]: Symlinked MySQL lib path (x64)"
         fi
     else
@@ -157,24 +173,228 @@
 
 modify_sdk_paths()
 {
+    rm -f $FDO_BUILD_AREA/setenvironment.sh
+
     if [ ${UBUNTU} -eq 1 ];
     then
-        echo "[info]: Updating setenvironment.sh"
-	    sed -i 's/export FDOMYSQL=$FDOTHIRDPARTY\/mysql\/rhlinux/export FDOMYSQL=\/home\/vagrant\/fdo_rdbms_thirdparty_system\/mysql\/'"$FDO_CPU"'/g' ${FDO_BUILD_AREA}/setenvironment.sh
-	    sed -i 's/export FDOPOSTGRESQL=$FDOTHIRDPARTY\/pgsql/export FDOPOSTGRESQL=\/home\/vagrant\/fdo_rdbms_thirdparty_system\/pgsql\/'"$FDO_CPU"'/g' ${FDO_BUILD_AREA}/setenvironment.sh
+        # GCC 4.8 is causing too much instability, so downgrade one version
+        #GCCVER=4.7
+        #export GCCVER
+        #CC=gcc-$GCCVER
+        #export CC
+        #CXX=g++-$GCCVER
+        #export CXX
+        #echo "[info]: Using GCC $GCCVER for Ubuntu"
+        shim_thirdparty_lib_paths
+        
+        # Nuke the existing copies of openssl and libcurl and replace them with directories
+        # that symlink to system-installed headers/libs
+        rm -rf $FDO_BUILD_AREA/Thirdparty/openssl
+        rm -rf $FDO_BUILD_AREA/Thirdparty/libcurl
+        
+        # symlink libcurl to system installed copy
+        mkdir -p $FDO_BUILD_AREA/Thirdparty/libcurl/include
+        if [ ! -e $FDO_BUILD_AREA/Thirdparty/libcurl/include/curl ];
+        then
+            ln -s /usr/include/curl $FDO_BUILD_AREA/Thirdparty/libcurl/include/curl
+        fi
+        # Stub build.sh for libcurl
+        echo "#!/bin/bash" > $FDO_BUILD_AREA/Thirdparty/libcurl/build.sh
+        echo "exit 0" >> $FDO_BUILD_AREA/Thirdparty/libcurl/build.sh
+        mkdir -p $FDO_BUILD_AREA/Thirdparty/libcurl/lib
+        if [ ! -e $FDO_BUILD_AREA/Thirdparty/libcurl/lib/linux ];
+        then
+            ln -s /usr/lib/i386-linux-gnu $FDO_BUILD_AREA/Thirdparty/libcurl/lib/linux
+        fi
+
+        # symlink openssl to system installed copy
+        mkdir -p $FDO_BUILD_AREA/Thirdparty/openssl/include
+        if [ ! -e $FDO_BUILD_AREA/Thirdparty/openssl/include/openssl ];
+        then
+            ln -s /usr/include/openssl $FDO_BUILD_AREA/Thirdparty/openssl/include/openssl
+        fi
+        # Stub openssl for libcurl
+        echo "#!/bin/bash" > $FDO_BUILD_AREA/Thirdparty/openssl/build.sh
+        echo "exit 0" >> $FDO_BUILD_AREA/Thirdparty/openssl/build.sh
+        mkdir -p $FDO_BUILD_AREA/Thirdparty/openssl/lib
+        if [ ! -e $FDO_BUILD_AREA/Thirdparty/openssl/lib/linux ];
+        then
+            ln -s /usr/lib/i386-linux-gnu $FDO_BUILD_AREA/Thirdparty/openssl/lib/linux
+        fi
+        echo "[info]: Replace internal openssl/libcurl with symlinks to Ubuntu-installed copies"
+    fi
+
+    # Rather than going through the hassle of modifying setenvironment.sh
+    # Let's just inline the logic here and make the distro-specific changes
+    echo "[info]: Setting environment variables for FDO"
+
+    # Fully-qualfied location of the FDO files
+    export FDO=$FDO_BUILD_AREA/Fdo
+    if test ! -e "$FDO"; then
+       echo ""
+       echo "Invalid FDO path provided. "
+       echo "The setenvironment script sets the default value to: "
+       echo "$FDO"
+       echo "Please modify the setenvironment.sh script with a valid path."
+       echo ""
+    fi
+
+    # Fully-qualfied location of the FDO Utility files
+    export FDOUTILITIES=$FDO_BUILD_AREA/Utilities
+    if test ! -e "$FDOUTILITIES"; then
+       echo ""
+       echo "Invalid FDO Utilities path provided. "
+       echo "The setenvironment script sets the default value to: "
+       echo "$FDOUTILITIES" 
+       echo ""
+    fi
+
+    # Fully-qualfied location of the FDO Thirdparty files
+    #
+    # Note: This value is completely disregarded and rewritten by FDO's configure script
+    # but we still set it here as it forms the basis of other env vars below
+    export FDOTHIRDPARTY=$FDO_BUILD_AREA/Thirdparty
+    if test ! -e "$FDOTHIRDPARTY"; then
+       echo ""
+       echo "Invalid FDO Thirdparty path provided. "
+       echo "The setenvironment script sets the default value to: "
+       echo "$FDOTHIRDPARTY"
+       echo ""
+    fi
+
+    # Fully-qualfied location of the ESRI ArcSDE SDK
+    export SDEHOME=$FDOTHIRDPARTY/ESRI/ArcSDEClient931/Linux
+    if test ! -e "$SDEHOME"; then
+       echo ""
+       echo "NOTE: The default location for the ArcSDE client SDK files"
+       echo "was not found. The setenvironment script sets the default value to: "
+       echo "$FDOTHIRDPARTY/ESRI/ArcSDEClient91/Linux. "
+       echo ""
+    fi
+
+    # Fully-qualfied location of the GDAL Installation
+    export FDOGDAL=$FDOTHIRDPARTY/gdal
+       echo ""
+       echo "NOTE: The setenvironment.sh script sets the installation location for "
+       echo "the GDAL SDK files to $FDOTHIRDPARTY/gdal. "
+       echo "If this value remains unchanged, the FDO build process will"
+       echo "build the version of GDAL located in Thirdparty/gdal and will "
+       echo "install the resulting libraries in /usr/local/fdo-3.9.0. The FDO build"
+       echo "process will then use that location when building the GDAL and"
+       echo "WMS providers. If you wish to build the FDO GDAL or WMS Providers"
+       echo "using a previously installed version of GDAL, modify the setenvironment.sh "
+       echo "script and set FDOGDAL to point to the existing GDAL installation."
+       echo "For example: /user/local (The default GDAL installation path)."
+    echo ""
+
+    # Fully-qualfied location of the ODBC SDK
+    export FDOODBC=/usr
+    if test ! -e "$FDOODBC"; then
+       echo ""
+       echo "NOTE: The default path for the ODBC SDK files was not found. "
+       echo "The setenvironment script sets the default value to: "
+       echo "$FDOODBC"
+       echo ""
+    fi
+
+    # Location of the PYTHON lib files. Typically in /usr/lib/pythonXXX
+    export PYTHON_LIB_PATH=/usr/lib/python2.4
+    if test ! -e "$PYTHON_LIB_PATH"; then
+       echo ""
+       echo "NOTE: The default path for the Python SDK lib files was not found. "
+       echo "The setenvironment script sets the default value to: "
+       echo "$PYTHON_LIB_PATH"
+       echo "lib files."
+       echo ""
+    fi
+
+    # Location of the PYTHON include files. Typically in /usr/include/pythonXXX
+    export PYTHON_INCLUDE_PATH=/usr/include/python2.4
+    if test ! -e "$PYTHON_INCLUDE_PATH"; then
+       echo ""
+       echo "NOTE: The default path for the Python SDK header files was not found. "
+       echo "The setenvironment script sets the default value to: "
+       echo "$PYTHON_INCLUDE_PATH"
+       echo "include files."
+       echo ""
+    fi
+
+    # Buildbot hack (mloskot): if the script is called with single dummy
+    # parameter no installation directory is created, ie.:
+    # $ source ./setenvironment.sh --noinstall
+    if test ! $# -eq 1; then
+        mkdir -p "/usr/local/fdo-${FDO_VER_FULL}/lib"
+        export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/fdo-${FDO_VER_FULL}/lib:$SDEHOME/lib
+    fi
+
+    export XERCESCROOT=$FDOTHIRDPARTY/apache/xerces
+    export XALANCROOT=$FDOTHIRDPARTY/apache/xalan
+    export NLSDIR=$XALANCROOT/src/xalanc/NLS
+    export FDOORACLE=${MY_HOME_DIR}/fdo_rdbms_thirdparty/oracle/${FDO_CPU}/instantclient_11_2/sdk
+
+    # Depending on distro, MySQL and PostgreSQL take different paths here
+    if [ ${UBUNTU} -eq 1 ];
+    then
+        export FDOMYSQL=${MY_HOME_DIR}/fdo_rdbms_thirdparty_system/mysql/${FDO_CPU}
+        export FDOPOSTGRESQL=${MY_HOME_DIR}/fdo_rdbms_thirdparty_system/pgsql/${FDO_CPU}
+        
+        # Also need to patch some FDO thirdparty build scripts to accept our non-default compiler
+        #echo "[info]: Patching mkcatdefs build script"
+        #sed -i 's/gcc -DLINUX -g/'"$CC"' -DLINUX -g/g' ${FDO_BUILD_AREA}/Thirdparty/linux/mkcatdefs/src/build
+        #echo "[info]: Patching xalan/xerces build script"
+        #sed -i 's/.\/runConfigure -p linux -P/.\/runConfigure -p linux -c '"$CC"' -x '"$CXX"' -P/g' ${FDO_BUILD_AREA}/Thirdparty/apache/build2.sha
+        #echo "[info]: Patching boost build script"
+        #sed -i 's/# using gcc : 3.2 : g++-3.2 ;/using gcc : '"$GCCVER"' : '"$CXX"' ;/g' ${FDO_BUILD_AREA}/Thirdparty/boost/tools/build/v2/user-config.jam
+        #sed -i 's/.\/b2 toolset=gcc/.\/b2 toolset='"$CC"'/g' ${FDO_BUILD_AREA}/Thirdparty/boost/build.sh
     else
-        echo "[info]: Updating setenvironment.sh"
-	    # Note: Change your paths here if they're different
-	    sed -i 's/export FDOMYSQL=$FDOTHIRDPARTY\/mysql\/rhlinux/export FDOMYSQL=\/home\/vagrant\/fdo_rdbms_thirdparty\/mysql\/'"$FDO_CPU"'/g' ${FDO_BUILD_AREA}/setenvironment.sh
-	    sed -i 's/export FDOPOSTGRESQL=$FDOTHIRDPARTY\/pgsql/export FDOPOSTGRESQL=\/home\/vagrant\/fdo_rdbms_thirdparty\/pgsql/g' ${FDO_BUILD_AREA}/setenvironment.sh
+        # Note: Change your paths here if they're different
+        export FDOMYSQL=${MY_HOME_DIR}/fdo_rdbms_thirdparty/mysql/${FDO_CPU}
+        export FDOPOSTGRESQL=${MY_HOME_DIR}/fdo_rdbms_thirdparty/pgsql
     fi
-	echo "export FDOORACLE=/home/vagrant/fdo_rdbms_thirdparty/oracle/${FDO_CPU}/instantclient_11_2/sdk" >> ${FDO_BUILD_AREA}/setenvironment.sh
+
+    # Check MySQL path
+    if test ! -e "$FDOMYSQL"; then
+       echo ""
+       echo "NOTE: The default location for the MySQL SDK files "
+       echo "was not found. The setenvironment script sets the default value to: "
+       echo "$FDOTHIRDPARTY/mysql/rhlinux "
+       echo "Your configured path was: $FDOMYSQL"
+       echo ""
+    fi
+
+    # Check PostgreSQL path
+    if test ! -e "$FDOPOSTGRESQL"; then
+       echo ""
+       echo "NOTE: The default path for the PostgreSQL SDK files was not found. "
+       echo "The setenvironment script sets the default value to: "
+       echo "$FDOPOSTGRESQL"
+       echo "Your configured path was: $FDOPOSTGRESQL"
+       echo ""
+    fi
+
+    echo "******* Environment variable summary *********"
+    echo "FDO: $FDO"
+    echo "FDOUTILITIES: $FDOUTILITIES"
+    echo "FDOTHIRDPARTY: $FDOTHIRDPARTY"
+    echo "SDEHOME: $SDEHOME"
+    echo "FDOGDAL: $FDOGDAL"
+    echo "FDOODBC: $FDOODBC"
+    echo "PYTHON_LIB_PATH: $PYTHON_LIB_PATH"
+    echo "PYTHON_INCLUDE_PATH: $PYTHON_INCLUDE_PATH"
+    echo "XERCESCROOT: $XERCESCROOT"
+    echo "XALANCROOT: $XALANCROOT"
+    echo "NLSDIR: $NLSDIR"
+    echo "FDOORACLE: $FDOORACLE"
+    echo "FDOMYSQL: $FDOMYSQL"
+    echo "FDOPOSTGRESQL: $FDOPOSTGRESQL"
+    echo "**********************************************"
+    echo ""
 }
 
 # Must have root
 if [[ $EUID -ne 0 ]]; then
-	echo "[error]: You must run this script with superuser privileges"
-	exit 1
+    echo "[error]: You must run this script with superuser privileges"
+    exit 1
 fi
 
 echo "***********************************************************"
@@ -184,99 +404,90 @@
 echo " FDO CPU Target: ${FDO_BUILD_CPU}"
 echo " CMake build: ${CMAKE}"
 echo " Is Ubuntu?: ${UBUNTU}"
+echo " Debug build: ${FDO_DEBUG}"
 echo " Export from local SVN checkout: ${LOCALSVN}"
 echo " Re-use previous build area: ${PRESERVE_BUILD_ROOT}"
 echo "***********************************************************"
 start_time=`date +%s`
 REVISION=`svn info ${FDO_SRC} | perl revnum.pl`
 
-if [ ${UBUNTU} -eq 1 ];
-then
-    shim_thirdparty_lib_paths
-fi
-
 if [ -d ${FDO_INST} ];
 then
-	echo "[info]: Deleting directory ${FDO_INST} before build"
-	rm -rf ${FDO_INST}
+    echo "[info]: Deleting directory ${FDO_INST} before build"
+    rm -rf ${FDO_INST}
 else
-	echo "[info]: ${FDO_INST} doesn't exist. Continuing build"
+    echo "[info]: ${FDO_INST} doesn't exist. Continuing build"
 fi
 
 if [ ${CMAKE} -eq 1 ];
 then
-	echo "[error]: CMake build of FDO not supported yet"
-	exit 1
+    echo "[error]: CMake build of FDO not supported yet"
+    exit 1
 else
-	echo "[info]: Using automake build"
-	if [ -d ${FDO_BUILD_AREA} ];
-	then
-		if [ ${PRESERVE_BUILD_ROOT} -eq 1 ];
-		then
-			echo "[info]: FDO build area ${FDO_BUILD_AREA} exists. Going straight to build"
-			modify_sdk_paths
-		else
-			echo "[info]: Removing old FDO build area at ${FDO_BUILD_AREA}"
-			rm -rf ${FDO_BUILD_AREA}
-			if [ ${LOCALSVN} -eq 1 ] 
-			then
-				svn export -q ${FDO_SRC} ${FDO_BUILD_AREA}
-				modify_sdk_paths
-			else
-				echo "[info]: Performing fresh SVN export of ${FDO_SRC} (r${REVISION}) to ${FDO_BUILD_AREA}"
-				svn export -q -r ${REVISION} ${FDO_SRC} ${FDO_BUILD_AREA}
-				modify_sdk_paths
-			fi
-		fi
-	else
-		echo "[info]: FDO build area ${FDO_BUILD_AREA} does not exist. Doing svn export"
-		echo "[info]: Exporting svn revision ${REVISION}"
-		if [ ${LOCALSVN} -eq 1 ] 
-		then
-			svn export -q ${FDO_SRC} ${FDO_BUILD_AREA}
-			modify_sdk_paths
-		else
-			echo "[info]: Performing fresh SVN export of ${FDO_SRC} (r${REVISION}) to ${FDO_BUILD_AREA}"
-			svn export -q -r ${REVISION} ${FDO_SRC} ${FDO_BUILD_AREA}
-			modify_sdk_paths
-		fi
-	fi
+    echo "[info]: Using automake build"
+    if [ -d ${FDO_BUILD_AREA} ];
+    then
+        if [ ${PRESERVE_BUILD_ROOT} -eq 1 ];
+        then
+            echo "[info]: FDO build area ${FDO_BUILD_AREA} exists. Going straight to build"
+            modify_sdk_paths
+        else
+            echo "[info]: Removing old FDO build area at ${FDO_BUILD_AREA}"
+            rm -rf ${FDO_BUILD_AREA}
+            if [ ${LOCALSVN} -eq 1 ] 
+            then
+                svn export -q ${FDO_SRC} ${FDO_BUILD_AREA}
+                modify_sdk_paths
+            else
+                echo "[info]: Performing fresh SVN export of ${FDO_SRC} (r${REVISION}) to ${FDO_BUILD_AREA}"
+                svn export -q -r ${REVISION} ${FDO_SRC} ${FDO_BUILD_AREA}
+                modify_sdk_paths
+            fi
+        fi
+    else
+        echo "[info]: FDO build area ${FDO_BUILD_AREA} does not exist. Doing svn export"
+        echo "[info]: Exporting svn revision ${REVISION}"
+        if [ ${LOCALSVN} -eq 1 ] 
+        then
+            svn export -q ${FDO_SRC} ${FDO_BUILD_AREA}
+            modify_sdk_paths
+        else
+            echo "[info]: Performing fresh SVN export of ${FDO_SRC} (r${REVISION}) to ${FDO_BUILD_AREA}"
+            svn export -q -r ${REVISION} ${FDO_SRC} ${FDO_BUILD_AREA}
+            modify_sdk_paths
+        fi
+    fi
 fi
 
 echo "[info]: Building FDO (${FDO_VER_MAJOR}.${FDO_VER_MINOR}.${FDO_VER_REV}) rev (${REVISION})"
 cd ${FDO_BUILD_AREA}
-source ./setenvironment.sh
-if [ ! -d ${FDO_INST} ];
-then
-	echo "[error]: FDO install directory ${FDO_INST} doesn't exist. setenvironment.sh should've created this directory. Ensure the FDO version number in this script is correct"
-	exit 1;
-fi
+
 FDO_BUILD_COMPONENT="FDO Thirdparty"
-./build_thirdparty.sh -b ${FDO_PLATFORM}
+./build_thirdparty.sh -b ${FDO_PLATFORM} ${FDO_BUILD_FLAGS}
 check_build
 
 if [ ${CMAKE} -eq 1 ];
 then
-	FDO_BUILD_COMPONENT="FDO (cmake)"
-	echo "[error]: CMake build of FDO not supported yet"
-	exit 1;
+    FDO_BUILD_COMPONENT="FDO (cmake)"
+    echo "[error]: CMake build of FDO not supported yet"
+    exit 1;
 else
-	#NOTE: We never build ArcSDE provider because we haven't paid the ESRI tax for their ArcSDE SDK
-	for comp in fdocore fdo utilities
-	do
-		FDO_BUILD_COMPONENT="$comp (automake)"
-		./build_linux.sh --w $comp --p ${FDO_INST} --b ${FDO_PLATFORM}
-		update_fdocore_file_list
-		check_build
-	done
-	for comp in shp sqlite gdal ogr wfs wms rdbms kingoracle sdf
-	do
-		save_current_file_list
-		FDO_BUILD_COMPONENT="$comp (automake)"
-		./build_linux.sh --w $comp --p ${FDO_INST} --b ${FDO_PLATFORM}
-		update_provider_file_list $comp
-		check_build
-	done
+    #NOTE: We never build ArcSDE provider because we haven't paid the ESRI tax for their ArcSDE SDK
+    for comp in fdocore fdo utilities
+    do
+        FDO_BUILD_COMPONENT="$comp (automake)"
+        ./build_linux.sh --w $comp --p ${FDO_INST} --b ${FDO_PLATFORM} ${FDO_BUILD_FLAGS}
+        update_fdocore_file_list
+        check_build
+    done
+    for comp in shp sqlite gdal ogr wfs wms rdbms kingoracle sdf
+    do
+        save_current_file_list
+        FDO_BUILD_COMPONENT="$comp (automake)"
+        ./build_linux.sh --w $comp --p ${FDO_INST} --b ${FDO_PLATFORM} ${FDO_BUILD_FLAGS}
+        update_provider_file_list $comp
+        check_build
+    done
 fi
 check_fdo_lib libFDO
 check_fdo_lib libExpressionEngine
@@ -302,33 +513,38 @@
 
 end_time=`date +%s`
 
-FDO_BUILD_COMPONENT="Remove .la files from ${FDO_INST}"
-# Remove .la files from lib directory
-rm -f ${FDO_INST}/lib/*.la
-check_build
+if [ $FDO_DEBUG -eq 0 ];
+then
+    FDO_BUILD_COMPONENT="Remove .la files from ${FDO_INST}"
+    # Remove .la files from lib directory
+    rm -f ${FDO_INST}/lib/*.la
+    check_build
 
-FDO_BUILD_COMPONENT="Strip so symbols and remove execute flag"
-# Remove unneeded symbols from files in the lib directory
-# and make them non-executable
-for file in `find ${FDO_INST}/lib/lib*.so* -type f -print`
-do
-	strip --strip-unneeded ${file}
-	chmod a-x ${file}
-done
-check_build
+    FDO_BUILD_COMPONENT="Strip so symbols and remove execute flag"
+    # Remove unneeded symbols from files in the lib directory
+    # and make them non-executable
+    for file in `find ${FDO_INST}/lib/lib*.so* -type f -print`
+    do
+        strip --strip-unneeded ${file}
+        chmod a-x ${file}
+    done
+    check_build
 
-cd $BUILDROOT
-FDO_BUILD_COMPONENT="Make tarball"
-# Create a binary tar ball for FDO
-tar -zcf fdosdk-centos6-${FDO_BUILD_CPU}-${FDO_VER_FULL}_${REVISION}.tar.gz ${FDO_INST}
-check_build
+    FDO_BUILD_COMPONENT="Make tarball"
+    # Create a binary tar ball for FDO
+    cd ${FDO_INST}
+    tar -zcf ${BUILDROOT}/fdosdk-centos6-${FDO_BUILD_CPU}-${FDO_VER_FULL}_${REVISION}.tar.gz *
+    check_build
 
-if [ ${UBUNTU} -eq 1 ];
-then
-cd ${FDO_BUILD_AREA}/install
-dos2unix *
-./dpkgall.sh ${FDO_BUILD_CPU} ${REVISION}
+    if [ ${UBUNTU} -eq 1 ];
+    then
+        cd ${FDO_BUILD_AREA}/install
+        dos2unix *
+        ./dpkgall.sh ${FDO_BUILD_CPU} ${REVISION}
+    fi
+else
+    echo "[info]: Not packaging FDO in debug mode"
 fi
 
 echo "[info]: FDO build complete!"
-echo Main build execution time: `expr $end_time - $start_time` s
+echo Main build execution time: `expr $end_time - $start_time` s
\ No newline at end of file

Deleted: trunk/Tools/Vagrant/scripts/build_oem_ubuntu.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/build_oem_ubuntu.sh	2014-09-29 13:58:02 UTC (rev 8369)
+++ trunk/Tools/Vagrant/scripts/build_oem_ubuntu.sh	2014-09-30 11:37:11 UTC (rev 8370)
@@ -1,653 +0,0 @@
-#
-#! /bin/bash
-#
-
-#
-# MapGuide Open Source build script (tweaked for Ubuntu)
-#
-
-#**********************************************************
-# Initialization
-#**********************************************************
-
-echo "MapGuide Open Source build script for OEM components"
-INSTALLDIR=/usr/local/mapguideopensource
-MY_MAKE_OPTS="-j 2"
-CLEAN_FLAG=0
-while [ $# -gt 0 ]; do    # Until you run out of parameters...
-    case "$1" in
-        -prefix|--prefix)
-            INSTALLDIR="$2"
-            shift
-            ;;
-        -clean|--clean)
-            CLEAN_FLAG=1
-            shift
-            ;;
-        -help|--help)
-            echo "Usage: $0 (options)"
-            echo "Options:"
-            echo "  --prefix [installation directory]"
-            echo "  --clean [clean all objects and binaries in Oem]"
-            echo "  --help [Display usage]"
-            exit
-            ;;
-    esac
-    shift   # Check next set of parameters.
-done
-
-echo "OEM Build Initialization ............................"
-echo "Oem Libraries will be installed at: ${INSTALLDIR}"
-
-LIB_NAME=""
-
-#**********************************************************
-# Generic Functions
-#**********************************************************
-
-check_build()
-{
-    error=$?
-    if [ $error -ne 0 ]; then
-        echo "$LIB_NAME: Error build failed ($error)................."
-        exit $error
-    fi
-}
-
-check_clean()
-{
-    error=$?
-    if [ $error -ne 0 ]; then
-        echo "$LIB_NAME: Error clean failed ($error)................."
-        exit $error
-    fi
-}
-
-#**********************************************************
-# Build ACE 5.7
-# Notes: none
-#**********************************************************
-
-init_ace()
-{
-    LIB_NAME="ACE 5.7"
-}
-
-build_ace()
-{
-    pushd ACE/ACE_wrappers
-    ACE_PATH="${PWD}"
-    pushd ace
-    env ACE_ROOT="${ACE_PATH}" make $MY_MAKE_OPTS
-    check_build
-    popd
-    popd
-}
-
-clean_ace()
-{
-    pushd ACE/ACE_wrappers
-    ACE_PATH="${PWD}"
-    pushd ace
-    env ACE_ROOT="${ACE_PATH}" make clean
-    check_clean
-    popd
-    popd
-}
-
-#**********************************************************
-# Build DWFCORE 1.0
-# Notes: none
-#**********************************************************
-
-init_dwfcore()
-{
-    LIB_NAME="DWFCORE 1.0"
-    pushd DWFTK7.1/develop/global/build/gnu/dwfcore
-    sh ./build_setup.sh
-    popd
-}
-
-build_dwfcore()
-{
-    pushd DWFTK7.1/develop/global/src/dwfcore
-    sh ./configure --enable-optimized --prefix="${INSTALLDIR}"
-    make $MY_MAKE_OPTS
-    check_build
-    popd
-}
-
-clean_dwfcore()
-{
-    pushd DWFTK7.1/develop/global/src/dwfcore
-    make clean
-    check_clean
-    popd
-}
-
-#**********************************************************
-# Build DWFTOOLKIT 7.1
-# Notes: none
-#**********************************************************
-
-init_dwftk()
-{
-    LIB_NAME="DWFTK 7.1"
-    pushd DWFTK7.1/develop/global/build/gnu/dwftoolkit
-    sh ./build_setup.sh
-    popd
-}
-
-build_dwftk()
-{
-    pushd DWFTK7.1/develop/global/src/dwf
-    sh ./configure --enable-optimized --prefix="${INSTALLDIR}"
-    make $MY_MAKE_OPTS
-    check_build
-    popd
-}
-
-clean_dwftk()
-{
-    pushd DWFTK7.1/develop/global/src/dwf
-    make clean
-    check_clean
-    popd
-}
-
-#**********************************************************
-# Build DWFEMAP 1.0
-# Notes: none
-#**********************************************************
-
-init_dwfemap()
-{
-    LIB_NAME="DWFEMAP 1.0"
-    pushd DWFTK7.1/develop/global/build/gnu/dwfemap
-    sh ./build_setup.sh
-    popd
-}
-
-build_dwfemap()
-{
-    pushd DWFTK7.1/develop/global/src/dwfemap
-    sh ./configure --enable-optimized --prefix="${INSTALLDIR}"
-    make $MY_MAKE_OPTS
-    check_build
-    popd
-}
-
-clean_dwfemap()
-{
-    pushd DWFTK7.1/develop/global/src/dwfemap
-    make clean
-    check_clean
-    popd
-}
-
-#**********************************************************
-# Build GEOS 2.2.0
-# Notes: none
-#**********************************************************
-
-init_geos()
-{
-    LIB_NAME="GEOS 2.2.0"
-}
-
-build_geos()
-{
-    pushd geos-2.2.0
-    # Force regen to take into account our modified configure.in
-    aclocal -I macros
-    libtoolize --copy --force
-    autoconf
-    automake --add-missing --copy --force-missing
-    if [ $(uname -m) = "x86_64" ]; then
-        sh ./configure --with-pic --prefix="${INSTALLDIR}"
-    else
-        sh ./configure --prefix="${INSTALLDIR}"
-    fi
-    make $MY_MAKE_OPTS
-    # The check build is disabled as the build will fail with automake version < 2.59
-    # check_build
-    popd
-}
-
-clean_geos()
-{
-    pushd geos-2.2.0
-    make clean
-    check_clean
-    popd
-}
-
-#**********************************************************
-# Build PHP 5.5.11
-# Notes: Configure PHP source tree for building PHP extension
-#**********************************************************
-
-init_php()
-{
-    LIB_NAME="PHP 5.5.11"
-}
-
-build_php()
-{
-    # Nothing to do here. build_apt.sh builds PHP
-    pushd LinuxApt/php-5.5.11
-    popd
-}
-
-clean_php()
-{
-    pushd LinuxApt/php-5.5.11
-    make distclean
-    check_clean
-    popd
-}
-
-#**********************************************************
-# Build SWIGEx 1.0
-# Notes: none
-#**********************************************************
-
-init_swigex()
-{
-    LIB_NAME="SWIGEx 1.0"
-}
-
-build_swigex()
-{
-    pushd SWIGEx
-    mkdir -p Linux/obj/release
-    make $MY_MAKE_OPTS
-    check_build
-    popd
-}
-
-clean_swigex()
-{
-    pushd SWIGEx
-    # Note: the qmake system is required to regenerate the Makefile.
-    #       This is disabled.
-    # make clean
-    # check_clean
-    popd
-}
-
-#**********************************************************
-# Build BDBXML
-# Notes: none
-#**********************************************************
-
-init_bdbxml()
-{
-    LIB_NAME="BDBXML"
-}
-
-build_bdbxml()
-{
-    # Need to force regen of the correct xerces config header before building dbxml proper
-    pushd dbxml/xerces-c-src
-    sh ./configure
-    popd
-    # Also need to check and set executable flag for s_paths
-    pushd dbxml/dbxml/dist
-    chmod +x s_paths
-    popd
-    pushd dbxml
-    sh ./buildall.sh
-    check_build
-    popd
-}
-
-clean_bdbxml()
-{
-    pushd dbxml
-    sh ./buildall.sh --clean
-    check_clean
-    popd
-}
-
-#**********************************************************
-# Build CPPUNIT 1.9.14
-# Notes: none
-#**********************************************************
-
-init_cppunit()
-{
-    LIB_NAME="CPPUNIT 1.9.14"
-}
-
-build_cppunit()
-{
-    pushd CppUnit-1.9.14
-    # the configure script as-is is incompatible with ubuntu, so regen it
-    aclocal -I config
-    libtoolize --copy --force
-    autoconf
-    automake --add-missing --copy --force-missing
-    # -ldl is to prevent undefined reference to dlsym/dlopen/dlclose
-    sh ./configure --prefix="${INSTALLDIR}" LDFLAGS="-ldl"
-    make $MY_MAKE_OPTS
-    check_build
-    popd
-}
-
-clean_cppunit()
-{
-    pushd CppUnit-1.9.14
-    sh ./configure --prefix="${INSTALLDIR}"
-    make clean
-    check_clean
-    popd
-}
-
-#**********************************************************
-# Build IMake 1.0
-# Notes: none
-#**********************************************************
-
-init_imake()
-{
-    LIB_NAME="IMake 1.0"
-}
-
-build_imake()
-{
-    pushd ../BuildTools/WebTools/IMake
-    mkdir -p Linux/obj/debug
-    make $MY_MAKE_OPTS
-    check_build
-    popd
-}
-
-clean_imake()
-{
-    pushd ../BuildTools/WebTools/IMake
-    # Note: does not support clean as qmake is needed to regenerate the Makefile.
-    # make clean
-    # check_clean
-    popd
-}
-
-#**********************************************************
-# Build ZLIB 1.2.3
-# Notes: none
-#**********************************************************
-
-init_zlib()
-{
-    LIB_NAME="ZLIB 1.2.3"
-}
-
-build_zlib()
-{
-    pushd gd/zlib
-    sh ./configure
-    make $MY_MAKE_OPTS
-    check_build
-    popd
-}
-
-clean_zlib()
-{
-    pushd gd/zlib
-    make clean
-    check_clean
-    popd
-}
-
-#**********************************************************
-# Build LIBPNG 1.2.8
-# Notes: none
-#**********************************************************
-
-init_libpng()
-{
-    LIB_NAME="LIBPNG 1.2.8"
-}
-
-build_libpng()
-{
-    pushd gd/lpng
-    cp scripts/makefile.std makefile
-    if [ $(uname -m) = "x86_64" ]; then
-        #Inject -fPIC to CFLAGS for 64-bit
-        sed 's/^CFLAGS=/CFLAGS= -fPIC /g' makefile > makefile64
-        make -fmakefile64 $MY_MAKE_OPTS
-    else
-        make $MY_MAKE_OPTS
-    fi
-    check_build
-    popd
-}
-
-clean_libpng()
-{
-    pushd gd/lpng
-    make clean
-    check_clean
-    popd
-}
-
-#**********************************************************
-# Build JPEG 6b
-# Notes: none
-#**********************************************************
-
-init_jpeg()
-{
-    LIB_NAME="JPEG 6b"
-}
-
-build_jpeg()
-{
-    pushd gd/jpeg
-    if [ $(uname -m) = "x86_64" ]; then
-        sh ./configure --enable-static --disable-shared
-        #--with-pic does nothing (probably ancient configure script), so do some sed trickery
-        #to inject this flag. Know a better way? Enlighten us :)
-        sed 's/^CFLAGS=/CFLAGS= -fPIC/g' Makefile > Makefile64
-        make -fMakefile64 $MY_MAKE_OPTS
-    else
-        sh ./configure --enable-static --disable-shared
-        make $MY_MAKE_OPTS
-    fi
-    check_build
-    popd
-}
-
-clean_jpeg()
-{
-    pushd gd/jpeg
-    make clean
-    check_clean
-    popd
-}
-
-#**********************************************************
-# Build FREETYPE 2.1.10
-# Notes: none
-#**********************************************************
-
-init_freetype()
-{
-    LIB_NAME="FREETYPE 2.1.10"
-}
-
-build_freetype()
-{
-    pushd gd/freetype
-    if [ $(uname -m) = "x86_64" ]; then
-        sh ./configure --enable-static --disable-shared --with-pic
-    else
-    	sh ./configure --enable-static --disable-shared
-    fi
-    make $MY_MAKE_OPTS
-    check_build
-    popd
-}
-
-clean_freetype()
-{
-    pushd gd/freetype
-    make clean
-    check_clean
-    popd
-}
-
-#**********************************************************
-# Build GD 2.0.33
-# Notes: none
-#**********************************************************
-
-init_gd()
-{
-    LIB_NAME="GD 2.0.33"
-}
-
-build_gd()
-{
-    pushd gd/gd
-    if [ $(uname -m) = "x86_64" ]; then
-        sh ./configure --enable-static --disable-shared --without-fontconfig --with-pic
-    else
-    	sh ./configure --enable-static --disable-shared --without-fontconfig
-    fi
-    make $MY_MAKE_OPTS
-    check_build
-    popd
-}
-
-clean_gd()
-{
-    pushd gd/gd
-    make clean
-    check_clean
-    popd
-}
-
-#**********************************************************
-# Build AGG 2.4
-# Notes: none
-#**********************************************************
-
-init_agg()
-{
-    LIB_NAME="AGG 2.4"
-}
-
-build_agg()
-{
-    pushd agg-2.4
-    if [ $(uname -m) = "x86_64" ]; then
-        make $MY_MAKE_OPTS EXTRACXXFLAGS=-fPIC
-    else
-        make $MY_MAKE_OPTS
-    fi
-    check_build
-    popd
-}
-
-clean_agg()
-{
-    pushd agg-2.4
-    make clean
-    check_clean
-    popd
-}
-
-#**********************************************************
-# Build JSON
-# Notes: none
-#**********************************************************
-
-init_json()
-{
-    LIB_NAME="JSON"
-}
-
-build_json()
-{
-    pushd jsoncpp
-    #Use the scons installed by apt-get
-    scons platform=linux-gcc
-    popd
-}
-
-clean_json()
-{
-    pushd jsoncpp
-    rm -rf lib buildscons dist
-    popd
-}
-
-#**********************************************************
-# Build CSMAP
-# Notes: none
-#**********************************************************
-
-init_csmap()
-{
-    LIB_NAME="CSMAP"
-}
-
-build_csmap()
-{
-    pushd CsMap
-    mkdir -p .libs
-    pushd Source
-    if [ $(uname -m) = "x86_64" ]; then
-        #Need to build CS-Map with -fPIC because linking libraries will be built with -fPIC
-	sed 's/^C_FLG =/C_FLG = -fPIC/g' Library.mak | sed 's/CPP_FLG =/CPP_FLG = -fPIC/g' > Library64.mak
-	make -fLibrary64.mak $MY_MAKE_OPTS
-    else
-    	make -fLibrary.mak $MY_MAKE_OPTS
-    fi
-    cp CsMap.a ../.libs/libCsmap.a
-    popd
-    pushd Dictionaries
-    if [ $(uname -m) = "x86_x64" ]; then
-        #Need to build CS-Map with -fPIC because linking libraries will be built with -fPIC
-        sed 's/^C_FLG =/C_FLG = -fPIC/g' Library.mak | sed 's/CPP_FLG =/CPP_FLG = -fPIC/g' > Compiler64.mak
-	make -fCompiler64.mak $MY_MAKE_OPTS
-    else
-        make -fCompiler.mak $MY_MAKE_OPTS
-    fi
-    ./CS_Comp -b . .
-    popd
-    check_build
-    popd
-}
-
-clean_csmap()
-{
-    pushd CsMap
-    make clean
-    check_clean
-    popd
-}
-
-#**********************************************************
-# Script loop
-#**********************************************************
-
-pushd Oem
-for lib in ace dwfcore dwftk dwfemap geos php swigex bdbxml cppunit imake zlib libpng jpeg freetype gd agg json csmap;
-do
-    echo "$lib: Initialization..........................."
-    init_"$lib"
-
-    if test "$CLEAN_FLAG" = "1"; then
-        echo "$lib: Clean ....................................."
-        clean_"$lib"
-        echo "$lib: Clean Successful .........................."
-    else
-        echo "$lib: Configure/Build ..........................."
-        build_"$lib"
-        echo "$lib: Build Successful .........................."
-    fi
-done
-popd

Added: trunk/Tools/Vagrant/scripts/csmap_optimize.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/csmap_optimize.sh	                        (rev 0)
+++ trunk/Tools/Vagrant/scripts/csmap_optimize.sh	2014-09-30 11:37:11 UTC (rev 8370)
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+# csmap_optimize.sh
+#
+# This script optimizes the size of CS-Map dictionary files by removing references
+# to all country-specific grid files which represents the bulk of the distribution
+# size
+#
+# This script is meant to be called from within dpkgmapguide.sh
+
+EXCLUDEFILE=
+PACKAGENAME=mapguideopensource-coordsys-lite
+PACKAGEDIR=mapguidecoordsyslite
+ROOT=${BUILDROOT}/debian/mapguidecoordsyslite
+TREE=${BUILDROOT}/debian
+CPROOT=${ROOT}/${MGINST}
+DIRLIST="share"
+REMOVELIST="\.a\$ \.la\$ \.c\$ \.o\$ \.mak\$ \.nmk\$"
+STRIPLIST="\.so\$"
+CSMAP_OUT=/tmp/csmap_build_area/share/gis/coordsys
+
+if [ ! -d /tmp/csmap_build_area ]; then
+    mkdir -p /tmp/csmap_build_area
+fi
+
+comment_gdc()
+{
+    GDCFILE=$1
+    sed -i 's/.\\Australia/#.\\Australia/g' $GDCFILE
+    sed -i 's/.\\Canada/#.\\Canada/g' $GDCFILE
+    sed -i 's/.\\France/#.\\France/g' $GDCFILE
+    sed -i 's/.\\Germany/#.\\Germany/g' $GDCFILE
+    sed -i 's/.\\Japan/#.\\Japan/g' $GDCFILE
+    sed -i 's/.\\NewZealand/#.\\NewZealand/g' $GDCFILE
+    sed -i 's/.\\Spain/#.\\Spain/g' $GDCFILE
+    sed -i 's/.\\Switzerland/#.\\Switzerland/g' $GDCFILE
+    sed -i 's/.\\Usa/#.\\Usa/g' $GDCFILE
+    sed -i 's/.\\WW15MGH.GRD/#.\\WW15MGH.GRD/g' $GDCFILE
+    echo "Commented out grid file references in $GDCFILE"
+}
+
+# Copy CS-Map files to build area. We rely on the fact that the MapGuide build system
+# also leaves a copy of the CS_Comp executable in this directory which we'll use to 
+# re-compile our dictionary files after some modifications
+cp -R /${MGINST}/share/gis/coordsys/* /tmp/csmap_build_area
+pushd /tmp/csmap_build_area
+    # Comment out grid file entries in all gdc files
+    for gdcf in *.gdc
+    do
+        comment_gdc $gdcf
+    done
+    # Re-compile
+    ./CS_Comp -b . .
+    if [ ! -d $CSMAP_OUT ]; then
+        mkdir -p $CSMAP_OUT
+    fi
+    # Copy output
+    cp *.CSD $CSMAP_OUT
+    cp NameMapper.csv $CSMAP_OUT
+    cp OSTN02._02 $CSMAP_OUT
+    cp OSTN97._nt $CSMAP_OUT
+popd
+MGINST=tmp/csmap_build_area
+source ./dpkgbuild.sh
+rm -rf /tmp/csmap_build_area

Modified: trunk/Tools/Vagrant/scripts/dpkgbuild.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/dpkgbuild.sh	2014-09-29 13:58:02 UTC (rev 8369)
+++ trunk/Tools/Vagrant/scripts/dpkgbuild.sh	2014-09-30 11:37:11 UTC (rev 8370)
@@ -14,7 +14,13 @@
 for dirname in ${DIRLIST}
 do
   mkdir -p ${CPROOT}/${dirname}
-  cp -ar /${MGINST}/${dirname} ${CPROOT}
+  #cp -ar /${MGINST}/${dirname} ${CPROOT}
+  echo "[rsync] From: /${MGINST}/${dirname}/ To: ${CPROOT}/${dirname}/"
+  if [ -z ${EXCLUDEFILE} ]; then
+    rsync -a /${MGINST}/${dirname}/ ${CPROOT}/${dirname}/
+  else
+    rsync -a --exclude-from=${EXCLUDEFILE} /${MGINST}/${dirname}/ ${CPROOT}/${dirname}/
+  fi
 done
 
 # Remove all files in the REMOVELIST
@@ -46,9 +52,10 @@
 # Shared library symlinks point back to install directory
 # Add install directory to path to compensate
 # Also add FDO libs to path
-export LD_LIBRARY_PATH=/usr/local/fdo-3.5.0/lib:${CPROOT}/lib:/${MGINST}/lib
+export LD_LIBRARY_PATH=/usr/local/fdo-${FDOBUILD}/lib:${CPROOT}/lib:/${MGINST}/lib
+echo "Using LD_LIBRARY_PATH of $LD_LIBRARY_PATH"
 dpkg-shlibdeps -p${PACKAGEDIR} --ignore-missing-info ${CPROOT}/lib/*.so
-dpkg-gensymbols -p"${PACKAGENAME}" -P"debian/${PACKAGEDIR}"
+dpkg-gensymbols -q -p"${PACKAGENAME}" -P"debian/${PACKAGEDIR}"
 export LD_LIBRARY_PATH=
 
 # Now generate a filled in control file for the binary package
@@ -57,7 +64,7 @@
 
 # Build binary package from ROOT
 # And move resulting debian package and lintian results to build directory
-dpkg-deb --build ${ROOT}
+dpkg-deb -Zlzma --build ${ROOT}
 lintian -i debian/${PACKAGEDIR}.deb > tmp/${PACKAGEDIR}.lintian
 mv debian/${PACKAGEDIR}.deb bin/${PACKAGENAME}_${MGBUILD}-${BUILDNUM}_${ARCH}.deb
 popd

Added: trunk/Tools/Vagrant/scripts/dpkgfdo.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/dpkgfdo.sh	                        (rev 0)
+++ trunk/Tools/Vagrant/scripts/dpkgfdo.sh	2014-09-30 11:37:11 UTC (rev 8370)
@@ -0,0 +1,20 @@
+#!/bin/bash
+#ARCH=`arch`
+#REPO=http://svn.osgeo.org/fdo/branches/3.5
+#BUILDNUM=`svn info ${REPO} | awk '/Changed Rev/ {print $4}'`
+ARCH="$1"
+BUILDNUM="$2"
+echo Building FDO arch=${ARCH} buildnum=${BUILDNUM}
+./dpkgfdocore.sh $ARCH $BUILDNUM
+./dpkgfdoprovider.sh $ARCH $BUILDNUM sdf
+./dpkgfdoprovider.sh $ARCH $BUILDNUM shp
+./dpkgfdoprovider.sh $ARCH $BUILDNUM wfs
+./dpkgfdoprovider.sh $ARCH $BUILDNUM wms
+# ArcSDE provider currently disabled due to missing libraries
+#./dpkgfdoprovider.sh $ARCH $BUILDNUM arcsde
+./dpkgfdoprovider.sh $ARCH $BUILDNUM rdbms
+./dpkgfdoprovider.sh $ARCH $BUILDNUM gdal
+./dpkgfdoprovider.sh $ARCH $BUILDNUM ogr
+./dpkgfdoprovider.sh $ARCH $BUILDNUM postgis
+./dpkgfdoprovider.sh $ARCH $BUILDNUM kingoracle
+./dpkgfdoprovider.sh $ARCH $BUILDNUM sqlite

Added: trunk/Tools/Vagrant/scripts/dpkgfdocore.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/dpkgfdocore.sh	                        (rev 0)
+++ trunk/Tools/Vagrant/scripts/dpkgfdocore.sh	2014-09-30 11:37:11 UTC (rev 8370)
@@ -0,0 +1,225 @@
+#!/bin/bash
+
+# Build directory structure underneath directory of this script
+# debian/ - common build directory for all packages
+#   control - generated all packages control file with subst params
+#   changelog - generated changelog file
+#   substvars - subst params created by dpkg-shlibdeps
+#   fdocore/ - directory to build FDO Base libs package
+#     usr/local/fdo-3.9.0/ - copied tree for core fdo libs
+#     DEBIAN/
+#       control - control file generated from dpkg-gencontrol
+#       symbols - symbols file generated from dpkg-gensymbols
+# 
+BUILDROOT=`pwd`
+FDOBUILD=3.9.0
+FDO=usr/local/fdo-${FDOBUILD}
+ROOT=${BUILDROOT}/debian/fdocore
+TREE=${BUILDROOT}/debian
+CPROOT=${ROOT}/${FDO}
+
+# Create output directory structure and ignore errors
+#
+if [ ! -d tmp ]; then
+  mkdir tmp >& /dev/null
+  mkdir bin >& /dev/null
+  mkdir debian >& /dev/null
+else
+# clean out existing build tree
+  rm -rf tmp/*
+  rm -rf bin/*
+  rm -rf debian/*
+fi
+
+
+# Read and validate command line parameters
+#
+ARCH="$1"
+BUILDNUM="$2"
+if test -z ${ARCH}; then 
+  echo Usage: dpkgfdocore.sh [i386/amd64] svnChangeNum
+  exit -1
+fi
+if test -z ${BUILDNUM}; then 
+  echo Usage: dpkgfdocore.sh [i386/amd64] svnChangeNum
+  exit -1
+fi
+
+case $ARCH in 
+i386)
+  echo Setting architecture to i386.
+  ;;
+amd64)
+  echo Setting architecture to amd64.
+  ;;
+*)
+  echo Usage: dpkgfdocore.sh [i386/amd64] svnChangeNum
+  echo Invalid architecture.  Please specify i386 or amd64.
+  exit -1
+  ;;
+esac
+
+
+# Create control file
+#
+cat > debian/control <<END-OF-CONTROL
+Source: fdo-src
+Maintainer: FDO Internals Mail List <fdo-internals at lists.osgeo.org>
+Section: misc
+Priority: optional
+Homepage: http://fdo.osgeo.org
+
+Package: fdo-core
+Architecture: ${ARCH}
+Section: misc
+Priority: optional
+Depends: \${fdocore:Depends}
+Description:  OSGeo FDO ${FDOBUILD} base libraries
+
+Package: fdo-sdf
+Architecture: ${ARCH}
+Section: misc
+Priority: optional
+Depends: \${fdosdf:Depends}
+Description:  OSGeo FDO ${FDOBUILD} SDF Provider
+
+Package: fdo-shp
+Architecture: ${ARCH}
+Section: misc
+Priority: optional
+Depends: \${fdoshp:Depends}
+Description:  OSGeo FDO ${FDOBUILD} SHP Provider
+
+Package: fdo-wfs
+Architecture: ${ARCH}
+Section: misc
+Priority: optional
+Depends: \${fdowfs:Depends}
+Description:  OSGeo FDO ${FDOBUILD} WFS Provider
+
+Package: fdo-wms
+Architecture: ${ARCH}
+Section: misc
+Priority: optional
+Depends: \${fdowms:Depends}
+Description:  OSGeo FDO ${FDOBUILD} WMS Provider
+
+Package: fdo-arcsde
+Architecture: ${ARCH}
+Section: misc
+Priority: optional
+Depends: \${fdoarcsde:Depends}
+Description:  OSGeo FDO ${FDOBUILD} ArcSDE Provider
+
+Package: fdo-rdbms
+Architecture: ${ARCH}
+Section: misc
+Priority: optional
+Depends: \${fdordbms:Depends}
+Description:  OSGeo FDO ${FDOBUILD} Providers for ODBC, MySQL and PostgreSQL
+
+Package: fdo-gdal
+Architecture: ${ARCH}
+Section: misc
+Priority: optional
+Depends: \${fdogdal:Depends}
+Description:  OSGeo FDO ${FDOBUILD} GDAL Provider
+
+Package: fdo-ogr
+Architecture: ${ARCH}
+Section: misc
+Priority: optional
+Depends: \${fdoogr:Depends}
+Description:  OSGeo FDO ${FDOBUILD} OGR Provider
+
+Package: fdo-kingoracle
+Architecture: ${ARCH}
+Section: misc
+Priority: optional
+Depends: \${fdokingoracle:Depends}
+Description:  OSGeo FDO ${FDOBUILD} King Oracle Provider
+
+Package: fdo-sqlite
+Architecture: ${ARCH}
+Section: misc
+Priority: optional
+Depends: \${fdosqlite:Depends}
+Description:  OSGeo FDO ${FDOBUILD} SQLite Provider
+END-OF-CONTROL
+
+
+# Create changelog file
+# TODO: pull revision history from Subversion
+#
+CURRTIME=`date -R`
+cat > debian/changelog <<END-OF-CHANGELOG
+fdo-src (${FDOBUILD}-${BUILDNUM}) experimental; urgency=low
+
+  * Pre-release build.
+
+ -- FDO Internals Mail List <fdo-internals at lists.osgeo.org>  ${CURRTIME}
+END-OF-CHANGELOG
+
+
+# Pull copyright file from Subversion vault 
+wget http://svn.osgeo.org/fdo/branches/3.8/License_README.txt -O tmp/copyright
+iconv -f ISO-8859-1 -t UTF-8 tmp/copyright > debian/copyright
+
+# Blow away old build directory
+rm -rf ${ROOT}
+
+# Create and populate documentation directory for fdo-core
+mkdir -p ${ROOT}/usr/share/doc/fdo-core
+cp debian/copyright ${ROOT}/usr/share/doc/fdo-core
+cp debian/changelog ${ROOT}/usr/share/doc/fdo-core/changelog.Debian
+gzip -9 ${ROOT}/usr/share/doc/fdo-core/changelog.Debian
+
+
+# Create directories for binary package build and copy
+# install image into build directory
+for file in `cat filelist/fdocoredir.lst` 
+do
+  mkdir -p ${CPROOT}/${file}
+done
+
+for file in `cat filelist/fdocore.lst` 
+do
+  cp -a /${FDO}/${file} ${CPROOT}/${file}
+done
+
+# Remove any .la files in the lib directory since
+# lintian complains about them
+rm -f ${CPROOT}/lib/*.la
+
+# Remove unneeded symbols from files in the lib directory
+# and remove their executable status to clean up some lintian errors
+for file in `find ${CPROOT}/lib/lib*.so* -type f -print`
+do
+  strip --strip-unneeded ${file}
+  chmod a-x ${file}
+done
+
+
+# Call dpkg-shlibdeps to build out library dependencies
+# This will create the substvars file
+# LD_LIBRARY_PATH must be set to find private libs
+mkdir -p ${ROOT}/DEBIAN
+pushd ${BUILDROOT}
+# Fdo build creates full path symlinks for third party libs
+# Add install directory to path to compensate
+#export LD_LIBRARY_PATH=${CPROOT}/lib
+export LD_LIBRARY_PATH=${CPROOT}/lib:/${FDO}/lib
+dpkg-shlibdeps -pfdocore --ignore-missing-info ${CPROOT}/lib/*.so
+dpkg-gensymbols -q -p"fdo-core" -P"debian/fdocore"
+export LD_LIBRARY_PATH=
+
+# Now generate a filled in control file for the binary package
+# using information from control, changelog, and substvars
+dpkg-gencontrol -p"fdo-core" -P"debian/fdocore"
+
+# Build binary package from ROOT
+# And move resulting debian package and lintian results to build directory
+dpkg-deb -Zlzma --build ${ROOT}
+lintian -i debian/fdocore.deb > tmp/fdocore.lintian
+mv debian/fdocore.deb bin/fdo-core_${FDOBUILD}-${BUILDNUM}_${ARCH}.deb
+popd

Added: trunk/Tools/Vagrant/scripts/dpkgfdoprovider.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/dpkgfdoprovider.sh	                        (rev 0)
+++ trunk/Tools/Vagrant/scripts/dpkgfdoprovider.sh	2014-09-30 11:37:11 UTC (rev 8370)
@@ -0,0 +1,142 @@
+#!/bin/bash
+
+# Build directory structure underneath directory of this script
+# debian/ - common build directory for all packages
+#   control - generated all packages control file with subst params
+#   changelog - generated changelog file
+#   substvars - subst params created by dpkg-shlibdeps
+#   fdo[provider]/ - directory to build FDO Provider
+#     usr/local/fdo-3.9.0/ - copied tree for core fdo libs
+#     DEBIAN/
+#       control - control file generated from dpkg-gencontrol
+#       symbols - symbols file generated from dpkg-gensymbols
+# 
+
+
+# Read and validate command line parameters
+#
+ARCH="$1"
+BUILDNUM="$2"
+PROVIDER="$3"
+if test -z ${ARCH}; then 
+  echo Usage: dpkgfdoprovider.sh [i386/amd64] svnChangeNum provider
+  exit -1
+fi
+if test -z ${BUILDNUM}; then 
+  echo Usage: dpkgfdoprovider.sh [i386/amd64] svnChangeNum provider
+  exit -1
+fi
+
+case $ARCH in 
+i386)
+  echo Setting architecture to i386.
+  ;;
+amd64)
+  echo Setting architecture to amd64.
+  ;;
+*)
+  echo Usage: dpkgfdoprovider.sh [i386/amd64] svnChangeNum provider
+  echo Invalid architecture.  Please specify i386 or amd64.
+  exit -1
+  ;;
+esac
+
+case $PROVIDER in
+sdf) ;;
+shp) ;;
+wms) ;;
+wfs) ;;
+arcsde) ;;
+rdbms) ;;
+gdal) ;;
+ogr) ;;
+kingoracle) ;;
+sqlite) ;;
+*)
+  echo Usage: dpkgfdoprovider.sh [i386/amd64] svnChangeNum provider
+  echo Invalid provider.  Please specify one of the following providers:
+  echo sdf,shp,wms,wfs,arcsde,rdbms,gdal,ogr,postgis,kingoracle,sqlite
+  exit -1
+  ;;
+esac
+
+
+BUILDROOT=`pwd`
+FDOBUILD=3.9.0
+FDO=usr/local/fdo-${FDOBUILD}
+ROOT=${BUILDROOT}/debian/fdo${PROVIDER}
+CPROOT=${ROOT}/${FDO}
+
+# Create output directory structure and eat error messag
+#
+if [ ! -d tmp ]; then
+  mkdir tmp >& /dev/null
+  mkdir bin >& /dev/null
+  mkdir debian >& /dev/null
+fi
+
+
+# Blow away old build directory
+rm -rf ${ROOT}
+
+
+# Create and populate documentation directory for provider
+mkdir -p ${ROOT}/usr/share/doc/fdo-${PROVIDER}
+cp debian/copyright ${ROOT}/usr/share/doc/fdo-${PROVIDER}
+cp debian/changelog ${ROOT}/usr/share/doc/fdo-${PROVIDER}/changelog.Debian
+gzip -9 ${ROOT}/usr/share/doc/fdo-${PROVIDER}/changelog.Debian
+
+
+# Create directories for binary package build and copy install image
+# into build directory.  Also include fdocore directories for completeness
+for file in `cat filelist/fdocoredir.lst` 
+do
+  mkdir -p ${CPROOT}/${file}
+done
+
+for file in `cat filelist/${PROVIDER}dir.lst` 
+do
+  mkdir -p ${CPROOT}/${file}
+done
+
+for file in `cat filelist/${PROVIDER}.lst` 
+do
+  cp -a /${FDO}/${file} ${CPROOT}/${file}
+done
+
+# Remove any .la files in the lib directory since
+# lintian complains about them
+rm -f ${CPROOT}/lib/*.la
+
+# Remove unneeded symbols from files in the lib directory
+# and remove their executable status to clean up some lintian errors
+for file in `find ${CPROOT}/lib/lib*.so* -type f -print`
+do
+  strip --strip-unneeded ${file}
+  chmod a-x ${file}
+done
+
+
+# Call dpkg-shlibdeps to build out library dependencies
+# This will create the substvars file
+# LD_LIBRARY_PATH must be set to find private libs
+mkdir -p ${ROOT}/DEBIAN
+pushd ${BUILDROOT}
+# Fdo build creates full path symlinks for third party libs
+# Add install directory to path to compensate
+#export LD_LIBRARY_PATH=${CPROOT}/lib
+export LD_LIBRARY_PATH=${CPROOT}/lib:/${FDO}/lib
+dpkg-shlibdeps --ignore-missing-info -pfdo${PROVIDER} ${CPROOT}/lib/*.so
+dpkg-gensymbols -q -p"fdo-${PROVIDER}" -P"debian/fdo${PROVIDER}"
+export LD_LIBRARY_PATH=
+
+# Now generate a filled in control file for the binary package
+# using information from control, changelog, and substvars
+dpkg-gencontrol -p"fdo-${PROVIDER}" -P"debian/fdo${PROVIDER}"
+
+# Build binary package from ROOT
+# And move resulting debian package and lintian results to build directory
+dpkg-deb -Zlzma --build ${ROOT}
+lintian -i debian/fdo${PROVIDER}.deb > tmp/fdo${PROVIDER}.lintian
+mv debian/fdo${PROVIDER}.deb bin/fdo-${PROVIDER}_${FDOBUILD}-${BUILDNUM}_${ARCH}.deb
+popd

Modified: trunk/Tools/Vagrant/scripts/dpkgmapguide.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/dpkgmapguide.sh	2014-09-29 13:58:02 UTC (rev 8369)
+++ trunk/Tools/Vagrant/scripts/dpkgmapguide.sh	2014-09-30 11:37:11 UTC (rev 8370)
@@ -5,38 +5,53 @@
 #   control - generated all packages control file with subst params
 #   changelog - generated changelog file
 #   substvars - subst params created by dpkg-shlibdeps
+#   mapguideplatformbase/ - packaging directory for common MapGuide components
+#     usr/local/mapguideopensource-3.0.0/ - copied tree for common components
+#     DEBIAN/
+#       control - control file generated from dpkg-gencontrol
+#       symbols - symbols file generated from dpkg-gensymbols
+#
 #   mapguidecommon/ - packaging directory for common MapGuide components
-#     usr/local/mapguideopensource-2.4.0/ - copied tree for common components
+#     usr/local/mapguideopensource-3.0.0/ - copied tree for common components
 #     DEBIAN/
 #       control - control file generated from dpkg-gencontrol
 #       symbols - symbols file generated from dpkg-gensymbols
 #
+#   mapguidecoordsys/ - packaging directory for CS-Map coordinate system dictionaries
+#     usr/local/mapguideopensource-3.0.0/ - copied tree for common components
+#     DEBIAN/
+#       control - control file generated from dpkg-gencontrol
+#       symbols - symbols file generated from dpkg-gensymbols
+#
+#   mapguidecoordsyslite/ - packaging directory for CS-Map coordinate system dictionaries
+#     usr/local/mapguideopensource-3.0.0/ - copied tree for common components
+#     DEBIAN/
+#       control - control file generated from dpkg-gencontrol
+#       symbols - symbols file generated from dpkg-gensymbols
+#
 #   mapguideserver/ - packaging directory for MapGuide Server
-#     usr/local/mapguideopensource-2.4.0/ - copied tree for Server
+#     usr/local/mapguideopensource-3.0.0/ - copied tree for Server
 #     DEBIAN/
 #       control - control file generated from dpkg-gencontrol
 #       symbols - symbols file generated from dpkg-gensymbols
 #
 #   mapguidewebextensions/ - packaging directory for Web Extensions
-#     usr/local/mapguideopensource-2.4.0/ - copied tree for Web Extensions
+#     usr/local/mapguideopensource-3.0.0/ - copied tree for Web Extensions
 #     DEBIAN/
 #       control - control file generated from dpkg-gencontrol
 #       symbols - symbols file generated from dpkg-gensymbols
 #
 #   mapguidehttpd/ - packaging directory for Apache Bundle
-#     usr/local/mapguideopensource-2.4.0/ - copied tree for Apache bundle
+#     usr/local/mapguideopensource-3.0.0/ - copied tree for Apache bundle
 #     DEBIAN/
 #       control - control file generated from dpkg-gencontrol
 #       symbols - symbols file generated from dpkg-gensymbols
-# 
 #
-# Make sure setvars.sh is called first before running this script
 
 BUILDROOT=`pwd`
-MGBUILD=2.6.0
+MGBUILD=3.0.0
+FDOBUILD=3.9.0
 MGINST=usr/local/mapguideopensource-${MGBUILD}
-ROOT=${BUILDROOT}/debian/mapguidecommon
-TREE=${BUILDROOT}/debian
 CPROOT=${ROOT}/${MGINST}
 
 # Create output directory structure and ignore errors
@@ -90,13 +105,34 @@
 Priority: optional
 Homepage: http://mapguide.osgeo.org
 
+Package: mapguideopensource-platformbase
+Architecture: ${ARCH}
+Section: misc
+Priority: optional
+Depends: \${mapguideplatformbase:Depends}
+Description:  Base platform components for OSGeo MapGuide ${MGBUILD}
+
 Package: mapguideopensource-common
 Architecture: ${ARCH}
 Section: misc
 Priority: optional
 Depends: \${mapguidecommon:Depends}
-Description:  OSGeo MapGuide ${MGBUILD} common components
+Description:  OSGeo MapGuide ${MGBUILD} server-specific common components
 
+Package: mapguideopensource-coordsys
+Architecture: ${ARCH}
+Section: msic
+Priority: optional
+Depends: \${mapguidecoordsys:Depends}
+Description:  CS-Map Coordinate System Dictionary data files
+
+Package: mapguideopensource-coordsys-lite
+Architecture: ${ARCH}
+Section: msic
+Priority: optional
+Depends: \${mapguidecoordsys:Depends}
+Description:  CS-Map Coordinate System Dictionary data files. Lite version. Excludes country-specific grid files
+
 Package: mapguideopensource-server
 Architecture: ${ARCH}
 Section: misc
@@ -137,14 +173,46 @@
 wget -N http://svn.osgeo.org/mapguide/trunk/MgDev/License.txt -O tmp/copyright
 iconv -f ISO-8859-1 -t UTF-8 tmp/copyright > debian/copyright
 
+MGINST=usr/local/mapguideopensource-${MGBUILD}
+PACKAGENAME=mapguideopensource-platformbase
+PACKAGEDIR=mapguideplatformbase
+ROOT=${BUILDROOT}/debian/mapguideplatformbase
+TREE=${BUILDROOT}/debian
+CPROOT=${ROOT}/${MGINST}
+DIRLIST="lib"
+REMOVELIST="\.a\$ \.la\$"
+STRIPLIST="\.so\$ libdwf"
+EXCLUDEFILE=platformbase_excludes.txt
+
+source ./dpkgbuild.sh
+
+MGINST=usr/local/mapguideopensource-${MGBUILD}
 PACKAGENAME=mapguideopensource-common
 PACKAGEDIR=mapguidecommon
-DIRLIST="lib share"
+ROOT=${BUILDROOT}/debian/mapguidecommon
+TREE=${BUILDROOT}/debian
+CPROOT=${ROOT}/${MGINST}
+DIRLIST="lib"
 REMOVELIST="\.a\$ \.la\$"
 STRIPLIST="\.so\$ libdwf"
+EXCLUDEFILE=mapguidecommon_excludes.txt
 
 source ./dpkgbuild.sh
 
+EXCLUDEFILE=
+PACKAGENAME=mapguideopensource-coordsys
+PACKAGEDIR=mapguidecoordsys
+ROOT=${BUILDROOT}/debian/mapguidecoordsys
+TREE=${BUILDROOT}/debian
+CPROOT=${ROOT}/${MGINST}
+DIRLIST="share"
+REMOVELIST="\.a\$ \.la\$ \.c\$ \.o\$ \.mak\$ \.nmk\$"
+STRIPLIST="\.so\$"
+
+source ./dpkgbuild.sh
+
+source ./csmap_optimize.sh
+
 MGINST=usr/local/mapguideopensource-${MGBUILD}/server
 ROOT=${BUILDROOT}/debian/mapguideserver
 TREE=${BUILDROOT}/debian

Added: trunk/Tools/Vagrant/scripts/mapguidecommon_excludes.txt
===================================================================
--- trunk/Tools/Vagrant/scripts/mapguidecommon_excludes.txt	                        (rev 0)
+++ trunk/Tools/Vagrant/scripts/mapguidecommon_excludes.txt	2014-09-30 11:37:11 UTC (rev 8370)
@@ -0,0 +1,27 @@
+libACE.so
+libACE.so.5.8.0
+libdwfcore-1.1.1.so
+libdwfemap-1.0.0.so
+libdwftk-7.1.1.so
+libMgFoundation-3.0.0.so
+libMgFoundation.so
+libMgGeometry-3.0.0.so
+libMgGeometry.so
+libMgGwsCommon-3.0.0.so
+libMgGwsCommon.so
+libMgGwsQueryEngine-3.0.0.so
+libMgGwsQueryEngine.so
+libMgGwsResource-3.0.0.so
+libMgGwsResource.so
+libMgMdfModel-3.0.0.so
+libMgMdfModel.so
+libMgMdfParser-3.0.0.so
+libMgMdfParser.so
+libMgPlatformBase-3.0.0.so
+libMgPlatformBase.so
+libMgRenderers-3.0.0.so
+libMgRenderers.so
+libMgStylization-3.0.0.so
+libMgStylization.so
+libxerces-c-3.1.so
+libxerces-c.so

Added: trunk/Tools/Vagrant/scripts/mginstallcentos.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/mginstallcentos.sh	                        (rev 0)
+++ trunk/Tools/Vagrant/scripts/mginstallcentos.sh	2014-09-30 11:37:11 UTC (rev 8370)
@@ -0,0 +1,93 @@
+#!/bin/bash
+URL="http://download.osgeo.org/mapguide/releases/3.0.0/Release"
+#URL="http://192.168.0.4/downloads"
+FDOVER_MAJOR_MINOR=3.9
+FDOVER_POINT=0
+FDOVER_REV=0
+FDO_ARCH=i386
+FDOVER_MAJOR_MINOR_REV=${FDOVER_MAJOR_MINOR}.${FDOVER_POINT}
+FDOVER=${FDOVER_MAJOR_MINOR_REV}_${FDOVER_REV}
+MGVER_MAJOR_MINOR=3.0
+MGVER_POINT=0
+MGVER_REV=0
+MG_ARCH=i386
+MGVER_MAJOR_MINOR_REV=${MGVER_MAJOR_MINOR}.${MGVER_POINT}
+MGVER=${MGVER_MAJOR_MINOR_REV}.${MGVER_REV}
+FDO_TARBALL=fdosdk-centos6-${FDO_ARCH}-${FDOVER}.tar.gz
+MG_TARBALL=mapguideopensource-${MGVER}.${MG_ARCH}.tar.gz
+MG_URL=${URL}/${MG_TARBALL}
+FDO_URL=${URL}/${FDO_TARBALL}
+
+# Must have root
+if [[ $EUID -ne 0 ]]; then
+    echo "You must run this script with superuser privileges"
+    exit 1
+fi
+
+if [ ! -f ${FDO_TARBALL} ]; then
+wget -N ${FDO_URL}
+fi
+
+#tar -C / -zxvf ${FDO_TARBALL}
+mkdir -p /usr/local/fdo-${FDOVER_MAJOR_MINOR_REV}
+echo "[install]: Extracting FDO"
+tar -C /usr/local/fdo-${FDOVER_MAJOR_MINOR_REV}/ -zxf ${FDO_TARBALL}
+
+if [ ! -f ${MG_TARBALL} ]; then
+wget -N ${MG_URL}
+fi
+
+echo "[install]: Extracting MapGuide"
+tar -C / -zxf ${MG_TARBALL}
+
+# All of this is to make SELinux happy
+pushd /usr/local/fdo-${FDOVER_MAJOR_MINOR_REV}/lib
+echo "[config]: Making binaries SELinux compatible"
+chcon -t textrel_shlib_t *.so
+popd
+
+pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/server/bin
+echo "[config]: Making binaries SELinux compatible"
+chcon -t textrel_shlib_t *.so
+chcon -t textrel_shlib_t mgserver
+popd
+
+pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/server/lib
+echo "[config]: Making binaries SELinux compatible"
+chcon -t textrel_shlib_t *.so
+popd
+
+pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/lib
+echo "[config]: Making binaries SELinux compatible"
+chcon -t textrel_shlib_t *.so
+popd
+
+pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/lib
+echo "[config]: Making binaries SELinux compatible"
+chcon -t textrel_shlib_t *.so
+popd
+
+pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/apache2/lib
+echo "[config]: Making binaries SELinux compatible"
+chcon -t textrel_shlib_t *.so
+popd
+
+pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/apache2/modules
+echo "[config]: Making binaries SELinux compatible"
+chcon -t textrel_shlib_t *.so
+popd
+
+echo "[config]: Fixing permissions for certain folders"
+chmod 777 /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/www/TempDir
+
+pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/apache2/bin
+echo "[install]: Starting httpd"
+./apachectl start
+popd
+
+pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/server/bin
+echo "[install]: Starting mgserver"
+./mgserverd.sh
+popd
+
+echo DONE

Added: trunk/Tools/Vagrant/scripts/mginstallubuntu.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/mginstallubuntu.sh	                        (rev 0)
+++ trunk/Tools/Vagrant/scripts/mginstallubuntu.sh	2014-09-30 11:37:11 UTC (rev 8370)
@@ -0,0 +1,499 @@
+#!/bin/bash
+TEMPDIR=/tmp/build_mapguide
+URL="http://download.osgeo.org/mapguide/releases/3.0.0/Release/ubuntu12"
+#URL="http://192.168.0.5/downloads/ubuntu12"
+FDOVER_MAJOR_MINOR=3.9
+FDOVER_MAJOR_MINOR_REV=${FDOVER_MAJOR_MINOR}.0
+FDOBUILD=0
+FDOARCH=i386
+FDOVER=${FDOVER_MAJOR_MINOR_REV}-${FDOBUILD}_${FDOARCH}
+MGVER_MAJOR_MINOR=3.0
+MGVER_MAJOR_MINOR_REV=${MGVER_MAJOR_MINOR}.0
+MGBUILD=0
+MGARCH=i386
+MGVER=${MGVER_MAJOR_MINOR_REV}-${MGBUILD}_${MGARCH}
+INSTALLER_TITLE="MapGuide Open Source Ubuntu installer"
+
+DEFAULT_SERVER_IP="127.0.0.1"
+
+DEFAULT_ADMIN_PORT=2810
+DEFAULT_CLIENT_PORT=2811
+DEFAULT_SITE_PORT=2812
+
+DEFAULT_HTTPD_PORT=8008
+DEFAULT_TOMCAT_PORT=8009
+
+csmap_choice="full"
+
+server_ip="127.0.0.1"
+webtier_server_ip="127.0.0.1"
+
+admin_port=2810
+client_port=2811
+site_port=2812
+
+httpd_port=8008
+tomcat_port=8009
+
+# Must have root
+if [[ $EUID -ne 0 ]]; then
+    echo "You must run this script with superuser privileges"
+    exit 1
+fi
+
+# Install required packages 
+apt-get -y install dialog libexpat1 libssl1.0.0 odbcinst unixodbc libcurl3 libxslt1.1
+
+DIALOG=${DIALOG=dialog}
+
+main()
+{
+    dialog_welcome
+    dialog_fdo_provider
+    dialog_server
+    dialog_webtier
+    #dialog_coordsys
+    #dump_configuration
+    install_fdo
+    install_mapguide_packages
+    post_install
+}
+
+set_server_vars()
+{
+    set -- $(<$1)
+    server_ip=$1
+    admin_port=$2
+    client_port=$3
+    site_port=$4
+}
+
+set_webtier_vars()
+{
+    set -- $(<$1)
+    webtier_server_ip=$1
+    httpd_port=$2
+    tomcat_port=$3
+}
+
+dump_configuration()
+{
+    echo "********* Configuration Summary ************"
+    echo " Default Ports (Server)"
+    echo "  Admin: ${DEFAULT_ADMIN_PORT}"
+    echo "  Client: ${DEFAULT_CLIENT_PORT}"
+    echo "  Site: ${DEFAULT_SITE_PORT}"
+    echo " Default Ports (WebTier)"
+    echo "  Apache: ${DEFAULT_HTTPD_PORT}"
+    echo "  Tomcat: ${DEFAULT_TOMCAT_PORT}"
+    echo " Configured Ports (Server)"
+    echo "  Admin: ${admin_port}"
+    echo "  Client: ${client_port}"
+    echo "  Site: ${site_port}"
+    echo " Configured Ports (WebTier)"
+    echo "  Apache: ${httpd_port}"
+    echo "  Tomcat: ${tomcat_port}"
+    echo " Other choices"
+    echo "  FDO: ${fdo_provider_choice}"
+    echo "  CS-Map: ${csmap_choice}"
+    echo "  Server IP: ${server_ip}"
+    echo "********************************************"
+}
+
+dialog_welcome()
+{
+    $DIALOG --backtitle "$INSTALLER_TITLE" \
+            --title "Welcome" --clear \
+            --yesno "Welcome to the MapGuide Open Source Ubuntu installer. Would you like to proceed?" 10 30
+
+    case $? in
+      1)
+        echo "Cancelled"
+        exit 1;;
+      255)
+        echo "Cancelled"
+        exit 255;;
+    esac
+}
+
+dialog_fdo_provider()
+{
+    tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+    trap "rm -f $tempfile" 0 1 2 5 15
+
+    #arcsde    	"OSGeo FDO Provider for ArcSDE" off \
+    # Disable RDBMS provider selection by default
+    $DIALOG --backtitle "$INSTALLER_TITLE" \
+            --title "FDO Providers" --clear \
+            --checklist "Check the FDO Providers you want to install" 20 61 5 \
+            sdf  		"OSGeo FDO Provider for SDF" ON \
+            shp    		"OSGeo FDO Provider for SHP" ON \
+            sqlite 		"OSGeo FDO Provider for SQLite" ON \
+            gdal    	"OSGeo FDO Provider for GDAL" ON \
+            ogr    		"OSGeo FDO Provider for OGR" ON \
+            kingoracle  "OSGeo FDO Provider for Oracle" off \
+            rdbms	    "RDBMS FDO Providers (ODBC, MySQL, PostgreSQL)" off \
+            wfs    		"OSGeo FDO Provider for WFS" ON \
+            wms   		"OSGeo FDO Provider for WMS" ON  2> $tempfile
+
+    fdo_provider_choice=`cat $tempfile | sed s/\"//g`
+    case $? in
+      1)
+        echo "Cancelled"
+        exit 1;;
+      255)
+        echo "Cancelled"
+        exit 255;;
+    esac
+}
+
+dialog_server()
+{
+    dialog --backtitle "$INSTALLER_TITLE" --title "Server Configuration" \
+            --form "\nSet the port numbers that the MapGuide Server will listen on" 25 60 16 \
+            "Server IP:"   1 1 "${DEFAULT_SERVER_IP}"   1 25 25 30 \
+            "Admin Port:"  2 1 "${DEFAULT_ADMIN_PORT}"  2 25 25 30 \
+            "Client Port:" 3 1 "${DEFAULT_CLIENT_PORT}" 3 25 25 30 \
+            "Site Port:"   4 1 "${DEFAULT_SITE_PORT}"   4 25 25 30 2>/tmp/form.$$
+    case $? in
+      1)
+        echo "Cancelled"
+        exit 1;;
+      255)
+        echo "Cancelled"
+        exit 255;;
+    esac
+    set_server_vars "/tmp/form.$$"
+    rm /tmp/form.$$
+}
+
+dialog_webtier()
+{
+    dialog --backtitle "$INSTALLER_TITLE" --title "Web Tier Configuration" \
+            --form "\nSet the port numbers that Apache/Tomcat will listen on" 25 60 16 \
+            "Connect to Server IP:" 1 1 "${DEFAULT_SERVER_IP}"   1 25 25 30 \
+            "Apache Port:"          2 1 "${DEFAULT_HTTPD_PORT}"  2 25 25 30 \
+            "Tomcat Port:"          3 1 "${DEFAULT_TOMCAT_PORT}" 3 25 25 30 2>/tmp/form.$$
+    case $? in
+      1)
+        echo "Cancelled"
+        exit 1;;
+      255)
+        echo "Cancelled"
+        exit 255;;
+    esac
+    set_webtier_vars "/tmp/form.$$"
+    rm /tmp/form.$$
+}
+
+dialog_coordsys()
+{
+    tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+    trap "rm -f $tempfile" 0 1 2 5 15
+
+    dialog --backtitle "$INSTALLER_TITLE" \
+            --title "Coordinate System Configuration" --clear \
+            --radiolist "Choose the CS-Map profile you want for this MapGuide Installation" 20 80 5 \
+            "full" "Download/Install the full set of data files" ON \
+            "lite" "Download/Install the lite configuration (no grid files)" off  2> $tempfile
+    csmap_choice=`cat $tempfile`
+    case $? in
+      1)
+        echo "Cancelled"
+        exit 1;;
+      255)
+        echo "Cancelled"
+        exit 255;;
+    esac
+}
+
+install_fdo()
+{
+    # set initial registration state
+    arcsde_registered=0
+    gdal_registered=0
+    kingoracle_registered=0
+    rdbms_registered=0
+    ogr_registered=0
+    sdf_registered=0
+    shp_registered=0
+    sqlite_registered=0
+    wfs_registered=0
+    wms_registered=0
+
+    # Include core and rdbms packages regardless of choice.
+    fdo_provider_choice="core rdbms $fdo_provider_choice"
+    # Download and install Ubuntu packages for FDO
+    for file in $fdo_provider_choice
+    do
+        #echo "Downloading ${URL}/fdo-${file}_${FDOVER}.deb"
+        wget -N ${URL}/fdo-${file}_${FDOVER}.deb
+        #echo "Installing fdo-${file}_${FDOVER}.deb"
+        dpkg -E -G --install fdo-${file}_${FDOVER}.deb
+    done
+
+    # Nuke the old providers.xml, we're rebuiding it
+    providersxml=/usr/local/fdo-${FDOVER_MAJOR_MINOR_REV}/lib/providers.xml
+    echo -ne "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\" ?>" > ${providersxml}
+    echo -ne "\n<FeatureProviderRegistry>" >> ${providersxml}
+    for file in $fdo_provider_choice
+    do
+        case $file in
+          arcsde)
+            if [ $arcsde_registered -eq 1 ];
+            then
+                continue
+            fi
+            echo "Registering ArcSDE Provider"
+            echo -ne "\n  <FeatureProvider>" >> ${providersxml}
+            echo -ne "\n    <Name>OSGeo.ArcSDE.${FDOVER_MAJOR_MINOR}</Name>" >> ${providersxml}
+            echo -ne "\n    <DisplayName>OSGeo FDO Provider for ArcSDE</DisplayName>" >> ${providersxml}
+            echo -ne "\n    <Description>Read/write access to an ESRI ArcSDE-based data store, using Oracle and SQL Server</Description>" >> ${providersxml}
+            echo -ne "\n    <IsManaged>False</IsManaged>" >> ${providersxml}
+            echo -ne "\n    <Version>${FDOVER_MAJOR_MINOR_REV}.0</Version>" >> ${providersxml}
+            echo -ne "\n    <FeatureDataObjectsVersion>${FDOVER_MAJOR_MINOR_REV}.0</FeatureDataObjectsVersion>" >> ${providersxml}
+            echo -ne "\n    <LibraryPath>libArcSDEProvider.so</LibraryPath>" >> ${providersxml}
+            echo -ne "\n  </FeatureProvider>" >> ${providersxml}
+            arcsde_registered=1
+            ;;
+          gdal)
+            if [ $gdal_registered -eq 1 ];
+            then
+                continue
+            fi
+            echo "Registering GDAL Provider"
+            echo -ne "\n  <FeatureProvider>" >> ${providersxml}
+            echo -ne "\n    <Name>OSGeo.Gdal.${FDOVER_MAJOR_MINOR}</Name>" >> ${providersxml}
+            echo -ne "\n    <DisplayName>OSGeo FDO Provider for GDAL</DisplayName>" >> ${providersxml}
+            echo -ne "\n    <Description>FDO Provider for GDAL</Description>" >> ${providersxml}
+            echo -ne "\n    <IsManaged>False</IsManaged>" >> ${providersxml}
+            echo -ne "\n    <Version>${FDOVER_MAJOR_MINOR_REV}.0</Version>" >> ${providersxml}
+            echo -ne "\n    <FeatureDataObjectsVersion>${FDOVER_MAJOR_MINOR_REV}.0</FeatureDataObjectsVersion>" >> ${providersxml}
+            echo -ne "\n    <LibraryPath>libGRFPProvider.so</LibraryPath>" >> ${providersxml}
+            echo -ne "\n  </FeatureProvider>" >> ${providersxml}
+            gdal_registered=1
+            ;;
+          kingoracle)
+            if [ $kingoracle_registered -eq 1 ];
+            then
+                continue
+            fi
+            echo "Registering King Oracle Provider"
+            echo -ne "\n  <FeatureProvider>" >> ${providersxml}
+            echo -ne "\n    <Name>OSGeo.KingOracle.${FDOVER_MAJOR_MINOR}</Name>" >> ${providersxml}
+            echo -ne "\n    <DisplayName>OSGeo FDO Provider for Oracle</DisplayName>" >> ${providersxml}
+            echo -ne "\n    <Description>Read/write access to spatial and attribute data in Oracle Spatial</Description>" >> ${providersxml}
+            echo -ne "\n    <IsManaged>False</IsManaged>" >> ${providersxml}
+            echo -ne "\n    <Version>${FDOVER_MAJOR_MINOR_REV}.0</Version>" >> ${providersxml}
+            echo -ne "\n    <FeatureDataObjectsVersion>${FDOVER_MAJOR_MINOR_REV}.0</FeatureDataObjectsVersion>" >> ${providersxml}
+            echo -ne "\n    <LibraryPath>libKingOracleProvider.so</LibraryPath>" >> ${providersxml}
+            echo -ne "\n  </FeatureProvider>" >> ${providersxml}
+            kingoracle_registered=1
+            ;;
+          rdbms)
+            if [ $rdbms_registered -eq 1 ];
+            then
+                continue
+            fi
+            echo "Registering ODBC Provider"
+            echo -ne "\n  <FeatureProvider>" >> ${providersxml}
+            echo -ne "\n    <Name>OSGeo.ODBC.${FDOVER_MAJOR_MINOR}</Name>" >> ${providersxml}
+            echo -ne "\n    <DisplayName>OSGeo FDO Provider for ODBC</DisplayName>" >> ${providersxml}
+            echo -ne "\n    <Description>FDO Provider for ODBC</Description>" >> ${providersxml}
+            echo -ne "\n    <IsManaged>False</IsManaged>" >> ${providersxml}
+            echo -ne "\n    <Version>${FDOVER_MAJOR_MINOR_REV}.0</Version>" >> ${providersxml}
+            echo -ne "\n    <FeatureDataObjectsVersion>${FDOVER_MAJOR_MINOR_REV}.0</FeatureDataObjectsVersion>" >> ${providersxml}
+            echo -ne "\n    <LibraryPath>libFdoODBC.so</LibraryPath>" >> ${providersxml}
+            echo -ne "\n  </FeatureProvider>" >> ${providersxml}
+            echo "Registering PostgreSQL Provider"
+            echo -ne "\n  <FeatureProvider>" >> ${providersxml}
+            echo -ne "\n    <Name>OSGeo.PostgreSQL.${FDOVER_MAJOR_MINOR}</Name>" >> ${providersxml}
+            echo -ne "\n    <DisplayName>OSGeo FDO Provider for PostgreSQL</DisplayName>" >> ${providersxml}
+            echo -ne "\n    <Description>Read/write access to PostgreSQL/PostGIS-based data store. Supports spatial data types and spatial query operations</Description>" >> ${providersxml}
+            echo -ne "\n    <IsManaged>False</IsManaged>" >> ${providersxml}
+            echo -ne "\n    <Version>${FDOVER_MAJOR_MINOR_REV}.0</Version>" >> ${providersxml}
+            echo -ne "\n    <FeatureDataObjectsVersion>${FDOVER_MAJOR_MINOR_REV}.0</FeatureDataObjectsVersion>" >> ${providersxml}
+            echo -ne "\n    <LibraryPath>libFdoPostgreSQL.so</LibraryPath>" >> ${providersxml}
+            echo -ne "\n  </FeatureProvider>" >> ${providersxml}
+            echo "Registering MySQL Provider"
+            echo -ne "\n  <FeatureProvider>" >> ${providersxml}
+            echo -ne "\n    <Name>OSGeo.MySQL.${FDOVER_MAJOR_MINOR}</Name>" >> ${providersxml}
+            echo -ne "\n    <DisplayName>OSGeo FDO Provider for MySQL</DisplayName>" >> ${providersxml}
+            echo -ne "\n    <Description>FDO Provider for MySQL</Description>" >> ${providersxml}
+            echo -ne "\n    <IsManaged>False</IsManaged>" >> ${providersxml}
+            echo -ne "\n    <Version>${FDOVER_MAJOR_MINOR_REV}.0</Version>" >> ${providersxml}
+            echo -ne "\n    <FeatureDataObjectsVersion>${FDOVER_MAJOR_MINOR_REV}.0</FeatureDataObjectsVersion>" >> ${providersxml}
+            echo -ne "\n    <LibraryPath>libFdoMySQL.so</LibraryPath>" >> ${providersxml}
+            echo -ne "\n  </FeatureProvider>" >> ${providersxml}
+            rdbms_registered=1
+            ;;
+          ogr)
+            if [ $ogr_registered -eq 1 ];
+            then
+                continue
+            fi
+            echo "Registering OGR Provider"
+            echo -ne "\n  <FeatureProvider>" >> ${providersxml}
+            echo -ne "\n    <Name>OSGeo.OGR.${FDOVER_MAJOR_MINOR}</Name>" >> ${providersxml}
+            echo -ne "\n    <DisplayName>OSGeo FDO Provider for OGR</DisplayName>" >> ${providersxml}
+            echo -ne "\n    <Description>FDO Access to OGR Data Sources</Description>" >> ${providersxml}
+            echo -ne "\n    <IsManaged>False</IsManaged>" >> ${providersxml}
+            echo -ne "\n    <Version>${FDOVER_MAJOR_MINOR_REV}.0</Version>" >> ${providersxml}
+            echo -ne "\n    <FeatureDataObjectsVersion>${FDOVER_MAJOR_MINOR_REV}.0</FeatureDataObjectsVersion>" >> ${providersxml}
+            echo -ne "\n    <LibraryPath>libOGRProvider.so</LibraryPath>" >> ${providersxml}
+            echo -ne "\n  </FeatureProvider>" >> ${providersxml}
+            ogr_registered=1
+            ;;
+          sdf)
+            if [ $sdf_registered -eq 1 ];
+            then
+                continue
+            fi
+            echo "Registering SDF Provider"
+            echo -ne "\n  <FeatureProvider>" >> ${providersxml}
+            echo -ne "\n    <Name>OSGeo.SDF.${FDOVER_MAJOR_MINOR}</Name>" >> ${providersxml}
+            echo -ne "\n    <DisplayName>OSGeo FDO Provider for SDF</DisplayName>" >> ${providersxml}
+            echo -ne "\n    <Description>Read/write access to Autodesk's spatial database format, a file-based geodatabase that supports multiple features/attributes, spatial indexing and file-locking</Description>" >> ${providersxml}
+            echo -ne "\n    <IsManaged>False</IsManaged>" >> ${providersxml}
+            echo -ne "\n    <Version>${FDOVER_MAJOR_MINOR_REV}.0</Version>" >> ${providersxml}
+            echo -ne "\n    <FeatureDataObjectsVersion>${FDOVER_MAJOR_MINOR_REV}.0</FeatureDataObjectsVersion>" >> ${providersxml}
+            echo -ne "\n    <LibraryPath>libSDFProvider.so</LibraryPath>" >> ${providersxml}
+            echo -ne "\n  </FeatureProvider>" >> ${providersxml}
+            sdf_registered=1
+            ;;
+          shp)
+            if [ $shp_registered -eq 1 ];
+            then
+                continue
+            fi
+            echo "Registering SHP Provider"
+            echo -ne "\n  <FeatureProvider>" >> ${providersxml}
+            echo -ne "\n    <Name>OSGeo.SHP.${FDOVER_MAJOR_MINOR}</Name>" >> ${providersxml}
+            echo -ne "\n    <DisplayName>OSGeo FDO Provider for SHP</DisplayName>" >> ${providersxml}
+            echo -ne "\n    <Description>Read/write access to spatial and attribute data in an ESRI SHP file</Description>" >> ${providersxml}
+            echo -ne "\n    <IsManaged>False</IsManaged>" >> ${providersxml}
+            echo -ne "\n    <Version>${FDOVER_MAJOR_MINOR_REV}.0</Version>" >> ${providersxml}
+            echo -ne "\n    <FeatureDataObjectsVersion>${FDOVER_MAJOR_MINOR_REV}.0</FeatureDataObjectsVersion>" >> ${providersxml}
+            echo -ne "\n    <LibraryPath>libSHPProvider.so</LibraryPath>" >> ${providersxml}
+            echo -ne "\n  </FeatureProvider>" >> ${providersxml}
+            shp_registered=1
+            ;;
+          sqlite)
+            if [ $sqlite_registered -eq 1 ];
+            then
+                continue
+            fi
+            echo "Registering SQLite Provider"
+            echo -ne "\n  <FeatureProvider>" >> ${providersxml}
+            echo -ne "\n    <Name>OSGeo.SQLite.${FDOVER_MAJOR_MINOR}</Name>" >> ${providersxml}
+            echo -ne "\n    <DisplayName>OSGeo FDO Provider for SQLite</DisplayName>" >> ${providersxml}
+            echo -ne "\n    <Description>Read/write access to feature data in a SQLite file</Description>" >> ${providersxml}
+            echo -ne "\n    <IsManaged>False</IsManaged>" >> ${providersxml}
+            echo -ne "\n    <Version>${FDOVER_MAJOR_MINOR_REV}.0</Version>" >> ${providersxml}
+            echo -ne "\n    <FeatureDataObjectsVersion>${FDOVER_MAJOR_MINOR_REV}.0</FeatureDataObjectsVersion>" >> ${providersxml}
+            echo -ne "\n    <LibraryPath>libSQLiteProvider.so</LibraryPath>" >> ${providersxml}
+            echo -ne "\n  </FeatureProvider>" >> ${providersxml}
+            sqlite_registered=1
+            ;;
+          wfs)
+            if [ $wfs_registered -eq 1 ];
+            then
+                continue
+            fi
+            echo "Registering WFS Provider"
+            echo -ne "\n  <FeatureProvider>" >> ${providersxml}
+            echo -ne "\n    <Name>OSGeo.WFS.${FDOVER_MAJOR_MINOR}</Name>" >> ${providersxml}
+            echo -ne "\n    <DisplayName>OSGeo FDO Provider for WFS</DisplayName>" >> ${providersxml}
+            echo -ne "\n    <Description>Read access to OGC WFS-based data store</Description>" >> ${providersxml}
+            echo -ne "\n    <IsManaged>False</IsManaged>" >> ${providersxml}
+            echo -ne "\n    <Version>${FDOVER_MAJOR_MINOR_REV}.0</Version>" >> ${providersxml}
+            echo -ne "\n    <FeatureDataObjectsVersion>${FDOVER_MAJOR_MINOR_REV}.0</FeatureDataObjectsVersion>" >> ${providersxml}
+            echo -ne "\n    <LibraryPath>libWFSProvider.so</LibraryPath>" >> ${providersxml}
+            echo -ne "\n  </FeatureProvider>" >> ${providersxml}
+            wfs_registered=1
+            ;;
+          wms)
+            if [ $wms_registered -eq 1 ];
+            then
+                continue
+            fi
+            echo "Registering WMS Provider"
+            echo -ne "\n  <FeatureProvider>" >> ${providersxml}
+            echo -ne "\n    <Name>OSGeo.WMS.${FDOVER_MAJOR_MINOR}</Name>" >> ${providersxml}
+            echo -ne "\n    <DisplayName>OSGeo FDO Provider for WMS</DisplayName>" >> ${providersxml}
+            echo -ne "\n    <Description>Read access to OGC WMS-based data store</Description>" >> ${providersxml}
+            echo -ne "\n    <IsManaged>False</IsManaged>" >> ${providersxml}
+            echo -ne "\n    <Version>${FDOVER_MAJOR_MINOR_REV}.0</Version>" >> ${providersxml}
+            echo -ne "\n    <FeatureDataObjectsVersion>${FDOVER_MAJOR_MINOR_REV}.0</FeatureDataObjectsVersion>" >> ${providersxml}
+            echo -ne "\n    <LibraryPath>libWMSProvider.so</LibraryPath>" >> ${providersxml}
+            echo -ne "\n  </FeatureProvider>" >> ${providersxml}
+            wms_registered=1
+            ;;
+        esac
+    done
+    echo -ne "\n</FeatureProviderRegistry>" >> ${providersxml}
+}
+
+install_mapguide_packages()
+{
+    # Download Ubuntu packages for MapGuide
+    mapguide_packages="platformbase coordsys common server webextensions httpd"
+    if [ $csmap_choice = "lite" ]; then
+        mapguide_packages="platformbase coordsys-lite common server webextensions httpd"
+    fi
+    for file in $mapguide_packages
+    do
+        echo "[download]: ${URL}/mapguideopensource-${file}_${MGVER}.deb"
+        wget -N ${URL}/mapguideopensource-${file}_${MGVER}.deb
+        echo "[install]: mapguideopensource-${file}_${MGVER}.deb"
+        dpkg -E -G --install mapguideopensource-${file}_${MGVER}.deb
+    done
+}
+
+post_install()
+{
+    echo "[config]: Updating serverconfig.ini with configuration choices"
+    sed -i 's/MachineIp.*= '"${DEFAULT_SERVER_IP}"'/MachineIp = '"${server_ip}"'/g' /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/server/bin/serverconfig.ini
+    sed -i 's/IpAddress.*= '"${DEFAULT_SERVER_IP}"'/IpAddress = '"${server_ip}"'/g' /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/server/bin/serverconfig.ini
+    sed -i 's/Port.*= '"${DEFAULT_ADMIN_PORT}"'/Port = '"${admin_port}"'/g' /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/server/bin/serverconfig.ini
+    sed -i 's/Port.*= '"${DEFAULT_CLIENT_PORT}"'/Port = '"${client_port}"'/g' /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/server/bin/serverconfig.ini
+    sed -i 's/Port.*= '"${DEFAULT_SITE_PORT}"'/Port = '"${site_port}"'/g' /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/server/bin/serverconfig.ini
+    echo "[config]: Updating webconfig.ini with configuration choices"
+    sed -i 's/IpAddress.*= '"${DEFAULT_SERVER_IP}"'/IpAddress = '"${webtier_server_ip}"'/g' /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/www/webconfig.ini
+    sed -i 's/Port.*= '"${DEFAULT_ADMIN_PORT}"'/Port = '"${admin_port}"'/g' /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/www/webconfig.ini
+    sed -i 's/Port.*= '"${DEFAULT_CLIENT_PORT}"'/Port = '"${client_port}"'/g' /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/www/webconfig.ini
+    sed -i 's/Port.*= '"${DEFAULT_SITE_PORT}"'/Port = '"${site_port}"'/g' /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/www/webconfig.ini
+    echo "[config]: Updating httpd.conf with configuration choices"
+    sed -i 's/Listen '"${DEFAULT_HTTPD_PORT}"'/Listen '"${httpd_port}"'/g' /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/apache2/conf/httpd.conf
+    sed -i 's/worker.worker1.port='"${DEFAULT_TOMCAT_PORT}"'/worker.worker1.port='"${tomcat_port}"'/g' /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/apache2/conf/workers.properties
+    sed -i 's/Connector port=\"'"${DEFAULT_TOMCAT_PORT}"'\"/Connector port=\"'"${tomcat_port}"'\"/g' /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/tomcat/conf/server.xml
+    echo "[config]: Updating tomcat configs with configuration choices"
+
+    echo "[config]: Fixing permissions for certain folders"
+    chmod 777 /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/www/TempDir
+
+    echo "Creating lock file directory for MapGuide Server"
+    # Create lock file directory for Server
+    if [ ! -d /var/lock/mgserver ]; then
+      mkdir /var/lock/mgserver
+    fi
+    echo "Starting httpd"
+    pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/apache2/bin
+    ./apachectl start
+    popd
+    echo "Starting tomcat"
+    pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/webserverextensions/tomcat/bin
+    sh ./startup.sh
+    popd
+    echo "Starting mgserver"
+    pushd /usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}/server/bin
+    ./mgserverd.sh
+    popd
+    echo "DONE!"
+}
+
+# Create temporary download directory
+mkdir -p ${TEMPDIR}
+pushd ${TEMPDIR}
+main
+popd

Added: trunk/Tools/Vagrant/scripts/mguninstallubuntu.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/mguninstallubuntu.sh	                        (rev 0)
+++ trunk/Tools/Vagrant/scripts/mguninstallubuntu.sh	2014-09-30 11:37:11 UTC (rev 8370)
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Must have root
+if [[ $EUID -ne 0 ]]; then
+	echo "You must run this script with superuser privileges"
+	exit 1
+fi
+
+# Remove Ubuntu packages for MapGuide
+for file in server webextensions httpd coordsys coordsys-lite common platformbase
+do
+  dpkg --remove mapguideopensource-${file}
+done
+
+# Remove Ubuntu packages for FDO
+for file in gdal kingoracle ogr rdbms sdf shp sqlite wfs wms arcsde core
+do
+  dpkg --remove fdo-${file}
+done
+
+

Added: trunk/Tools/Vagrant/scripts/platformbase_excludes.txt
===================================================================
--- trunk/Tools/Vagrant/scripts/platformbase_excludes.txt	                        (rev 0)
+++ trunk/Tools/Vagrant/scripts/platformbase_excludes.txt	2014-09-30 11:37:11 UTC (rev 8370)
@@ -0,0 +1,13 @@
+libdb-4.8.so
+libdb-4.so
+libdb_cxx-4.8.so
+libdb_cxx-4.so
+libdb_cxx.so
+libdbxml-2.5.so
+libdbxml.so
+liblib_json.so
+libMgMapGuideCommon-3.0.0.so
+libMgMapGuideCommon.so
+libxqilla.so
+libxqilla.so.5
+libxqilla.so.5.0.4

Added: trunk/Tools/Vagrant/scripts/prepare_dpkg_fdo.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/prepare_dpkg_fdo.sh	                        (rev 0)
+++ trunk/Tools/Vagrant/scripts/prepare_dpkg_fdo.sh	2014-09-30 11:37:11 UTC (rev 8370)
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+# prepare_dpkg_fdo.sh
+#
+# Creates deb files from CentOS SDK files
+
+save_current_file_list()
+{
+    echo "[info]: Saving current FDO dir file list"
+    pushd $FDO_INST
+    # For lazy folks who build from svn working copies instead of svn exports, we need to weed out any .svn dirs before compiling the file-list
+    find . -name .svn -exec rm -rf {} \;
+    find . -type f -print > ${FDO_FILELIST}/temp.lst
+    find . -type l -print >> ${FDO_FILELIST}/temp.lst
+    sort ${FDO_FILELIST}/temp.lst > ${FDO_FILELIST}/orig.lst
+    find . -type d -print | sort > ${FDO_FILELIST}/origdir.lst
+    popd
+}
+
+update_fdocore_file_list()
+{
+    echo "[info]: Updating FDO core file list for deb packaging"
+    pushd $FDO_INST
+    # For lazy folks who build from svn working copies instead of svn exports, we need to weed out any .svn dirs before compiling the file-list
+    find . -name .svn -exec rm -rf {} \;
+    find . -type f -print > ${FDO_FILELIST}/temp.lst
+    find . -type l -print >> ${FDO_FILELIST}/temp.lst
+    sort ${FDO_FILELIST}/temp.lst > ${FDO_FILELIST}/fdocore.lst
+    find . -type d -print | sort > ${FDO_FILELIST}/fdocoredir.lst
+    popd
+}
+
+update_provider_file_list()
+{
+    PROVIDER=$1
+    echo "[info]: Updating $PROVIDER file list for deb packaging"
+    pushd $FDO_INST
+    # For lazy folks who build from svn working copies instead of svn exports, we need to weed out any .svn dirs before compiling the file-list
+    find . -name .svn -exec rm -rf {} \;
+    #mkdir -p $BUILDLIST
+    find . -type f -print > ${FDO_FILELIST}/temp.lst
+    find . -type l -print >> ${FDO_FILELIST}/temp.lst
+    cat ${FDO_FILELIST}/orig.lst >> ${FDO_FILELIST}/temp.lst
+    sort ${FDO_FILELIST}/temp.lst | uniq -u > ${FDO_FILELIST}/${PROVIDER}.lst
+    find . -type d -print | sort > ${FDO_FILELIST}/temp.lst
+    cat ${FDO_FILELIST}/origdir.lst >> ${FDO_FILELIST}/temp.lst
+    sort ${FDO_FILELIST}/temp.lst | uniq -u > ${FDO_FILELIST}/${PROVIDER}dir.lst
+    popd
+}
+
+update_fdocore_file_list
+for comp in shp sqlite gdal ogr wfs wms rdbms kingoracle sdf
+do
+    save_current_file_list
+    update_provider_file_list $comp
+done
\ No newline at end of file

Modified: trunk/Tools/Vagrant/sources/patches/patchinfo.txt
===================================================================
--- trunk/Tools/Vagrant/sources/patches/patchinfo.txt	2014-09-29 13:58:02 UTC (rev 8369)
+++ trunk/Tools/Vagrant/sources/patches/patchinfo.txt	2014-09-30 11:37:11 UTC (rev 8370)
@@ -1,2 +1 @@
-http://trac.osgeo.org/csmap/ticket/172
-http://trac.osgeo.org/fdo/ticket/888
\ No newline at end of file
+No custom patches required
\ No newline at end of file

Modified: trunk/Tools/Vagrant/support/apt_list.txt
===================================================================
--- trunk/Tools/Vagrant/support/apt_list.txt	2014-09-29 13:58:02 UTC (rev 8369)
+++ trunk/Tools/Vagrant/support/apt_list.txt	2014-09-30 11:37:11 UTC (rev 8370)
@@ -10,4 +10,4 @@
 
 Need atomic.h copied to /usr/include/asm/atomic.h
 
-build-essential bison automake libtool libpng-dev libjpeg62-dev libxslt-dev libfreetype6-dev libpcre3-dev openjdk-7-jdk subversion lintian ant scons dos2unix libldap-dev libssl-dev libcurl4-openssl-dev libexpat-dev libmysqlclient-dev unixODBC-dev python-dev libpq-dev libcppunit-dev
\ No newline at end of file
+build-essential bison automake libtool libc6-dev libpng-dev libjpeg62-dev libxslt-dev libfreetype6-dev libpcre3-dev openjdk-7-jdk subversion lintian ant scons dos2unix libldap-dev libssl-dev libcurl4-openssl-dev libexpat-dev libmysqlclient-dev unixODBC-dev python-dev libpq-dev libcppunit-dev
\ No newline at end of file

Modified: trunk/Tools/Vagrant/ubuntu/x64/Vagrantfile
===================================================================
--- trunk/Tools/Vagrant/ubuntu/x64/Vagrantfile	2014-09-29 13:58:02 UTC (rev 8369)
+++ trunk/Tools/Vagrant/ubuntu/x64/Vagrantfile	2014-09-30 11:37:11 UTC (rev 8370)
@@ -10,7 +10,7 @@
   # please see the online documentation at vagrantup.com.
 
   # Every Vagrant virtual environment requires a box to build off of.
-  config.vm.box = "vagrant-trusty64"
+  config.vm.box = "vagrant-precise64"
 
   # The url from where the 'config.vm.box' box will be fetched if it
   # doesn't already exist on the user's system.
@@ -126,19 +126,41 @@
 		exit $error
 	fi
 }
+check_test()
+{
+	error=$?
+	if [ $error -ne 0 ]; then
+		echo "[warning]: ${BUILD_COMPONENT} - Unit Tests failed ($error)"
+		echo "[warning]: ${BUILD_COMPONENT} - Unit Tests failed ($error)" >> ~/unit_test_status.log
+	fi
+}
 cd ~
 echo [provision]: Home directory is `pwd`
 echo [provision]: Checking directories
 HAVE_FDO=0
 HAVE_FDO_LIBS=0
 HAVE_MAPGUIDE=0
-MG_UNIT_TEST=0
+MG_UNIT_TEST=1
+FDO_UNIT_TEST=1
 SCRIPT_ROOT=~/scripts
 FDO_SRC_ROOT=~/fdo
-FDO_SRC=$FDO_SRC_ROOT/trunk
+FDO_VER_MM=3.9
+FDO_VER_FULL=${FDO_VER_MM}.0
+MG_VER_MM=3.0
+MG_VER_FULL=${MG_VER_MM}.0
+FDO_SRC_DIR=trunk
+FDO_SRC=$FDO_SRC_ROOT/$FDO_SRC_DIR
 FDO_LIB_SRC=~/fdo_rdbms_thirdparty
 MG_SRC_ROOT=~/mapguide/trunk
 MG_SRC=$MG_SRC_ROOT/MgDev
+FDO_TARBALL=fdo-checkout.tar.gz
+MG_TARBALL=mapguide-checkout.tar.gz
+
+HAVE_FDO_SDK=0
+FDO_SDK_PKG_PATH=~/fdosdk
+FDO_SDK_TARBALL=
+FDO_INST=/usr/local/fdo-${FDO_VER_FULL}
+
 if [ -d $FDO_SRC ]; 
 then
     HAVE_FDO=1
@@ -151,6 +173,21 @@
 then
     HAVE_MAPGUIDE=1
 fi
+if [ -f /mapguide_sources/fdosdk_filename ] && [ -f /mapguide_sources/fdosdk_rev ] && [ -d /mapguide_sources/filelist ];
+then
+    FDO_SDK_TARBALL=`cat /mapguide_sources/fdosdk_filename`
+    FDO_REV=`cat /mapguide_sources/fdosdk_rev`
+    if [ -f /mapguide_sources/$FDO_SDK_TARBALL ];
+    then
+        sudo mkdir -p ${FDO_INST}
+        sudo tar -zxf /mapguide_sources/$FDO_SDK_TARBALL -C ${FDO_INST}
+        HAVE_FDO_SDK=1
+        FDO_UNIT_TEST=0
+        echo [provision]: Using FDO SDK. Not building from source. Not running FDO unit tests.
+    fi
+else
+    echo [provision]: FDO SDK not found. Building FDO from source.
+fi
 if [ -f /usr/include/asm/atomic.h ];
 then
     echo [provision]: atomic.h exists. Doing nothing
@@ -159,12 +196,27 @@
     sudo mkdir -p /usr/include/asm
     sudo cp /mapguide_sources/atomic.h /usr/include/asm
 fi
-echo [provision]: Checking libraries
-sudo apt-get install -y libpq-dev libmysqlclient-dev
+#echo [provision]: Checking libraries
+#sudo apt-get install -y libpq-dev libmysqlclient-dev
+echo [provision]: Clean line endings
+sudo dos2unix /vagrant/*.sh
+sudo dos2unix /vagrant/*.pl
+sudo dos2unix /vagrant/*.txt
 echo [provision]: Copying shell scripts
 mkdir -p $SCRIPT_ROOT
+if [ $HAVE_FDO_SDK -eq 1 ];
+then
+    echo [provision]: Prepare package build area for FDO SDK
+    mkdir -p $FDO_SDK_PKG_PATH
+    cp -R /mapguide_sources/filelist $FDO_SDK_PKG_PATH
+    cp -f /vagrant/dpkgfdo.sh $FDO_SDK_PKG_PATH
+    cp -f /vagrant/dpkgfdocore.sh $FDO_SDK_PKG_PATH
+    cp -f /vagrant/dpkgfdoprovider.sh $FDO_SDK_PKG_PATH
+    cp -f /vagrant/revnum.pl $FDO_SDK_PKG_PATH
+fi
 cp -f /vagrant/*.sh $SCRIPT_ROOT
 cp -f /vagrant/*.pl $SCRIPT_ROOT
+cp -f /vagrant/*.txt $SCRIPT_ROOT
 echo [provision]: Flip Ubuntu switch
 cd $SCRIPT_ROOT
 sed -i 's/UBUNTU=0/UBUNTU=1/g' build.sh
@@ -173,39 +225,52 @@
 sed -i 's/FDO_CPU=x86/FDO_CPU=x64/g' build_fdo.sh
 sed -i 's/FDO_BUILD_CPU=i386/FDO_BUILD_CPU=amd64/g' build_fdo.sh
 sed -i 's/LIB_DIRNAME=lib/LIB_DIRNAME=lib64/g' build_fdo.sh
-if [ $HAVE_FDO_LIBS -eq 0 ];
+if [ $HAVE_FDO_SDK -eq 0 ];
 then
-    echo [provision]: Extracting FDO thirdparty libs
-    tar -zxf /mapguide_sources/fdo_rdbms_thirdparty.tar.gz -C ~
+    if [ $HAVE_FDO_LIBS -eq 0 ];
+    then
+        echo [provision]: Extracting FDO thirdparty libs
+        tar -zxf /mapguide_sources/fdo_rdbms_thirdparty.tar.gz -C ~
+    fi
+    if [ $HAVE_FDO -eq 0 ];
+    then
+        echo [provision]: Extracting FDO working copy
+        mkdir -p $FDO_SRC_ROOT
+        tar -zxf /mapguide_sources/$FDO_TARBALL -C $FDO_SRC_ROOT
+    fi
 fi
-if [ $HAVE_FDO -eq 0 ];
-then
-    echo [provision]: Extracting FDO trunk working copy
-    mkdir -p ~/fdo
-    tar -zxf /mapguide_sources/fdo-checkout.tar.gz -C ~/fdo
-fi
 if [ $HAVE_MAPGUIDE -eq 0 ];
 then
-    echo [provision]: Extracting MapGuide trunk working copy
+    echo [provision]: Extracting MapGuide working copy
     mkdir -p $MG_SRC_ROOT
-    tar -zxf /mapguide_sources/mapguide-checkout.tar.gz -C $MG_SRC_ROOT
+    tar -zxf /mapguide_sources/$MG_TARBALL -C $MG_SRC_ROOT
 fi
-echo [provision]: svn update FDO
-BUILD_COMPONENT="svn update FDO"
-# Only for this VM, svn is 1.8 so we have to upgrade the WC first before it can be updated
-svn upgrade $FDO_SRC
-svn update $FDO_SRC
-check_build
+if [ $HAVE_FDO_SDK -eq 0 ];
+then
+    echo [provision]: svn update FDO
+    BUILD_COMPONENT="svn update FDO"
+    # Only for Ubuntu 14.04 VM, svn is 1.8 so we have to upgrade the WC first before it can be updated
+    #svn upgrade $FDO_SRC
+    svn update $FDO_SRC
+    check_build
+else
+    echo [provision]: Using FDO SDK. No svn update of source required.
+fi
 echo [provision]: svn update MapGuide
 BUILD_COMPONENT="svn update MapGuide"
-# Only for this VM, svn is 1.8 so we have to upgrade the WC first before it can be updated
-svn upgrade $MG_SRC
+# Only for Ubuntu 14.04 VM, svn is 1.8 so we have to upgrade the WC first before it can be updated
+#svn upgrade $MG_SRC
 svn update $MG_SRC
 check_build
-if [ -d /mapguide_sources/patches/fdo ];
+if [ $HAVE_FDO_SDK -eq 0 ];
 then
-    echo [provision]: Applying FDO source patches
-    cp -R /mapguide_sources/patches/fdo/* $FDO_SRC
+    if [ -d /mapguide_sources/patches/fdo ];
+    then
+        echo [provision]: Applying FDO source patches
+        cp -R /mapguide_sources/patches/fdo/* $FDO_SRC
+    fi
+else
+    echo [provision]: Using FDO SDK. No source patches to apply
 fi
 if [ -d /mapguide_sources/patches/mapguide ];
 then
@@ -215,27 +280,96 @@
 echo [provision]: Making sure swig is executable
 chmod +x $MG_SRC/Oem/SWIGEx/Linux/swig
 cd ~/scripts
-BUILD_COMPONENT="FDO"
-sudo -E ./build_fdo.sh 2>&1 | tee ~/fdo_build.log
-check_build
+if [ $HAVE_FDO_SDK -eq 0 ];
+then
+    BUILD_COMPONENT="FDO"
+    sudo -E ./build_fdo.sh 2>&1 | tee ~/fdo_build.log
+    check_build
+    FDO_REV=`svn info $FDO_SRC | perl revnum.pl`
+else
+    echo [provision]: Using FDO SDK. Not building from source
+    echo [provision]: Re-packaging FDO SDK r$FDO_REV as debs
+    FDO_FILELIST=$FDO_SDK_PKG_PATH/filelist
+    pushd $FDO_SDK_PKG_PATH
+    ./dpkgfdo.sh amd64 $FDO_REV 2>&1 | tee ~/dpkg_fdo.log
+    popd
+fi
 BUILD_COMPONENT="MapGuide"
 sudo -E ./build.sh 2>&1 | tee ~/mapguide_build.log
 check_build
 MG_REV=`svn info $MG_SRC | perl revnum.pl`
 BUILD_COMPONENT="MapGuide deb packages"
-sudo ./dpkgmapguide.sh amd64 $MG_REV
+./dpkgmapguide.sh amd64 $MG_REV 2>&1 | tee ~/dpkg_mapguide.log
 check_build
+> ~/unit_test_status.log
+if [ $FDO_UNIT_TEST -eq 1 ];
+then
+    export NLSPATH=/usr/local/fdo-${FDO_VER_FULL}/nls/%N
+    echo [provision]: Unit test FDO
+    BUILD_COMPONENT="Unit Test FDO Core"
+    cd $SCRIPT_ROOT/fdo_build_area/Fdo/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_core_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test SHP Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/SHP/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_shp_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test SDF Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/SDF/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_sdf_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test SQLite Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/SQLite/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_sqlite_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test GDAL Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/GDAL/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_gdal_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test WMS Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/WMS/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_wms_unit_test.log
+    check_test
+fi
 if [ $MG_UNIT_TEST -eq 1 ];
 then
     echo [provision]: Unit test MapGuide
-    cd $SCRIPT_ROOT/mgdev
-    sudo make check 2>&1 | tee ~/mapguide_unit_test.log
+    BUILD_COMPONENT="Unit Test MapGuide Server"
+    # HACK: Tile and Resource Service tests are known to freeze our VMs when driven by vagrant (why? who knows? 
+    # All we know is that those tests involve threads)
+    # So test everything *but* the above services. If required, this can be tested under a manually controlled
+    # VM
+    #
+    # build the individual targets that would comprise "make check" sans execution of unittest.sh
+    cd $SCRIPT_ROOT/mgdev/Server/src/UnitTesting
+    sudo make libMgUnitTesting.la
+    cd $SCRIPT_ROOT/mgdev/Server/src/Core
+    sudo make unittest.sh
+    # Run the test suites individually except for TileService for reasons already stated
+    for comp in CoordinateSystem FeatureService Geometry KmlService LogManager MdfModel Misc RenderingService ServerAdminService ServerManager ServiceManager SiteManager SiteService ProfilingService TransformMesh
+    do
+        sudo -E ./mgserver test $comp UnitTestResults_${comp}.xml 2>&1 | tee ~/mapguide_${comp}_unit_test.log
+        check_test
+        if [ -f UnitTestResults_${comp}.xml ]; then
+            sudo mv UnitTestResults_${comp}.xml ~/UnitTestResults_${comp}.xml
+        fi
+    done
 fi
 cd $SCRIPT_ROOT
 sudo mkdir -p /vagrant/build
 sudo mv -f ~/*.log /vagrant/build
-sudo cp fdo_build_area/install/bin/*.deb /vagrant/build
+if [ $HAVE_FDO_SDK -eq 0 ];
+then
+    sudo cp fdo_build_area/install/bin/*.deb /vagrant/build
+    sudo cp ~/fdo_*_unit_test.log /vagrant/build
+else
+    sudo cp $FDO_SDK_PKG_PATH/bin/*.deb /vagrant/build
+fi
 sudo cp bin/*.deb /vagrant/build
+sudo cp ~/UnitTestResults_*.xml /vagrant/build
+sudo cp /vagrant/mginstallubuntu.sh /vagrant/build/mginstallubuntu.sh
+sudo sed -i 's/FDOBUILD=0/FDOBUILD='"$FDO_REV"'/g' /vagrant/build/mginstallubuntu.sh
+sudo sed -i 's/MGBUILD=0/MGBUILD='"$MG_REV"'/g' /vagrant/build/mginstallubuntu.sh
 # Do not update the working copy tarballs. Ubuntu 14.04 uses svn 1.8 which will break
 # the working copy if copied over to a CentOS VM (which is still on 1.6)
 #
@@ -243,14 +377,14 @@
 #
 #if [ ! -d /mapguide_sources/updated ]; then
 #    sudo mkdir -p /mapguide_sources/updated
-#    cd ~/mapguide/trunk
+#    cd $MG_SRC_ROOT
 #    echo [provision]: Updating mapguide source tarball
-#    tar -zcf mapguide-checkout.tar.gz MgDev
-#    sudo mv mapguide-checkout.tar.gz /mapguide_sources/updated
-#    cd ~/fdo
+#    tar -zcf $MG_TARBALL MgDev
+#    sudo mv $MG_TARBALL /mapguide_sources/updated
+#    cd $FDO_SRC_ROOT
 #    echo [provision]: Updating fdo source tarball
-#    tar -zcf fdo-checkout.tar.gz trunk
-#    sudo mv fdo-checkout.tar.gz /mapguide_sources/updated
+#    tar -zcf $FDO_TARBALL $FDO_SRC_DIR
+#    sudo mv $FDO_TARBALL /mapguide_sources/updated
 #else
 #    echo [provision]: Updated tarballs already exist. Doing nothing
 #fi

Modified: trunk/Tools/Vagrant/ubuntu/x86/Vagrantfile
===================================================================
--- trunk/Tools/Vagrant/ubuntu/x86/Vagrantfile	2014-09-29 13:58:02 UTC (rev 8369)
+++ trunk/Tools/Vagrant/ubuntu/x86/Vagrantfile	2014-09-30 11:37:11 UTC (rev 8370)
@@ -10,7 +10,7 @@
   # please see the online documentation at vagrantup.com.
 
   # Every Vagrant virtual environment requires a box to build off of.
-  config.vm.box = "vagrant-trusty32"
+  config.vm.box = "vagrant-precise32"
 
   # The url from where the 'config.vm.box' box will be fetched if it
   # doesn't already exist on the user's system.
@@ -126,19 +126,41 @@
 		exit $error
 	fi
 }
+check_test()
+{
+	error=$?
+	if [ $error -ne 0 ]; then
+		echo "[warning]: ${BUILD_COMPONENT} - Unit Tests failed ($error)"
+		echo "[warning]: ${BUILD_COMPONENT} - Unit Tests failed ($error)" >> ~/unit_test_status.log
+	fi
+}
 cd ~
 echo [provision]: Home directory is `pwd`
 echo [provision]: Checking directories
 HAVE_FDO=0
 HAVE_FDO_LIBS=0
 HAVE_MAPGUIDE=0
-MG_UNIT_TEST=0
+MG_UNIT_TEST=1
+FDO_UNIT_TEST=1
 SCRIPT_ROOT=~/scripts
 FDO_SRC_ROOT=~/fdo
-FDO_SRC=$FDO_SRC_ROOT/trunk
+FDO_VER_MM=3.9
+FDO_VER_FULL=${FDO_VER_MM}.0
+MG_VER_MM=3.0
+MG_VER_FULL=${MG_VER_MM}.0
+FDO_SRC_DIR=trunk
+FDO_SRC=$FDO_SRC_ROOT/$FDO_SRC_DIR
 FDO_LIB_SRC=~/fdo_rdbms_thirdparty
 MG_SRC_ROOT=~/mapguide/trunk
 MG_SRC=$MG_SRC_ROOT/MgDev
+FDO_TARBALL=fdo-checkout.tar.gz
+MG_TARBALL=mapguide-checkout.tar.gz
+
+HAVE_FDO_SDK=0
+FDO_SDK_PKG_PATH=~/fdosdk
+FDO_SDK_TARBALL=
+FDO_INST=/usr/local/fdo-${FDO_VER_FULL}
+
 if [ -d $FDO_SRC ]; 
 then
     HAVE_FDO=1
@@ -151,6 +173,21 @@
 then
     HAVE_MAPGUIDE=1
 fi
+if [ -f /mapguide_sources/fdosdk_filename ] && [ -f /mapguide_sources/fdosdk_rev ] && [ -d /mapguide_sources/filelist ];
+then
+    FDO_SDK_TARBALL=`cat /mapguide_sources/fdosdk_filename`
+    FDO_REV=`cat /mapguide_sources/fdosdk_rev`
+    if [ -f /mapguide_sources/$FDO_SDK_TARBALL ];
+    then
+        sudo mkdir -p ${FDO_INST}
+        sudo tar -zxf /mapguide_sources/$FDO_SDK_TARBALL -C ${FDO_INST}
+        HAVE_FDO_SDK=1
+        FDO_UNIT_TEST=0
+        echo [provision]: Using FDO SDK. Not building from source. Not running FDO unit tests.
+    fi
+else
+    echo [provision]: FDO SDK not found. Building FDO from source.
+fi
 if [ -f /usr/include/asm/atomic.h ];
 then
     echo [provision]: atomic.h exists. Doing nothing
@@ -159,12 +196,27 @@
     sudo mkdir -p /usr/include/asm
     sudo cp /mapguide_sources/atomic.h /usr/include/asm
 fi
-echo [provision]: Checking libraries
-sudo apt-get install -y libpq-dev libmysqlclient-dev
+#echo [provision]: Checking libraries
+#sudo apt-get install -y libpq-dev libmysqlclient-dev
+echo [provision]: Clean line endings
+sudo dos2unix /vagrant/*.sh
+sudo dos2unix /vagrant/*.pl
+sudo dos2unix /vagrant/*.txt
 echo [provision]: Copying shell scripts
 mkdir -p $SCRIPT_ROOT
+if [ $HAVE_FDO_SDK -eq 1 ];
+then
+    echo [provision]: Prepare package build area for FDO SDK
+    mkdir -p $FDO_SDK_PKG_PATH
+    cp -R /mapguide_sources/filelist $FDO_SDK_PKG_PATH
+    cp -f /vagrant/dpkgfdo.sh $FDO_SDK_PKG_PATH
+    cp -f /vagrant/dpkgfdocore.sh $FDO_SDK_PKG_PATH
+    cp -f /vagrant/dpkgfdoprovider.sh $FDO_SDK_PKG_PATH
+    cp -f /vagrant/revnum.pl $FDO_SDK_PKG_PATH
+fi
 cp -f /vagrant/*.sh $SCRIPT_ROOT
 cp -f /vagrant/*.pl $SCRIPT_ROOT
+cp -f /vagrant/*.txt $SCRIPT_ROOT
 echo [provision]: Flip Ubuntu switch
 cd $SCRIPT_ROOT
 sed -i 's/UBUNTU=0/UBUNTU=1/g' build.sh
@@ -173,39 +225,52 @@
 sed -i 's/FDO_CPU=x64/FDO_CPU=x86/g' build_fdo.sh
 sed -i 's/FDO_BUILD_CPU=amd64/FDO_BUILD_CPU=i386/g' build_fdo.sh
 sed -i 's/LIB_DIRNAME=lib64/LIB_DIRNAME=lib/g' build_fdo.sh
-if [ $HAVE_FDO_LIBS -eq 0 ];
+if [ $HAVE_FDO_SDK -eq 0 ];
 then
-    echo [provision]: Extracting FDO thirdparty libs
-    tar -zxf /mapguide_sources/fdo_rdbms_thirdparty.tar.gz -C ~
+    if [ $HAVE_FDO_LIBS -eq 0 ];
+    then
+        echo [provision]: Extracting FDO thirdparty libs
+        tar -zxf /mapguide_sources/fdo_rdbms_thirdparty.tar.gz -C ~
+    fi
+    if [ $HAVE_FDO -eq 0 ];
+    then
+        echo [provision]: Extracting FDO working copy
+        mkdir -p $FDO_SRC_ROOT
+        tar -zxf /mapguide_sources/$FDO_TARBALL -C $FDO_SRC_ROOT
+    fi
 fi
-if [ $HAVE_FDO -eq 0 ];
-then
-    echo [provision]: Extracting FDO trunk working copy
-    mkdir -p ~/fdo
-    tar -zxf /mapguide_sources/fdo-checkout.tar.gz -C ~/fdo
-fi
 if [ $HAVE_MAPGUIDE -eq 0 ];
 then
-    echo [provision]: Extracting MapGuide trunk working copy
+    echo [provision]: Extracting MapGuide working copy
     mkdir -p $MG_SRC_ROOT
-    tar -zxf /mapguide_sources/mapguide-checkout.tar.gz -C $MG_SRC_ROOT
+    tar -zxf /mapguide_sources/$MG_TARBALL -C $MG_SRC_ROOT
 fi
-echo [provision]: svn update FDO
-BUILD_COMPONENT="svn update FDO"
-# Only for this VM, svn is 1.8 so we have to upgrade the WC first before it can be updated
-svn upgrade $FDO_SRC
-svn update $FDO_SRC
-check_build
+if [ $HAVE_FDO_SDK -eq 0 ];
+then
+    echo [provision]: svn update FDO
+    BUILD_COMPONENT="svn update FDO"
+    # Only for Ubuntu 14.04 VM, svn is 1.8 so we have to upgrade the WC first before it can be updated
+    #svn upgrade $FDO_SRC
+    svn update $FDO_SRC
+    check_build
+else
+    echo [provision]: Using FDO SDK. No svn update of source required.
+fi
 echo [provision]: svn update MapGuide
 BUILD_COMPONENT="svn update MapGuide"
-# Only for this VM, svn is 1.8 so we have to upgrade the WC first before it can be updated
-svn upgrade $MG_SRC
+# Only for Ubuntu 14.04 VM, svn is 1.8 so we have to upgrade the WC first before it can be updated
+#svn upgrade $MG_SRC
 svn update $MG_SRC
 check_build
-if [ -d /mapguide_sources/patches/fdo ];
+if [ $HAVE_FDO_SDK -eq 0 ];
 then
-    echo [provision]: Applying FDO source patches
-    cp -R /mapguide_sources/patches/fdo/* $FDO_SRC
+    if [ -d /mapguide_sources/patches/fdo ];
+    then
+        echo [provision]: Applying FDO source patches
+        cp -R /mapguide_sources/patches/fdo/* $FDO_SRC
+    fi
+else
+    echo [provision]: Using FDO SDK. No source patches to apply
 fi
 if [ -d /mapguide_sources/patches/mapguide ];
 then
@@ -215,27 +280,96 @@
 echo [provision]: Making sure swig is executable
 chmod +x $MG_SRC/Oem/SWIGEx/Linux/swig
 cd ~/scripts
-BUILD_COMPONENT="FDO"
-sudo -E ./build_fdo.sh 2>&1 | tee ~/fdo_build.log
-check_build
+if [ $HAVE_FDO_SDK -eq 0 ];
+then
+    BUILD_COMPONENT="FDO"
+    sudo -E ./build_fdo.sh 2>&1 | tee ~/fdo_build.log
+    check_build
+    FDO_REV=`svn info $FDO_SRC | perl revnum.pl`
+else
+    echo [provision]: Using FDO SDK. Not building from source
+    echo [provision]: Re-packaging FDO SDK r$FDO_REV as debs
+    FDO_FILELIST=$FDO_SDK_PKG_PATH/filelist
+    pushd $FDO_SDK_PKG_PATH
+    ./dpkgfdo.sh i386 $FDO_REV 2>&1 | tee ~/dpkg_fdo.log
+    popd
+fi
 BUILD_COMPONENT="MapGuide"
 sudo -E ./build.sh 2>&1 | tee ~/mapguide_build.log
 check_build
 MG_REV=`svn info $MG_SRC | perl revnum.pl`
 BUILD_COMPONENT="MapGuide deb packages"
-sudo ./dpkgmapguide.sh i386 $MG_REV
+./dpkgmapguide.sh i386 $MG_REV 2>&1 | tee ~/dpkg_mapguide.log
 check_build
+> ~/unit_test_status.log
+if [ $FDO_UNIT_TEST -eq 1 ];
+then
+    export NLSPATH=/usr/local/fdo-${FDO_VER_FULL}/nls/%N
+    echo [provision]: Unit test FDO
+    BUILD_COMPONENT="Unit Test FDO Core"
+    cd $SCRIPT_ROOT/fdo_build_area/Fdo/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_core_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test SHP Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/SHP/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_shp_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test SDF Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/SDF/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_sdf_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test SQLite Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/SQLite/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_sqlite_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test GDAL Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/GDAL/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_gdal_unit_test.log
+    check_test
+    BUILD_COMPONENT="Unit Test WMS Provider"
+    cd $SCRIPT_ROOT/fdo_build_area/Providers/WMS/Src/UnitTest
+    sudo -E ./UnitTest 2>&1 | tee ~/fdo_wms_unit_test.log
+    check_test
+fi
 if [ $MG_UNIT_TEST -eq 1 ];
 then
     echo [provision]: Unit test MapGuide
-    cd $SCRIPT_ROOT/mgdev
-    sudo make check 2>&1 | tee ~/mapguide_unit_test.log
+    BUILD_COMPONENT="Unit Test MapGuide Server"
+    # HACK: Tile and Resource Service tests are known to freeze our VMs when driven by vagrant (why? who knows? 
+    # All we know is that those tests involve threads)
+    # So test everything *but* the above services. If required, this can be tested under a manually controlled
+    # VM
+    #
+    # build the individual targets that would comprise "make check" sans execution of unittest.sh
+    cd $SCRIPT_ROOT/mgdev/Server/src/UnitTesting
+    sudo make libMgUnitTesting.la
+    cd $SCRIPT_ROOT/mgdev/Server/src/Core
+    sudo make unittest.sh
+    # Run the test suites individually except for TileService for reasons already stated
+    for comp in CoordinateSystem FeatureService Geometry KmlService LogManager MdfModel Misc RenderingService ServerAdminService ServerManager ServiceManager SiteManager SiteService ProfilingService TransformMesh
+    do
+        sudo -E ./mgserver test $comp UnitTestResults_${comp}.xml 2>&1 | tee ~/mapguide_${comp}_unit_test.log
+        check_test
+        if [ -f UnitTestResults_${comp}.xml ]; then
+            sudo mv UnitTestResults_${comp}.xml ~/UnitTestResults_${comp}.xml
+        fi
+    done
 fi
 cd $SCRIPT_ROOT
 sudo mkdir -p /vagrant/build
 sudo mv -f ~/*.log /vagrant/build
-sudo cp fdo_build_area/install/bin/*.deb /vagrant/build
+if [ $HAVE_FDO_SDK -eq 0 ];
+then
+    sudo cp fdo_build_area/install/bin/*.deb /vagrant/build
+    sudo cp ~/fdo_*_unit_test.log /vagrant/build
+else
+    sudo cp $FDO_SDK_PKG_PATH/bin/*.deb /vagrant/build
+fi
 sudo cp bin/*.deb /vagrant/build
+sudo cp ~/UnitTestResults_*.xml /vagrant/build
+sudo cp /vagrant/mginstallubuntu.sh /vagrant/build/mginstallubuntu.sh
+sudo sed -i 's/FDOBUILD=0/FDOBUILD='"$FDO_REV"'/g' /vagrant/build/mginstallubuntu.sh
+sudo sed -i 's/MGBUILD=0/MGBUILD='"$MG_REV"'/g' /vagrant/build/mginstallubuntu.sh
 # Do not update the working copy tarballs. Ubuntu 14.04 uses svn 1.8 which will break
 # the working copy if copied over to a CentOS VM (which is still on 1.6)
 #
@@ -243,14 +377,14 @@
 #
 #if [ ! -d /mapguide_sources/updated ]; then
 #    sudo mkdir -p /mapguide_sources/updated
-#    cd ~/mapguide/trunk
+#    cd $MG_SRC_ROOT
 #    echo [provision]: Updating mapguide source tarball
-#    tar -zcf mapguide-checkout.tar.gz MgDev
-#    sudo mv mapguide-checkout.tar.gz /mapguide_sources/updated
-#    cd ~/fdo
+#    tar -zcf $MG_TARBALL MgDev
+#    sudo mv $MG_TARBALL /mapguide_sources/updated
+#    cd $FDO_SRC_ROOT
 #    echo [provision]: Updating fdo source tarball
-#    tar -zcf fdo-checkout.tar.gz trunk
-#    sudo mv fdo-checkout.tar.gz /mapguide_sources/updated
+#    tar -zcf $FDO_TARBALL $FDO_SRC_DIR
+#    sudo mv $FDO_TARBALL /mapguide_sources/updated
 #else
 #    echo [provision]: Updated tarballs already exist. Doing nothing
 #fi



More information about the mapguide-commits mailing list