- Timestamp:
- 2010-01-26T12:52:31+13:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml
r21593 r21623 4 4 <target name="compile" depends="init,gs2-init"> 5 5 6 <antcall target="checkout-gsdl-gli" /> 7 <antcall target="drop-in-docs"><param name="gsdl.basedir" value="${basedir}/compiled"/></antcall> 6 <!-- checkout gsdl and gli --> 7 <exec executable="svn"> 8 <arg value="checkout"/> 9 <arg value="${svn.root}/main/${branch.path}/greenstone2"/> 10 <arg value="${basedir}/compiled"/> 11 </exec> 12 <exec executable="svn"> 13 <arg value="checkout"/> 14 <arg value="${svn.root}/main/${branch.path}/gli"/> 15 <arg value="${basedir}/compiled/gli"/> 16 </exec> 17 18 <!-- drop in documentation --> 19 <copy todir="compiled" overwrite="true"> 20 <fileset dir="${rk.home}/shared/greenstone2/docs" excludes="READMEar.txt,READMEes.txt,READMEfr.txt,READMEru.txt"/> 21 </copy> 22 23 <!-- set version numbers --> 8 24 <antcall target="gsdl-set-version-numbers"><param name="gsdl.basedir" value="${basedir}/compiled"/></antcall> 9 25 <antcall target="gli-set-version-numbers"><param name="glibasedir" value="${basedir}/compiled/gli"/></antcall> … … 11 27 <!-- windows only --> 12 28 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool> 13 <antcall target="unzip-packages" /> 14 <antcall target="get-winbin" /> 15 <antcall target="insert-windows-perl"><param name="todir" value="compiled/bin/windows"/></antcall> 16 <antcall target="compile-c-code" /> 29 30 <!-- unzip packages --> 31 <unzip src="${basedir}/compiled/common-src/packages/windows/crypt/crypt.zip" dest="${basedir}/compiled/common-src/packages/windows/crypt"/> 32 <unzip src="${basedir}/compiled/common-src/packages/windows/expat/expat.zip" dest="${basedir}/compiled/common-src/packages/windows/expat"/> 33 <unzip src="${basedir}/compiled/common-src/packages/windows/stlport/stlport.zip" dest="${basedir}/compiled/common-src/packages/windows/stlport"/> 34 <unzip src="${basedir}/compiled/common-src/indexers/packages/windows/iconv/iconv.zip" dest="${basedir}/compiled/common-src/indexers/packages/windows/iconv"/> 35 <untar src="${basedir}/compiled/common-src/packages/sqlite/sqlite-amalgamation-3.5.9.tar.gz" dest="${basedir}/compiled/common-src/packages/sqlite" compression="gzip"/> 36 37 <!-- get winbin --> 38 <if><bool><not><available file="${basedir}/compiled/bin/windows"/></not></bool> 39 <svn><export srcUrl="${svn.root}/main/${branch.path}/binaries/windows/bin" destPath="${basedir}/compiled/bin/windows" revision="${branch.revision}"/></svn> 40 </if> 41 42 <!-- insert windows perl --> 43 <unzip src="${rk.home}/shared/windows/perl.zip" dest="compiled/bin/windows"/> 44 45 <!-- compile c code --> 46 <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="clean"/></exec> 47 <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="APACHE_HTTPD=1"/></exec> 48 <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="LOCAL_LIBRARY=1"/></exec> 49 <mkdir dir="products"/> 50 <copy file="${basedir}/compiled/server.exe" tofile="${basedir}/products/server-${version}.exe"/> 51 <move file="${basedir}/compiled/server.exe" todir="${basedir}/compiled/bin/windows"/> 52 17 53 18 54 <!-- linux only --> 19 55 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool> 20 <antcall target="add-static-to-configure-in"/> 21 <antcall target="set-environment-in-packages-configure"/> 22 <antcall target="run-configure"/> 23 <antcall target="makefiles-add-static"/> 24 <!-- make common-src and reconfigure --> 25 <!-- this is a workaround to a problem with the gsdl build code --> 26 <!-- expat needs to be compiled before the perl XML Parser is configured --> 27 <antcall target="make-common-src"/> 28 <antcall target="run-configure"/> 29 <!-- end of workaround --> 30 <antcall target="run-make"/> 31 <antcall target="run-make-install"/> 32 <antcall target="run-make-apache-for-dist"/> 33 <antcall target="strip-execs"/> 34 35 <!-- mac only --> 36 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool> 37 <antcall target="run-configure"/> 38 <antcall target="tweak-makefiles"/> 39 <!-- make common-src and reconfigure --> 40 <!-- this is a workaround to a problem with the gsdl build code --> 41 <!-- expat needs to be compiled before the perl XML Parser is configured --> 42 <antcall target="make-common-src"/> 43 <antcall target="run-configure"/> 44 <!-- end of workaround --> 45 <antcall target="run-make"/> 46 <antcall target="run-make-install"/> 47 <antcall target="run-make-apache-for-dist"/> 48 <antcall target="strip-execs"/> 49 50 </if></else></if></else></if> 51 52 <!-- gli --> 53 <antcall target="compile-gli"> 54 <param name="glibasedir" value="${basedir}/compiled/gli"/> 55 <param name="gsdlbasedir" value="${basedir}/compiled"/> 56 </antcall> 57 58 <!-- uninstaller --> 59 <antcall target="compile-uninstaller" /> 60 61 <!-- build collections --> 62 <antcall target="build-demo-collection" /> 63 64 </target> 65 66 <target name="add-static-to-configure-in"> 67 <rsr 68 file="${basedir}/compiled/configure.in" 69 pattern="^LDFLAGS=.*$" 70 replacement="LDFLAGS=-static" /> 71 <exec dir="${basedir}/compiled" executable="autoconf" output="${basedir}/compiled/configure"><arg value="configure.in"/></exec> 72 </target> 73 74 <target name="set-environment-in-packages-configure"> 75 <rsr 76 file="${basedir}/compiled/common-src/packages/configure" 77 pattern="^ENVIRONMENT=.*$" 78 replacement="ENVIRONMENT="LDFLAGS=-static"" /> 79 <rsr 80 file="${basedir}/compiled/build-src/packages/configure" 81 pattern="^ENVIRONMENT=.*$" 82 replacement="ENVIRONMENT="LDFLAGS=-static"" /> 83 </target> 84 85 <target name="run-configure"> 86 <!-- linux --> 87 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool> 56 57 <!-- add static to configure.in --> 58 <rsr file="${basedir}/compiled/configure.in" pattern="^LDFLAGS=.*$" replacement="LDFLAGS=-static"/> 59 <exec dir="${basedir}/compiled" executable="autoconf" output="${basedir}/compiled/configure"> 60 <arg value="configure.in"/> 61 </exec> 62 63 <!-- set environment in packages/configure --> 64 <rsr file="${basedir}/compiled/common-src/packages/configure" pattern="^ENVIRONMENT=.*$" replacement="ENVIRONMENT="LDFLAGS=-static""/> 65 <rsr file="${basedir}/compiled/build-src/packages/configure" pattern="^ENVIRONMENT=.*$" replacement="ENVIRONMENT="LDFLAGS=-static""/> 66 67 <!-- run configure --> 88 68 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true"> 89 69 <arg line="--enable-apache-httpd"/> … … 91 71 </exec> 92 72 93 <!-- mac --> 73 <!-- add -static to makefiles --> 74 <rsr file="${basedir}/compiled/build-src/packages/wv/wv-gs/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static" /> 75 <rsr file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/xlhtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static"/> 76 <rsr file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/ppthtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static"/> 77 <rsr file="${basedir}/compiled/build-src/packages/rtftohtml/rtftohtml_src/Makefile" pattern="(-o rtftohtml.{2}EXEEXT.{1})" replacement="$1 -static"/> 78 79 <!-- mac only --> 94 80 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool> 95 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure"> 96 <arg value="--enable-apache-httpd"/> 97 </exec> 98 99 <else> 100 <fail>This target does not support this rk.os: ${rk.os}</fail> 101 102 </else></if></else></if> 103 </target> 104 105 <target name="makefiles-add-static"> 106 <rsr 107 file="${basedir}/compiled/build-src/packages/wv/wv-gs/Makefile" 108 pattern="^LDFLAGS =.*$" 109 replacement="LDFLAGS = -static" /> 110 <rsr 111 file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/xlhtml/Makefile" 112 pattern="^LDFLAGS =.*$" 113 replacement="LDFLAGS = -static" /> 114 <rsr 115 file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/ppthtml/Makefile" 116 pattern="^LDFLAGS =.*$" 117 replacement="LDFLAGS = -static" /> 118 <rsr 119 file="${basedir}/compiled/build-src/packages/rtftohtml/rtftohtml_src/Makefile" 120 pattern="(-o rtftohtml.{2}EXEEXT.{1})" 121 replacement="$1 -static" /> 122 </target> 123 124 <target name="run-make"> 125 <exec dir="${basedir}/compiled" executable="make" failonerror="true"/> 126 </target> 127 128 <target name="run-make-install"> 129 <exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="install"/></exec> 130 </target> 131 132 <target name="run-make-apache-for-dist"> 133 <exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="apache-for-dist"/></exec> 134 </target> 135 136 <target name="strip-execs"> 137 <exec dir="${basedir}/compiled/bin/${os.shell}" executable="find" failonerror="true"> 138 <arg line=". ! -name . -type f -maxdepth 1 -exec strip {} ;"/> 139 </exec> 140 </target> 141 142 <target name="build-demo-collection"> 143 81 <!-- run configure --> 82 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true"> 83 <arg line="--enable-apache-httpd"/> 84 </exec> 85 86 <!-- tweak makefiles --> 87 <rsr file="${basedir}/compiled/runtime-src/src/recpt/Makefile" pattern="^(LIBS =.*)-L(.)\(PACKAGES_DIR\)/expat/lib -lexpat(.*)$" replacement="$1$2(PACKAGES_DIR)/expat/lib/libexpat.a$3"/> 88 <rsr file="${basedir}/compiled/runtime-src/src/oaiservr/Makefile" pattern="^(LIBS =.*)-L(.)\(PACKAGES_DIR\)/expat/lib -lexpat(.*)$" replacement="$1$2(PACKAGES_DIR)/expat/lib/libexpat.a$3"/> 89 90 </if></else></if></else></if> 91 92 <!-- mac and linux: compile --> 93 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool> 94 95 <!-- WORKAROUND: make common-src and reconfigure --> 96 <!-- this is a workaround to a problem with the gsdl build code --> 97 <!-- expat needs to be compiled before the perl XML Parser is configured --> 98 <exec dir="${basedir}/compiled/common-src" executable="make" failonerror="true"/> 99 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true"> 100 <arg line="--enable-apache-httpd"/> 101 <env key="LDFLAGS" value="-static"/> 102 </exec> 103 <!-- /WORKAROUND --> 104 105 <!-- make --> 106 <exec dir="${basedir}/compiled" executable="make" failonerror="true"/> 107 108 <!-- make install --> 109 <exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="install"/></exec> 110 111 <!-- make apache-for-dist --> 112 <exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="apache-for-dist"/></exec> 113 114 <!-- strip executables --> 115 <exec dir="${basedir}/compiled/bin/${os.shell}" executable="find" failonerror="true"> 116 <arg line=". ! -name . -type f -maxdepth 1 -exec strip {} ;"/> 117 </exec> 118 </if> 119 120 <!-- compile gli --> 121 <exec dir="compiled/gli" executable="compiled/gli/makegli.${os.script.format}"/> 122 <exec dir="compiled/gli" executable="compiled/gli/makejar.${os.script.format}"/> 123 <delete dir="${glibasedir}/jar"/> 124 <delete dir="${glibasedir}/classes/org"/> 125 <move file="compiled/gli/GLIServer.jar" todir="compiled/bin/java"/> 126 127 <!-- compile uninstaller --> 128 <antcall target="insert-and-compile-uninstaller" /> 129 130 <!-- build demo collection --> 144 131 <!-- linux, mac --> 145 132 <if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool> 146 <exec dir="${basedir}/compiled" executable="${rk.home}/kits/rk2/resources/build-demo.sh" failonerror="true"/> 133 <exec dir="${basedir}/compiled" executable="/bin/bash" failonerror="true"> 134 <arg value="-c"/> 135 <arg value=" 136 source setup.bash && \ 137 import.pl --removeold demo && \ 138 buildcol.pl --removeold demo && \ 139 rm -rf collect/demo/index collect/demo/archives && \ 140 mv collect/demo/building collect/demo/index"/> 141 </exec> 147 142 148 143 <!-- windows --> … … 166 161 <move file="${basedir}/compiled/collect/demo/building" tofile="${basedir}/compiled/collect/demo/index"/> 167 162 168 <else> 169 <fail>This target does not support the current rk.os: ${rk.os}</fail> 170 171 </else></if></else></if> 163 </if></else></if> 164 165 <!-- delete the source code --> 166 <delete><fileset dir="compiled" includes="Makefile,config.cache,config.h,config.log,stamp-h,config.status"/></delete> 167 <delete dir="compiled/common-src"/> 168 <delete dir="compiled/build-src"/> 169 <delete dir="compiled/runtime-src"/> 170 <delete><fileset dir="compiled" includes="Install.txt,acconfig.h,aclocal.m4,config.guess,config.sub,configtest.pl,configure,configure.in,install-sh,Makefile.in,micotest.cpp,config.h.in,win32.mak,win32cfg.h"/></delete> 171 172 <!-- strip .svn working-copy dirs --> 173 <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall> 174 175 <!-- create needed empty files --> 176 <mkdir dir="compiled/tmp"/> 177 <chmod dir="compiled/tmp" perm="a+rwx"/> 178 <echo file="compiled/etc/usage.txt"></echo> 179 180 <!-- windows --> 181 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool> 182 183 <!-- make a copy of server.exe in the root --> 184 <copy file="compiled/bin/windows/server.exe" tofile="compiled/server.exe"/> 185 186 <!-- delete sourcecode --> 187 <delete dir="${binzip.dir}/common-src"/> 188 <delete dir="${binzip.dir}/build-src"/> 189 <delete dir="${binzip.dir}/runtime-src"/> 190 191 <!-- create simple zipped binary distribution 192 <mkdir dir="distributions"/> 193 <property name="binzip.dir" value="distributions/Greenstone-${version}-${os.suffix}-binary"/> 194 <copy todir="${binzip.dir}"><fileset dir="compiled"/></copy> 195 <delete><fileset dir="${binzip.dir}" includes="README*.txt,Uninstall.bat,Uninst.bat,uninst.jar,win32.mak,win32cfg.h,makegs2.bat" excludes="READMEen.txt"/></delete> 196 --> 197 198 <!-- delete unneeded files --> 199 <delete dir="compiled/bin/linux" /> 200 <delete><fileset dir="compiled" includes="*.bash,*.sh,*.csh,.gstermrc"/></delete> 201 <delete><fileset dir="compiled/gli" includes="*.sh,*4gs3.bat"/></delete> 202 <delete dir="compiled/autom4te.cache" /> 203 204 <!-- linux --> 205 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool> 206 <!-- grab imagemagick binaries --> 207 <delete dir="compiled/bin/linux/imagemagick"/> 208 <exec executable="svn"> 209 <arg value="export"/> 210 <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/> 211 <arg value="compiled/bin/linux/imagemagick"/> 212 </exec> 213 214 <!-- grab wv binaries --> 215 <delete dir="compiled/bin/linux/wv"/> 216 <exec executable="svn"> 217 <arg value="export"/> 218 <arg value="${svn.root}/main/${branch.path}/binaries/linux/wv"/> 219 <arg value="compiled/bin/linux/wv"/> 220 </exec> 221 222 <!-- delete unneeded files --> 223 <delete><fileset dir="compiled" includes="win32.mak,win32cfg.h,Install.sh,Support.htm,micotest.cpp"/></delete> 224 <delete><fileset dir="compiled/gli" includes="*.bat"/></delete> 225 <delete><fileset dir="compiled" includes="*.bat"/></delete> 226 <delete dir="compiled/common-src/packages/windows"/> 227 <delete dir="compiled/common-src/indexers/packages/windows"/> 228 229 <!-- mac --> 230 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool> 231 <!-- grab imagemagick binaries --> 232 <delete dir="compiled/bin/darwin/imagemagick"/> 233 <exec executable="svn"> 234 <arg value="export"/> 235 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/> 236 <arg value="compiled/bin/darwin/imagemagick"/> 237 </exec> 238 239 <!-- grab ghostscript binaries --> 240 <delete dir="compiled/bin/darwin/imagemagick"/> 241 <exec executable="svn"> 242 <arg value="export"/> 243 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/> 244 <arg value="compiled/bin/darwin/ghostscript"/> 245 </exec> 246 247 <!-- delete unneeded files --> 248 <delete><fileset dir="compiled" includes="win32.mak,win32cfg.h,Install.sh,Support.htm,*.bat"/></delete> 249 <delete><fileset dir="compiled/gli" includes="*.bat"/></delete> 250 <delete dir="compiled/common-src/packages/windows"/> 251 252 </if></else></if></else></if> 253 254 <!-- delete unneeded files --> 255 <delete dir="compiled/uninstaller" /> 256 <delete file="compiled/gli/.greenstonestore" /> 257 <delete file="compiled/bin/java/SignedGatherer.jar" /> 258 259 <!-- mac and linux: insert export to cdrom package --> 260 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool> 261 <mkdir dir="compiled/bin/windows"/> 262 <get src="${server.exe.location}" dest="compiled/bin/windows/server.exe"/> 263 <get src="${svn.root}/main/${branch.path}/binaries/windows/bin/Setup.exe" dest="compiled/bin/windows/Setup.exe"/> 264 <get src="${svn.root}/main/${branch.path}/binaries/windows/bin/gssetup.exe" dest="compiled/bin/windows/gssetup.exe"/> 265 </if> 172 266 173 267 </target> 174 268 175 <target name="tweak-makefiles">176 <rsr file="${basedir}/compiled/runtime-src/src/recpt/Makefile" pattern="^(LIBS =.*)-L(.)\(PACKAGES_DIR\)/expat/lib -lexpat(.*)$" replacement="$1$2(PACKAGES_DIR)/expat/lib/libexpat.a$3" />177 <rsr file="${basedir}/compiled/runtime-src/src/oaiservr/Makefile" pattern="^(LIBS =.*)-L(.)\(PACKAGES_DIR\)/expat/lib -lexpat(.*)$" replacement="$1$2(PACKAGES_DIR)/expat/lib/libexpat.a$3" />178 </target>179 180 <target name="unzip-packages">181 <unzip src="${basedir}/compiled/common-src/packages/windows/crypt/crypt.zip" dest="${basedir}/compiled/common-src/packages/windows/crypt"/>182 <unzip src="${basedir}/compiled/common-src/packages/windows/expat/expat.zip" dest="${basedir}/compiled/common-src/packages/windows/expat"/>183 <unzip src="${basedir}/compiled/common-src/packages/windows/stlport/stlport.zip" dest="${basedir}/compiled/common-src/packages/windows/stlport"/>184 <unzip src="${basedir}/compiled/common-src/indexers/packages/windows/iconv/iconv.zip" dest="${basedir}/compiled/common-src/indexers/packages/windows/iconv"/>185 <untar src="${basedir}/compiled/common-src/packages/sqlite/sqlite-amalgamation-3.5.9.tar.gz" dest="${basedir}/compiled/common-src/packages/sqlite" compression="gzip"/>186 </target>187 188 <target name="get-winbin">189 <if>190 <bool><not><available file="${basedir}/compiled/bin/windows"/></not></bool>191 <svn><export srcUrl="${svn.root}/main/${branch.path}/binaries/windows/bin" destPath="${basedir}/compiled/bin/windows" revision="${branch.revision}"/></svn>192 </if>193 </target>194 195 <target name="compile-c-code">196 <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="clean"/></exec>197 <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="APACHE_HTTPD=1"/></exec>198 <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="LOCAL_LIBRARY=1"/></exec>199 <mkdir dir="products"/>200 <copy file="${basedir}/compiled/server.exe" tofile="${basedir}/products/server-${version}.exe"/>201 <move file="${basedir}/compiled/server.exe" todir="${basedir}/compiled/bin/windows"/>202 </target>203 204 <target name="drop-in-docs">205 <echo level="info">Dropping gsdl docs into distribution</echo>206 <copy todir="${gsdl.basedir}" overwrite="true">207 <fileset dir="${rk.home}/shared/greenstone2/docs" excludes="READMEar.txt,READMEes.txt,READMEfr.txt,READMEru.txt"/>208 </copy>209 </target>210 211 212 269 </project>
Note:
See TracChangeset
for help on using the changeset viewer.