Index: main/trunk/greenstone3/build.xml
===================================================================
--- main/trunk/greenstone3/build.xml	(revision 36123)
+++ main/trunk/greenstone3/build.xml	(revision 36124)
@@ -347,4 +347,7 @@
 	</if>
 
+	<condition property="googlesignin.enabled" value="true" else="false">
+	  <isset property="${tomcat.googlesigninJDBCRealm.clientid}"/>
+	</condition>
   <!-- now we've read in properties, apply defaults -->
   <property name="disable.collection.building" value="false"/>
@@ -381,5 +384,9 @@
   <property name="axis.zip.version" value="axis-bin-1_4.zip"/>
   <property name="axis.dir.version" value="axis-1_4"/>
+
+  <!-- these properties used for unzip-windows-packages -->
   <property name="sqlite.targz.version" value="sqlite-autoconf-3070602.tar.gz"/>
+  <property name="expat.targz.version" value="expat-1.95.8.tar.gz"/>
+  <property name="jdbm.targz.version" value="gs-jdbm-1.0.tar.gz"/>
 
   <property name="build.home" value="${basedir}/build"/>
@@ -794,5 +801,8 @@
     <istrue value="${disable.collection.building}"/>
   </condition>
-  
+  <condition property="common.src.binhome" value="${basedir}" else="${gs2build.home}">
+    <istrue value="${disable.collection.building}"/>
+  </condition>
+
   <property name="build.src.home" value="${gs2build.home}/build-src"/>
   <property name="gdbm.home" value="${common.src.home}/packages/gdbm"/>
@@ -3326,8 +3336,9 @@
     <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
 
-
-    <antcall target="googlesignin-jar-with-dependencies" />
-    <copy file="${build.home}/googlesignin-jdbcrealm.jar" todir="${catalina.home}/lib"/>
-    
+    <if>
+      <bool><istrue value="${googlesignin.enabled}"/></bool>
+      <antcall target="googlesignin-jar-with-dependencies" />
+      <copy file="${build.home}/googlesignin-jdbcrealm.jar" todir="${catalina.home}/lib"/>
+    </if>
     <jar destfile="${build.home}/gutil.jar">
       <fileset dir="${build.home}">
@@ -3411,5 +3422,5 @@
   </target>
 
-  <target name="googlesignin-checkforchanges">
+  <target name="googlesignin-checkforchanges" if="${googlesignin.enabled}">
     <uptodate property="googlesignin-nochanges" targetfile="${build.home}/googlesignin-jdbcrealm.jar">
       <srcfiles dir="${build.home}" includes="org/greenstone/gsdl3/GoogleSigninJDBCRealm.class"/>
@@ -3417,5 +3428,5 @@
   </target>
   
-  <target name="googlesignin-jar-with-dependencies" depends="init,googlesignin-checkforchanges" unless="googlesignin-nochanges">
+  <target name="googlesignin-jar-with-dependencies" depends="init,googlesignin-checkforchanges" unless="googlesignin-nochanges" if="${googlesignin.enabled}">
     <path id="googlesignin-jar-dependencies">
       <fileset dir="${web.lib}">
@@ -3734,6 +3745,6 @@
     <exec executable="${common.src.home}/configure" os="${os.unix}"
       dir="${common.src.home}" failonerror="true">
-      <arg value="--prefix=${gs2build.home}"/> <!-- what value to use?? -->
-      <arg value="--bindir=${gs2build.home}/bin/${os.bin.dir}"/> <!-- what value to use?? -->
+      <arg value="--prefix=${common.src.binhome}"/> <!-- what value to use?? -->
+      <arg value="--bindir=${common.src.binhome}/bin/${os.bin.dir}"/> <!-- what value to use?? -->
       <arg line="${gs2.opt.args}"/>
       <arg line="${static.arg}"/>
@@ -3755,5 +3766,5 @@
       <arg value="win32.mak"/>
       <arg value="clean"/>
-      <arg value="GSDLHOME=${gs2build.home}"/>
+      <arg value="GSDLHOME=${common.src.binhome}"/>
     </exec>
   </target>
@@ -3770,5 +3781,5 @@
       <arg value="win32.mak"/>
       <arg value="clean"/>
-      <arg value="GSDLHOME=${gs2build.home}"/>
+      <arg value="GSDLHOME=${common.src.binhome}"/>
     </exec>
   </target>
@@ -3783,5 +3794,5 @@
       <arg value="win32.mak"/>
       <arg value="VISUAL_STUDIO_MAJORVERSION=${visualstudio.majorversion}"/>      
-      <arg value="GSDLHOME=${gs2build.home}"/>
+      <arg value="GSDLHOME=${common.src.binhome}"/>
       <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
       <arg value="ENABLE_MG=${gs2.windows.enablemg}"/>
@@ -4249,5 +4260,10 @@
       src="${common.src.home}/packages/sqlite/${sqlite.targz.version}"
       dest="${common.src.home}/packages/sqlite"/>
-
+    <untar compression="gzip"
+	   src="${common.src.home}/packages/expat/${expat.targz.version}"
+	   dest="${common.src.home}/packages/expat"/>
+    <untar compression="gzip"
+	   src="${common.src.home}/packages/jdbm/${jdbm.targz.version}"
+	   dest="${common.src.home}/packages/jdbm"/>
     <if>
       <bool>
