Index: release-kits/mark2/ant-scripts/build.xml
===================================================================
--- release-kits/mark2/ant-scripts/build.xml	(revision 16452)
+++ release-kits/mark2/ant-scripts/build.xml	(revision 16453)
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <!--
-		.......................................................... 
+		..........................................................
 		June 2008
-		Linux Release Kit for Greenstone2 (lirk2)
+		Mac Release Kit for Greenstone2 (mark2)
 		Oran Fry
 		..........................................................
 -->
-<project name="lirk2-build" default="lirk2">
+<project name="mark2-build" default="mark2">
 
 	<!-- CONSTANTS -->
@@ -16,5 +16,5 @@
 
 	<!-- for the benefit of the shared scripts, set release-kit home -->
-	<property name="rk.home" value="${lirk2.home}" />
+	<property name="rk.home" value="${mark2.home}" />
 
 	<!-- IMPORT OTHER ANT SCRIPTS -->
@@ -26,5 +26,5 @@
 
 	<!-- THE MAIN TARGET -->
-	<target name="lirk2" depends="init">
+	<target name="mark2" depends="init">
 		<addressedcall target="compile"/>
 		<addressedcall target="create-distribution"/>
Index: release-kits/mark2/ant-scripts/compile.xml
===================================================================
--- release-kits/mark2/ant-scripts/compile.xml	(revision 16452)
+++ release-kits/mark2/ant-scripts/compile.xml	(revision 16453)
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8" ?>
-<project name="lirk2-compile" default="compile">
+<project name="mark2-compile" default="compile">
 
 	<target name="compile">
@@ -8,12 +8,9 @@
 		
 		<!-- configure -->
-		<addressedcall target="add-static-to-configure-in"/>
-		<addressedcall target="set-environment-in-packages-configure"/>
 		<addressedcall target="run-configure"/>
-		<addressedcall target="makefiles-add-static"/>
+		<addressedcall target="tweak-makefiles"/>
 
 		<!-- make -->
 		<addressedcall target="run-make"/>
-		<!-- <addressedcall target="fix-wget"/> upgraded wget, mightn't need to do this now -->
 		<addressedcall target="run-make-install"/>
 		<addressedcall target="copy-library-oai"/>
@@ -35,31 +32,20 @@
 	</target>
 
-	<target name="add-static-to-configure-in">
-		<if><bool><istrue value="${execute}"/></bool>
-			<rsr file="${basedir}/gsdl/configure.in" pattern="^LDFLAGS=.*$" replacement="LDFLAGS=-static"/>
-			<exec dir="${basedir}/gsdl" executable="autoconf" output="${basedir}/gsdl/configure"><arg value="configure.in"/></exec>
-		</if>
-	</target>
-
-	<target name="set-environment-in-packages-configure">
-		<if><bool><istrue value="${execute}"/></bool>
-			<rsr file="${basedir}/gsdl/packages/configure" pattern="^ENVIRONMENT=.*$" replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;"/>
-		</if>
-	</target>
-
 	<target name="run-configure">
 		<if><bool><istrue value="${execute}"/></bool>
 			<exec dir="${basedir}/gsdl" executable="${basedir}/gsdl/configure">
-				<env key="LDFLAGS" value="-static"/>
+				<arg line="--with-gdbm=${mark2.home}/linux/gdbm-1.8.3"/>
 			</exec>
 		</if>
 	</target>
 
-	<target name="makefiles-add-static">
+	<target name="tweak-makefiles">
 		<if><bool><istrue value="${execute}"/></bool>
