[20721] | 1 | <?xml version="1.0" encoding="utf-8" ?>
|
---|
| 2 | <project name="rk2-compile">
|
---|
| 3 |
|
---|
[21394] | 4 | <target name="compile" depends="init,gs2-init">
|
---|
[20721] | 5 |
|
---|
[21623] | 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 -->
|
---|
[20721] | 24 | <antcall target="gsdl-set-version-numbers"><param name="gsdl.basedir" value="${basedir}/compiled"/></antcall>
|
---|
| 25 | <antcall target="gli-set-version-numbers"><param name="glibasedir" value="${basedir}/compiled/gli"/></antcall>
|
---|
| 26 |
|
---|
| 27 | <!-- windows only -->
|
---|
| 28 | <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
|
---|
| 29 |
|
---|
[21623] | 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"/>
|
---|
[20721] | 36 |
|
---|
[21623] | 37 | <!-- get winbin -->
|
---|
| 38 | <if><bool><not><available file="${basedir}/compiled/bin/windows"/></not></bool>
|
---|
[21647] | 39 | <exec executable="svn">
|
---|
| 40 | <arg value="export"/>
|
---|
| 41 | <arg value="${svn.root}/main/${branch.path}/binaries/windows/bin"/>
|
---|
| 42 | <arg value="${basedir}/compiled/bin/windows"/>
|
---|
| 43 | <arg value="-r"/><arg value="${branch.revision}"/>
|
---|
| 44 | </exec>
|
---|
[21623] | 45 | </if>
|
---|
[20721] | 46 |
|
---|
[21623] | 47 | <!-- insert windows perl -->
|
---|
| 48 | <unzip src="${rk.home}/shared/windows/perl.zip" dest="compiled/bin/windows"/>
|
---|
[20721] | 49 |
|
---|
[21623] | 50 | <!-- compile c code -->
|
---|
| 51 | <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="clean"/></exec>
|
---|
| 52 | <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="APACHE_HTTPD=1"/></exec>
|
---|
| 53 | <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="LOCAL_LIBRARY=1"/></exec>
|
---|
| 54 | <mkdir dir="products"/>
|
---|
| 55 | <copy file="${basedir}/compiled/server.exe" tofile="${basedir}/products/server-${version}.exe"/>
|
---|
| 56 | <move file="${basedir}/compiled/server.exe" todir="${basedir}/compiled/bin/windows"/>
|
---|
[20721] | 57 |
|
---|
| 58 |
|
---|
[21623] | 59 | <!-- linux only -->
|
---|
| 60 | <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
|
---|
[20721] | 61 |
|
---|
[21623] | 62 | <!-- add static to configure.in -->
|
---|
| 63 | <rsr file="${basedir}/compiled/configure.in" pattern="^LDFLAGS=.*$" replacement="LDFLAGS=-static"/>
|
---|
| 64 | <exec dir="${basedir}/compiled" executable="autoconf" output="${basedir}/compiled/configure">
|
---|
| 65 | <arg value="configure.in"/>
|
---|
| 66 | </exec>
|
---|
[20721] | 67 |
|
---|
[21623] | 68 | <!-- set environment in packages/configure -->
|
---|
| 69 | <rsr file="${basedir}/compiled/common-src/packages/configure" pattern="^ENVIRONMENT=.*$" replacement="ENVIRONMENT="LDFLAGS=-static""/>
|
---|
| 70 | <rsr file="${basedir}/compiled/build-src/packages/configure" pattern="^ENVIRONMENT=.*$" replacement="ENVIRONMENT="LDFLAGS=-static""/>
|
---|
[20721] | 71 |
|
---|
[21623] | 72 | <!-- run configure -->
|
---|
[20721] | 73 | <exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
|
---|
| 74 | <arg line="--enable-apache-httpd"/>
|
---|
| 75 | <env key="LDFLAGS" value="-static"/>
|
---|
| 76 | </exec>
|
---|
| 77 |
|
---|
[21623] | 78 | <!-- add -static to makefiles -->
|
---|
| 79 | <rsr file="${basedir}/compiled/build-src/packages/wv/wv-gs/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static" />
|
---|
| 80 | <rsr file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/xlhtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static"/>
|
---|
| 81 | <rsr file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/ppthtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static"/>
|
---|
| 82 | <rsr file="${basedir}/compiled/build-src/packages/rtftohtml/rtftohtml_src/Makefile" pattern="(-o rtftohtml.{2}EXEEXT.{1})" replacement="$1 -static"/>
|
---|
| 83 |
|
---|
| 84 | <!-- mac only -->
|
---|
[21318] | 85 | <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
|
---|
[21623] | 86 | <!-- run configure -->
|
---|
| 87 | <exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
|
---|
| 88 | <arg line="--enable-apache-httpd"/>
|
---|
[20721] | 89 | </exec>
|
---|
| 90 |
|
---|
[21623] | 91 | <!-- tweak makefiles -->
|
---|
| 92 | <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"/>
|
---|
| 93 | <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"/>
|
---|
[20721] | 94 |
|
---|
[21623] | 95 | </if></else></if></else></if>
|
---|
[20721] | 96 |
|
---|
[21623] | 97 | <!-- mac and linux: compile -->
|
---|
| 98 | <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
|
---|
[20721] | 99 |
|
---|
[21623] | 100 | <!-- WORKAROUND: make common-src and reconfigure -->
|
---|
| 101 | <!-- this is a workaround to a problem with the gsdl build code -->
|
---|
| 102 | <!-- expat needs to be compiled before the perl XML Parser is configured -->
|
---|
| 103 | <exec dir="${basedir}/compiled/common-src" executable="make" failonerror="true"/>
|
---|
| 104 | <exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
|
---|
| 105 | <arg line="--enable-apache-httpd"/>
|
---|
| 106 | <env key="LDFLAGS" value="-static"/>
|
---|
| 107 | </exec>
|
---|
| 108 | <!-- /WORKAROUND -->
|
---|
[20721] | 109 |
|
---|
[21623] | 110 | <!-- make -->
|
---|
| 111 | <exec dir="${basedir}/compiled" executable="make" failonerror="true"/>
|
---|
[20721] | 112 |
|
---|
[21623] | 113 | <!-- make install -->
|
---|
| 114 | <exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="install"/></exec>
|
---|
[20721] | 115 |
|
---|
[21623] | 116 | <!-- make apache-for-dist -->
|
---|
| 117 | <exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="apache-for-dist"/></exec>
|
---|
[20721] | 118 |
|
---|
[21623] | 119 | <!-- strip executables -->
|
---|
| 120 | <exec dir="${basedir}/compiled/bin/${os.shell}" executable="find" failonerror="true">
|
---|
| 121 | <arg line=". ! -name . -type f -maxdepth 1 -exec strip {} ;"/>
|
---|
| 122 | </exec>
|
---|
| 123 | </if>
|
---|
[20721] | 124 |
|
---|
[21623] | 125 | <!-- compile gli -->
|
---|
[21647] | 126 | <!-- (linux and mac) -->
|
---|
| 127 | <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
|
---|
| 128 | <exec dir="compiled/gli" executable="/bin/bash"><arg value="-c"/><arg value="./makegli.sh"/></exec>
|
---|
| 129 | <exec dir="compiled/gli" executable="/bin/bash"><arg value="-c"/><arg value="./makejar.sh"/></exec>
|
---|
| 130 | <!-- windows -->
|
---|
| 131 | <else><if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
|
---|
| 132 | <exec dir="compiled/gli" executable="cmd.exe"><arg value="/c"/><arg value="makegli.bat"/></exec>
|
---|
| 133 | <exec dir="compiled/gli" executable="cmd.exe"><arg value="/c"/><arg value="makejar.bat"/></exec>
|
---|
| 134 | </if></else></if>
|
---|
| 135 |
|
---|
[21634] | 136 | <delete dir="compiled/gli/jar"/>
|
---|
| 137 | <delete dir="compiled/gli/classes/org"/>
|
---|
[21623] | 138 | <move file="compiled/gli/GLIServer.jar" todir="compiled/bin/java"/>
|
---|
| 139 |
|
---|
| 140 | <!-- compile uninstaller -->
|
---|
| 141 | <antcall target="insert-and-compile-uninstaller" />
|
---|
| 142 |
|
---|
| 143 | <!-- build demo collection -->
|
---|
[21658] | 144 | <!-- the envs on these execs simulate the environment when you run setup.bat
|
---|
| 145 | <exec dir="${basedir}/compiled" executable="perl">
|
---|
| 146 | <arg line="bin/script/import.pl - -removeold demo"/>
|
---|
| 147 | <env key="GSDLHOME" path="${basedir}/compiled"/>
|
---|
| 148 | <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/collect"/>
|
---|
| 149 | <env key="GSDLOS" value="windows"/>
|
---|
| 150 | <env key="PATH" path="${basedir}/compiled/bin/windows/perl/bin:${basedir}/compiled/bin/windows:${basedir}/compiled/bin/script:${env.PATH}"/>
|
---|
| 151 | </exec>
|
---|
| 152 | <exec dir="${basedir}/compiled" executable="perl">
|
---|
| 153 | <arg line="bin/script/buildcol.pl - -removeold demo"/>
|
---|
| 154 | <env key="GSDLHOME" path="${basedir}/compiled"/>
|
---|
| 155 | <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/collect"/>
|
---|
| 156 | <env key="GSDLOS" value="windows"/>
|
---|
| 157 | <env key="PATH" path="${basedir}/compiled/bin/windows/perl/bin:${basedir}/compiled/bin/windows:${basedir}/compiled/bin/script:${env.PATH}"/>
|
---|
| 158 | </exec>
|
---|
| 159 | <delete dir="${basedir}/compiled/collect/demo/index"/>
|
---|
| 160 | <move file="${basedir}/compiled/collect/demo/building" tofile="${basedir}/compiled/collect/demo/index"/>
|
---|
| 161 | -->
|
---|
[20721] | 162 |
|
---|
[21623] | 163 | <!-- delete the source code -->
|
---|
| 164 | <delete><fileset dir="compiled" includes="Makefile,config.cache,config.h,config.log,stamp-h,config.status"/></delete>
|
---|
| 165 | <delete dir="compiled/common-src"/>
|
---|
| 166 | <delete dir="compiled/build-src"/>
|
---|
| 167 | <delete dir="compiled/runtime-src"/>
|
---|
| 168 | <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>
|
---|
[20721] | 169 |
|
---|
[21623] | 170 | <!-- strip .svn working-copy dirs -->
|
---|
| 171 | <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
|
---|
[20721] | 172 |
|
---|
[21623] | 173 | <!-- create needed empty files -->
|
---|
| 174 | <mkdir dir="compiled/tmp"/>
|
---|
| 175 | <chmod dir="compiled/tmp" perm="a+rwx"/>
|
---|
| 176 | <echo file="compiled/etc/usage.txt"></echo>
|
---|
[20721] | 177 |
|
---|
[21623] | 178 | <!-- windows -->
|
---|
| 179 | <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
|
---|
[20721] | 180 |
|
---|
[21623] | 181 | <!-- make a copy of server.exe in the root -->
|
---|
| 182 | <copy file="compiled/bin/windows/server.exe" tofile="compiled/server.exe"/>
|
---|
| 183 |
|
---|
| 184 | <!-- delete sourcecode -->
|
---|
| 185 | <delete dir="${binzip.dir}/common-src"/>
|
---|
| 186 | <delete dir="${binzip.dir}/build-src"/>
|
---|
| 187 | <delete dir="${binzip.dir}/runtime-src"/>
|
---|
| 188 |
|
---|
| 189 | <!-- create simple zipped binary distribution
|
---|
| 190 | <mkdir dir="distributions"/>
|
---|
| 191 | <property name="binzip.dir" value="distributions/Greenstone-${version}-${os.suffix}-binary"/>
|
---|
| 192 | <copy todir="${binzip.dir}"><fileset dir="compiled"/></copy>
|
---|
| 193 | <delete><fileset dir="${binzip.dir}" includes="README*.txt,Uninstall.bat,Uninst.bat,uninst.jar,win32.mak,win32cfg.h,makegs2.bat" excludes="READMEen.txt"/></delete>
|
---|
| 194 | -->
|
---|
| 195 |
|
---|
| 196 | <!-- delete unneeded files -->
|
---|
| 197 | <delete dir="compiled/bin/linux" />
|
---|
| 198 | <delete><fileset dir="compiled" includes="*.bash,*.sh,*.csh,.gstermrc"/></delete>
|
---|
| 199 | <delete><fileset dir="compiled/gli" includes="*.sh,*4gs3.bat"/></delete>
|
---|
| 200 | <delete dir="compiled/autom4te.cache" />
|
---|
| 201 |
|
---|
| 202 | <!-- linux -->
|
---|
| 203 | <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
|
---|
| 204 | <!-- grab imagemagick binaries -->
|
---|
| 205 | <delete dir="compiled/bin/linux/imagemagick"/>
|
---|
| 206 | <exec executable="svn">
|
---|
| 207 | <arg value="export"/>
|
---|
| 208 | <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
|
---|
| 209 | <arg value="compiled/bin/linux/imagemagick"/>
|
---|
| 210 | </exec>
|
---|
| 211 |
|
---|
| 212 | <!-- grab wv binaries -->
|
---|
| 213 | <delete dir="compiled/bin/linux/wv"/>
|
---|
| 214 | <exec executable="svn">
|
---|
| 215 | <arg value="export"/>
|
---|
| 216 | <arg value="${svn.root}/main/${branch.path}/binaries/linux/wv"/>
|
---|
| 217 | <arg value="compiled/bin/linux/wv"/>
|
---|
| 218 | </exec>
|
---|
| 219 |
|
---|
| 220 | <!-- delete unneeded files -->
|
---|
| 221 | <delete><fileset dir="compiled" includes="win32.mak,win32cfg.h,Install.sh,Support.htm,micotest.cpp"/></delete>
|
---|
| 222 | <delete><fileset dir="compiled/gli" includes="*.bat"/></delete>
|
---|
| 223 | <delete><fileset dir="compiled" includes="*.bat"/></delete>
|
---|
| 224 | <delete dir="compiled/common-src/packages/windows"/>
|
---|
| 225 | <delete dir="compiled/common-src/indexers/packages/windows"/>
|
---|
| 226 |
|
---|
| 227 | <!-- mac -->
|
---|
| 228 | <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
|
---|
| 229 | <!-- grab imagemagick binaries -->
|
---|
| 230 | <delete dir="compiled/bin/darwin/imagemagick"/>
|
---|
| 231 | <exec executable="svn">
|
---|
| 232 | <arg value="export"/>
|
---|
| 233 | <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
|
---|
| 234 | <arg value="compiled/bin/darwin/imagemagick"/>
|
---|
| 235 | </exec>
|
---|
| 236 |
|
---|
| 237 | <!-- grab ghostscript binaries -->
|
---|
| 238 | <delete dir="compiled/bin/darwin/imagemagick"/>
|
---|
| 239 | <exec executable="svn">
|
---|
| 240 | <arg value="export"/>
|
---|
| 241 | <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
|
---|
| 242 | <arg value="compiled/bin/darwin/ghostscript"/>
|
---|
| 243 | </exec>
|
---|
| 244 |
|
---|
| 245 | <!-- delete unneeded files -->
|
---|
| 246 | <delete><fileset dir="compiled" includes="win32.mak,win32cfg.h,Install.sh,Support.htm,*.bat"/></delete>
|
---|
| 247 | <delete><fileset dir="compiled/gli" includes="*.bat"/></delete>
|
---|
| 248 | <delete dir="compiled/common-src/packages/windows"/>
|
---|
| 249 |
|
---|
| 250 | </if></else></if></else></if>
|
---|
| 251 |
|
---|
| 252 | <!-- delete unneeded files -->
|
---|
| 253 | <delete dir="compiled/uninstaller" />
|
---|
| 254 | <delete file="compiled/bin/java/SignedGatherer.jar" />
|
---|
| 255 |
|
---|
[21648] | 256 | <!-- tidy up gli -->
|
---|
[21652] | 257 | <antcall target="gli-tidy-for-dist"><param name="glibasedir" value="compiled/gli"/></antcall>
|
---|
[21648] | 258 |
|
---|
[21623] | 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"/>
|
---|
[20721] | 265 | </if>
|
---|
| 266 |
|
---|
| 267 | </target>
|
---|
| 268 |
|
---|
| 269 | </project>
|
---|