-			<rsr file="${basedir}/gsdl/packages/wv/wv-gs/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static" />
-			<rsr file="${basedir}/gsdl/packages/xlhtml/xlhtml-0.4.9.0/xlhtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static" />
-			<rsr file="${basedir}/gsdl/packages/xlhtml/xlhtml-0.4.9.0/ppthtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static" />
-			<rsr file="${basedir}/gsdl/packages/rtftohtml/rtftohtml_src/Makefile" pattern="(-o rtftohtml.{2}EXEEXT.{1})" replacement="$1 -static" />
+	<rsr file="${basedir}/gsdl/src/recpt/Makefile" pattern="^(LIBS =.*)-L${mark2.home}/linux/gdbm-1.8.3/lib -lgdbm(.*)$" replacement="$1${mark2.home}/linux/gdbm-1.8.3/lib/libgdbm.a$2" />
+	<rsr file="${basedir}/gsdl/src/oaiservr/Makefile" pattern="^(LIBS =.*)-L${mark2.home}/linux/gdbm-1.8.3/lib -lgdbm(.*)$" replacement="$1${mark2.home}/linux/gdbm-1.8.3/lib/libgdbm.a$2" />
+	<rsr file="${basedir}/gsdl/src/gdbmedit/db2txt/Makefile" pattern="^(LIBS =.*)-L${mark2.home}/linux/gdbm-1.8.3/lib -lgdbm(.*)$" replacement="$1${mark2.home}/linux/gdbm-1.8.3/lib/libgdbm.a$2" />
+	<rsr file="${basedir}/gsdl/src/gdbmedit/txt2db/Makefile" pattern="^(LIBS =.*)-L${mark2.home}/linux/gdbm-1.8.3/lib -lgdbm(.*)$" replacement="$1${mark2.home}/linux/gdbm-1.8.3/lib/libgdbm.a$2" />
+	<rsr file="${basedir}/gsdl/src/recpt/Makefile" pattern="^(LIBS =.*)-L(.)\(PACKAGES_DIR\)/expat/lib -lexpat(.*)$" replacement="$1$2(PACKAGES_DIR)/expat/lib/libexpat.a$3" />
+	<rsr file="${basedir}/gsdl/src/oaiservr/Makefile" pattern="^(LIBS =.*)-L(.)\(PACKAGES_DIR\)/expat/lib -lexpat(.*)$" replacement="$1$2(PACKAGES_DIR)/expat/lib/libexpat.a$3" />
 		</if>
 	</target>
@@ -71,12 +57,4 @@
 	</target>
 
-	<target name="fix-wget">
-		<if><bool><istrue value="${execute}"/></bool>
-			<delete file="${basedir}/gsdl/packages/wget/wget-1.9/src/wget"/>
-			<exec dir="${basedir}/gsdl/packages/wget/wget-1.9/src" executable="gcc"><arg line="-O2 -Wall -Wno-implicit -o wget cmpt.o connect.o convert.o cookies.o ftp.o ftp-basic.o ftp-ls.o ftp-opie.o hash.o headers.o host.o html-parse.o html-url.o http.o init.o log.o main.o gen-md5.o netrc.o progress.o rbuf.o recur.o res.o retr.o safe-ctype.o snprintf.o gen_sslfunc.o url.o utils.o version.o  -lssl -lcrypto -ldl -static"/></exec>
-		</if>
-	</target>
-	
-
 	<target name="run-make-install">
 		<if><bool><istrue value="${execute}"/></bool>
@@ -87,6 +65,6 @@
 	<target name="copy-library-oai">
 		<if><bool><istrue value="${execute}"/></bool>
-			<exec executable="cp"><arg line="${basedir}/gsdl/cgi-bin/library ${basedir}/gsdl/bin/linux/library"/></exec>
-			<exec executable="cp"><arg line="${basedir}/gsdl/cgi-bin/oaiserver ${basedir}/gsdl/bin/linux/oaiserver"/></exec>
+			<exec executable="cp"><arg line="${basedir}/gsdl/cgi-bin/library ${basedir}/gsdl/bin/darwin/library"/></exec>
+			<exec executable="cp"><arg line="${basedir}/gsdl/cgi-bin/oaiserver ${basedir}/gsdl/bin/darwin/oaiserver"/></exec>
 		</if>
 	</target>
@@ -94,6 +72,6 @@
 	<target name="strip-execs">
 		<if><bool><istrue value="${execute}"/></bool>
-			<exec dir="${basedir}/gsdl/bin/linux" executable="find">
-				<arg line="! -name . -type f -maxdepth 1 -exec strip {} &#59;"/>
+			<exec dir="${basedir}/gsdl/bin/darwin" executable="find">
+				<arg line=". ! -name . -type f -maxdepth 1 -exec strip {} &#59;"/>
 			</exec>
 		</if>
@@ -102,9 +80,7 @@
 	<target name="build-demo-collection">
 		<if><bool><istrue value="${execute}"/></bool>
-			<exec dir="${basedir}/gsdl" executable="${lirk2.home}/resources/build-demo.sh"/>
+			<exec dir="${basedir}/gsdl" executable="${mark2.home}/resources/build-demo.sh"/>
 		</if>
 	</target>
 
-
-
 </project>
Index: release-kits/mark2/ant-scripts/create-distribution.xml
===================================================================
--- release-kits/mark2/ant-scripts/create-distribution.xml	(revision 16452)
+++ release-kits/mark2/ant-scripts/create-distribution.xml	(revision 16453)
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8" ?>
-<project name="lirk2-create-distribution" default="create-distribution">
+<project name="mark2-create-distribution" default="create-distribution">
 
 
@@ -47,5 +47,5 @@
 	<target name="dist-set-gli-version">
 		<if><bool><istrue value="${execute}"/></bool>
-			<ant antfile="${lirk2.home}/ant-scripts/shared-ant-scripts/operations-on-gli.xml" dir="${basedir}/distributions/web/gli" target="set-version-numbers"/>
+			<ant antfile="${mark2.home}/ant-scripts/shared-ant-scripts/operations-on-gli.xml" dir="${basedir}/distributions/web/gli" target="set-version-numbers"/>
 		</if>
 	</target>
@@ -73,5 +73,5 @@
 			<echo level="info">Dropping gsdl docs  into distribution</echo>
 			<copy todir="${basedir}/distributions/web" overwrite="true">
-				<fileset dir="${lirk2.home}/greenstone2/docs"/>
+				<fileset dir="${mark2.home}/greenstone2/docs"/>
 			</copy>
 		</if>
Index: release-kits/mark2/ant-scripts/create-installer.xml
===================================================================
--- release-kits/mark2/ant-scripts/create-installer.xml	(revision 16452)
+++ release-kits/mark2/ant-scripts/create-installer.xml	(revision 16453)
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8" ?>
-<project name="lirk2-create-installer" default="create-installer">
+<project name="mark2-create-installer" default="create-installer">
 
 	<target name="create-installer">
@@ -12,9 +12,9 @@
 			<echo>Getting things ready to compile the installer</echo>
 			<mkdir dir="${basedir}/installer/classes"/>
-			<copy todir="${basedir}/installer" file="${lirk2.home}/installer/antinstall-config.xml" overwrite="true"/>
-			<copy todir="${basedir}/installer" file="${lirk2.home}/installer/build.xml" overwrite="true"/>
+			<copy todir="${basedir}/installer" file="${mark2.home}/installer/antinstall-config.xml" overwrite="true"/>
+			<copy todir="${basedir}/installer" file="${mark2.home}/installer/build.xml" overwrite="true"/>
 			<copy todir="${basedir}/installer/classes" overwrite="true">
-				<fileset dir="${lirk2.home}/greenstone2/installer-classes"/>
-				<fileset dir="${lirk2.home}/ant-scripts/tasks/orans" includes="RegexSearchReplace.class" />
+				<fileset dir="${mark2.home}/greenstone2/installer-classes"/>
+				<fileset dir="${mark2.home}/ant-scripts/tasks/orans" includes="RegexSearchReplace.class" />
 			</copy>
 
@@ -38,11 +38,11 @@
 
 			<!-- create the installer with java -->
-			<installer file="${basedir}/installer/greenstone-${version}-linux-with-java.jar"
+			<installer file="${basedir}/installer/Greenstone-${version}-MacOS-x86-with-java.jar"
 					compress="true"
 					extractType="NonExtractor"
 					installConfig="${basedir}/installer/antinstall-config.xml"
 					buildFile="${basedir}/installer/build.xml"
-					antInstallLib="${lirk2.home}/packages/ant-installer/lib"
-					antLib="${lirk2.home}/packages/ant/lib"
+					antInstallLib="${mark2.home}/packages/ant-installer/lib"
+					antLib="${mark2.home}/packages/ant/lib"
 					validateConfig="true"
 					failOnError="false"
@@ -58,11 +58,11 @@
 
 			<!-- create the installer without java -->
-			<installer file="${basedir}/installer/greenstone-${version}-linux.jar"
+			<installer file="${basedir}/installer/Greenstone-${version}-MacOS-x86.jar"
 					compress="true"
 					extractType="NonExtractor"
 					installConfig="${basedir}/installer/antinstall-config.xml"
 					buildFile="${basedir}/installer/build.xml"
-					antInstallLib="${lirk2.home}/packages/ant-installer/lib"
-					antLib="${lirk2.home}/packages/ant/lib"
+					antInstallLib="${mark2.home}/packages/ant-installer/lib"
+					antLib="${mark2.home}/packages/ant/lib"
 					validateConfig="true"
 					failOnError="false"
Index: release-kits/mark2/ant-scripts/wrap.xml
===================================================================
--- release-kits/mark2/ant-scripts/wrap.xml	(revision 16452)
+++ release-kits/mark2/ant-scripts/wrap.xml	(revision 16453)
@@ -1,95 +1,38 @@
 <?xml version="1.0" encoding="utf-8" ?>
-<project name="lirk2-wrap" default="wrap">
+<project name="mark2-wrap" default="wrap">
 
 	<target name="wrap">
-		<addressedcall target="setup-for-wrapping"/>
-		<addressedcall target="compile-wrapper"/>
-	</target>
-
-
-	<target name="setup-for-wrapping">
 		<if><bool><istrue value="${execute}"/></bool>
 
 			<!-- create and setup the build directory -->
-			<mkdir dir="${basedir}/wrapped-installer/build"/>
-			<copy todir="${basedir}/wrapped-installer/build" file="${lirk2.home}/linux/wrapper.cpp"/>
-			<copy todir="${basedir}/wrapped-installer/build" file="${lirk2.home}/packages/search4j/libsearch4j.cpp"/>
-			<copy todir="${basedir}/wrapped-installer/build" file="${lirk2.home}/packages/search4j/libsearch4j.h"/>
+			<delete dir="${basedir}/wrapped-installer"/>
+			<mkdir dir="${basedir}/wrapped-installer"/>
+			<copy todir="${basedir}/wrapped-installer/Greenstone${version}.app"><fileset dir="${mark2.home}/mac/Wrapper.app"/></copy>
+			<chmod file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/MacOS/JavaApplicationStub" perm="ug+x"/>
 
 			<!-- copy bundled files -->
-			<copy todir="${basedir}/wrapped-installer/build" file="${lirk2.home}/linux/${linux-java.installer}"/>
-			<copy tofile="${basedir}/wrapped-installer/build/greenstone2.jar" file="${basedir}/installer/greenstone-${version}-linux.jar"/>
-			<copy tofile="${basedir}/wrapped-installer/build/greenstone2-with-java.jar" file="${basedir}/installer/greenstone-${version}-linux-with-java.jar"/>
+			<!--<copy todir="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Resources/Java" file="${mark2.home}/linux/${linux-java.installer}"/>-->
+			<copy todir="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Resources/Java" file="${basedir}/installer/Greenstone-${version}-MacOS-x86.jar"/>
 
 			<!-- substitute in real values -->
-			<rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.installer@" replacement="${linux-java.installer}"/>
-			<rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@installer.name@" replacement="greenstone2"/>
-			<rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.extracted@" replacement="${linux-java.extracted}"/>
-			<rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.min.version@" replacement="${java.min.version}"/>
+			<rsr file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Info.plist" pattern="@jar@" replacement="Greenstone-${version}-MacOS-x86.jar"/>
+			<rsr file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Info.plist" pattern="@version@" replacement="${version}"/>
 
-		</if>
-	</target>
+                        <!-- get size of app -->
+                        <exec executable="du" dir="${basedir}/wrapped-installer" outputproperty="app.du"><arg line="-ks Greenstone${version}.app"/></exec>
+			<echo>app.du: ${app.du}</echo>
+                        <exec executable="sed" inputstring="${app.du}" outputproperty="app.size"><arg line="-e 's/^\([0-9]*\).*$/\1/g'"/></exec>
+			<echo>app.size: ${app.size}</echo>
+			<math result="dmg.size" operand1="${app.size}" operation="+" operand2="2048" datatype="int"/>
+			<echo>dmg.size: ${dmg.size}</echo>
 
-	<target name="compile-wrapper">
-		<if><bool><istrue value="${execute}"/></bool>
-
-			<echo level="info">create an object file (extension .o) for each file to bundle</echo>
-			<exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer/build">
-				<arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_greenstone2_jar_start=greenstone2jar --readonly-text greenstone2.jar greenstone2.jar.o"/>
-			</exec>
-			<exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer/build">
-				<arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_greenstone2_with_java_jar_start=greenstone2jar --readonly-text greenstone2-with-java.jar greenstone2-with-java.jar.o"/>
-			</exec>
-			<exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer/build">
-				<arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_${linux-java.installer}_start=java --readonly-text ${linux-java.installer} java.o"/>
-			</exec>
-
-			<!-- get size of greenstone.jar -->
-			<exec executable="ls" dir="${basedir}/wrapped-installer/build" outputproperty="greenstone2.jar.ls"><arg line="-l greenstone2.jar"/></exec>
-			<exec executable="sed" inputstring="${greenstone2.jar.ls}" outputproperty="greenstone2.jar.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec>
-
-			<!-- get size of greenstone-with-java.jar -->
-			<exec executable="ls" dir="${basedir}/wrapped-installer/build" outputproperty="greenstone2-with-java.jar.ls"><arg line="-l greenstone2-with-java.jar"/></exec>
-			<exec executable="sed" inputstring="${greenstone2-with-java.jar.ls}" outputproperty="greenstone2-with-java.jar.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec>
-
-			<!-- get size of java -->
-			<exec executable="ls" dir="${basedir}/wrapped-installer/build" outputproperty="java.ls"><arg line="-l ${linux-java.installer}"/></exec>
-			<exec executable="sed" inputstring="${java.ls}" outputproperty="java.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec>
-
-			<echo level="info">creating the header file for no java version</echo>
-			<delete file="wrapper.h"/>
-			<exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h"><arg line="extern const char greenstone2jar[${greenstone2.jar.size}];"/></exec>
-
-			<echo level="info">compile the wrapper program</echo>
-			<exec executable="g++" dir="${basedir}/wrapped-installer/build">
-				<arg line="-Wall -static -static-libgcc -c -o wrapper.o wrapper.cpp"/>
-			</exec>
-
-			<echo level="info">compile libsearch4j</echo>
-			<exec executable="g++" dir="${basedir}/wrapped-installer/build">
-				<arg line="-Wall -static -static-libgcc -c -o libsearch4j.o libsearch4j.cpp"/>
-			</exec>
-
-			<echo level="info">link, bundling the files to be bundled</echo>
-			<exec executable="g++" dir="${basedir}/wrapped-installer/build">
-				<arg line="-static -static-libgcc -o  ../greenstone-${version}-linux.bin wrapper.o libsearch4j.o greenstone2.jar.o"/>
-			</exec>
-
-			<echo level="info">creating the header file for bundled java version</echo>
-			<delete file="wrapper.h"/>
-			<exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h"><arg line="extern const char greenstone2jar[${greenstone2-with-java.jar.size}];"/></exec>
-			<exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h" append="true"><arg line="extern const char java[${java.size}];"/></exec>
-			<exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h" append="true"><arg line="#define java_is_bundled yes"/></exec>
-
-			<echo level="info">recompile the wrapper program</echo>
-			<exec executable="g++" dir="${basedir}/wrapped-installer/build">
-				<arg line="-Wall -static -static-libgcc -c -o wrapper.o wrapper.cpp"/>
-			</exec>
-
-			<echo level="info">relink, bundling the files to be bundled</echo>
-			<exec executable="g++" dir="${basedir}/wrapped-installer/build">
-				<arg line="-static -static-libgcc -o  ../greenstone-${version}-linux-with-java.bin wrapper.o libsearch4j.o greenstone2-with-java.jar.o java.o"/>
-			</exec>
-
+			<!-- create disk image -->
+			<exec dir="${basedir}/wrapped-installer" executable="hdiutil"><arg line="create -size ${dmg.size}k -fs HFS+ -volname Greenstone${version} Greenstone${version}.dmg"/></exec>
+			<!-- mount it -->
+			<exec executable="hdiutil" dir="${basedir}/wrapped-installer"><arg line="attach Greenstone${version}.dmg"/></exec>
+			<!-- copy file into it -->
+			<exec executable="cp" dir="${basedir}/wrapped-installer"><arg line="-r Greenstone${version}.app /Volumes/Greenstone${version}"/></exec>
+			<!-- unmount it-->
+			<exec executable="hdiutil" dir="${basedir}/wrapped-installer"><arg line="detach /Volumes/Greenstone${version}"/></exec>
 		</if>
 	</target>
