[20335] | 1 | <?xml version="1.0" encoding="utf-8" ?>
|
---|
| 2 | <project name="rk3-compile">
|
---|
| 3 |
|
---|
| 4 | <target name="compile">
|
---|
[21630] | 5 |
|
---|
| 6 | <!-- checkout greenstone3 -->
|
---|
| 7 | <exec executable="svn">
|
---|
| 8 | <arg value="checkout"/>
|
---|
| 9 | <arg value="${svn.root}/main/${branch.path}/greenstone3"/>
|
---|
| 10 | <arg value="compiled"/>
|
---|
[21652] | 11 | <arg value="-r"/><arg value="${branch.revision}"/>
|
---|
[21630] | 12 | </exec>
|
---|
| 13 |
|
---|
[23811] | 14 | <if><bool><equals arg1="${with.jni}" arg2="false"/></bool>
|
---|
| 15 | <rsr file="${basedir}/compiled/build.properties.in" pattern="with.jni=true" replacement="#with.jni=true"/>
|
---|
| 16 | </if>
|
---|
| 17 |
|
---|
| 18 | <if><bool><equals arg1="${with.gli.and.gems}" arg2="false"/></bool>
|
---|
| 19 | <rsr file="${basedir}/compiled/build.properties.in" pattern="with.gli.and.gems=true" replacement="#with.gli.and.gems=true"/>
|
---|
| 20 | </if>
|
---|
| 21 |
|
---|
[21748] | 22 | <!-- make sure all c++ compilation is done statically on linux -->
|
---|
| 23 | <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
|
---|
| 24 | <property name="forward.compile.static" value="true"/>
|
---|
| 25 | </if>
|
---|
| 26 |
|
---|
[22851] | 27 | <!-- make sure the c++ compilation can see the support library in the extension folder -->
|
---|
| 28 | <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
|
---|
[27186] | 29 | <property name="forward.use.gnomelib.ext" value="true"/>
|
---|
[22851] | 30 | </if>
|
---|
| 31 |
|
---|
| 32 | <antcall target="persist-forwarded-properties">
|
---|
| 33 | <param name="greenstone3basedir" value="compiled"/>
|
---|
| 34 | </antcall>
|
---|
| 35 |
|
---|
[21630] | 36 | <!-- run greenstone3's ant prepare -->
|
---|
[20335] | 37 | <ant dir="compiled" inheritAll="false">
|
---|
| 38 | <target name="prepare"/>
|
---|
| 39 | <propertyset refid="forward.properties"/>
|
---|
[21748] | 40 | <property name="properties.accepted" value="true"/>
|
---|
[20335] | 41 | </ant>
|
---|
[21630] | 42 |
|
---|
| 43 | <!-- set all version numbers -->
|
---|
| 44 | <antcall target="greenstone3-set-version-numbers"><param name="greenstone3basedir" value="compiled"/></antcall>
|
---|
| 45 | <antcall target="gli-set-version-numbers"><param name="glibasedir" value="compiled/gli"/></antcall>
|
---|
| 46 | <antcall target="gsdl-set-version-numbers"><param name="gsdl.basedir" value="compiled/gs2build"/></antcall>
|
---|
| 47 |
|
---|
[22836] | 48 | <!-- mac or linux: compile the support library -->
|
---|
| 49 | <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
|
---|
| 50 | <!-- checkout the gnome support library extension-->
|
---|
[28301] | 51 |
|
---|
| 52 | <!-- For Lions, need a specific gnome-lib-minimal tar file. The file name contains darwin12 for Lion, it contains the os.shell name (darwin/linux) for other cases.
|
---|
| 53 | Mac OS X v10.7.4 onwards is Lion/Mountain Lion, different from Leopard/Snow Leopard. See http://en.wikipedia.org/wiki/Darwin_(operating_system) -->
|
---|
| 54 | <condition property="specific.os.type" value="${os.shell}-Lion" else="${os.shell}">
|
---|
[28512] | 55 | <and>
|
---|
| 56 | <contains string="${os.shell}" substring="darwin" casesensitive="false"/>
|
---|
| 57 | <matches pattern="^(10\.7\.[4-9]|10\.[8-9]|1[1-9]|[2-9])" string="${os.version}"/>
|
---|
| 58 | </and>
|
---|
[28301] | 59 | </condition>
|
---|
| 60 |
|
---|
[22939] | 61 | <if><bool><or>
|
---|
[23618] | 62 | <equals arg1="${post.2.83.version}" arg2="true"/>
|
---|
[22939] | 63 | </or></bool>
|
---|
[23612] | 64 | <echo>EXPORTING GNOME LIB EXTENSION</echo>
|
---|
[22836] | 65 | <exec executable="svn">
|
---|
[23612] | 66 | <arg value="export"/>
|
---|
[28301] | 67 | <arg value="${svn.root}/gs2-extensions/gnome-lib/trunk/gnome-lib-minimal-${specific.os.type}${arch}${extension-x64}.tar.gz"/>
|
---|
| 68 | <arg value="${basedir}/compiled/ext/gnome-lib-${specific.os.type}.tar.gz"/>
|
---|
[22836] | 69 | </exec>
|
---|
[23612] | 70 |
|
---|
| 71 | <exec executable="tar" dir="${basedir}/compiled/ext">
|
---|
| 72 | <arg value="xvzf"/>
|
---|
[28301] | 73 | <arg value="gnome-lib-${specific.os.type}.tar.gz"/>
|
---|
[23612] | 74 | </exec>
|
---|
| 75 |
|
---|
| 76 | <exec executable="/bin/bash" dir="${basedir}/compiled/ext/gnome-lib-minimal">
|
---|
[22836] | 77 | <arg value="-c"/>
|
---|
[24389] | 78 | <arg value="source setup.bash_old && source devel.bash"/>
|
---|
[22836] | 79 | </exec>
|
---|
[22939] | 80 | <echo>DONE COMPILING GNOME LIB EXTENSION</echo>
|
---|
[22941] | 81 | </if>
|
---|
[22836] | 82 | </if>
|
---|
| 83 |
|
---|
[21630] | 84 | <!-- run greenstone3's ant install and ant dist-tidy -->
|
---|
[20335] | 85 | <ant dir="compiled" inheritAll="false">
|
---|
| 86 | <target name="install"/>
|
---|
| 87 | <target name="dist-tidy"/>
|
---|
| 88 | <propertyset refid="forward.properties"/>
|
---|
[21748] | 89 | <property name="properties.accepted" value="true"/>
|
---|
[20335] | 90 | </ant>
|
---|
| 91 |
|
---|
[23967] | 92 | <!-- Delete all collections apart from the Lucene demo collection -->
|
---|
| 93 | <delete dir="${basedir}/compiled/web/sites/localsite/collect/gberg"/>
|
---|
| 94 | <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgdemo"/>
|
---|
| 95 | <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgppdemo"/>
|
---|
| 96 | <delete dir="${basedir}/compiled/web/sites/localsite/collect/infomine"/>
|
---|
| 97 |
|
---|
[22851] | 98 | <!-- Delete the entire gnome support library on Linux -->
|
---|
| 99 | <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
|
---|
[23618] | 100 | <delete dir="${basedir}/compiled/ext/gnome-lib-minimal"/>
|
---|
| 101 | <delete file="${basedir}/compiled/ext/gnome-lib-linux.tar.gz"/>
|
---|
[22851] | 102 | </if>
|
---|
| 103 |
|
---|
[28282] | 104 | <!-- Delete all but the lib folder of the gnome support library on Mac,
|
---|
| 105 | then move this smaller gnome-lib-minimal dir from the top-level ext folder
|
---|
| 106 | to gs2build/ext, since wvware on mac needs gnome-lib-minimal -->
|
---|
[22851] | 107 | <if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
|
---|
[23618] | 108 | <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/cascade-make"/>
|
---|
| 109 | <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/packages"/>
|
---|
| 110 | <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/bin"/>
|
---|
| 111 | <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/etc"/>
|
---|
| 112 | <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/include"/>
|
---|
| 113 | <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/share"/>
|
---|
| 114 | <delete file="${basedir}/compiled/ext/gnome-lib-minimal/setup.bat"/>
|
---|
| 115 | <delete file="${basedir}/compiled/ext/gnome-lib-minimal/CASCADE-MAKE.sh"/>
|
---|
| 116 | <delete file="${basedir}/compiled/ext/gnome-lib-darwin.tar.gz"/>
|
---|
[28282] | 117 | <move file="${basedir}/compiled/ext/gnome-lib-minimal" todir="compiled/gs2build/ext"/>
|
---|
[22851] | 118 | </if>
|
---|
[29236] | 119 |
|
---|
| 120 | <!-- Delete Lucene 3.3 specific ext/solr folders, since we've switched over to Lucene 4.7.2 -->
|
---|
| 121 | <delete dir="${basedir}/compiled/ext/solr/lib3" />
|
---|
| 122 | <delete dir="${basedir}/compiled/ext/solr/conf3" />
|
---|
| 123 | <delete dir="${basedir}/compiled/ext/solr/etc3" />
|
---|
[22851] | 124 |
|
---|
[29205] | 125 |
|
---|
| 126 | <if><bool><and>
|
---|
| 127 | <equals arg1="${rk.os}" arg2="linux"/>
|
---|
| 128 | <equals arg1="${extension-x64}" arg2="-x64"/>
|
---|
| 129 | </and></bool>
|
---|
| 130 | <property name="bitness" value="64"/>
|
---|
| 131 | <else>
|
---|
| 132 | <property name="bitness" value="32"/>
|
---|
| 133 | </else>
|
---|
| 134 | </if>
|
---|
| 135 |
|
---|
| 136 | <!-- insert an xml parser (matched to the version of Perl being used by the release kit).
|
---|
| 137 | For Linux 64 bit, use the 64 bit versions.
|
---|
[29242] | 138 | For other *nix cases, including Macs, we stick to the 32 bit
|
---|
[29205] | 139 | versions since there have been no problems yet, probably
|
---|
| 140 | because our Mac has 5.12 which is not included in
|
---|
| 141 | XML-Parser so that our mac then tries to find the xml
|
---|
| 142 | parser on the system.-->
|
---|
[29242] | 143 | <if><bool><not><equals arg1="${rk.os}" arg2="windows"/></not></bool>
|
---|
| 144 | <copy todir="compiled/gs2build/perllib/cpan">
|
---|
| 145 | <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="${bitness}-bit/**/*"/>
|
---|
| 146 | </copy>
|
---|
| 147 | <move file="compiled/gs2build/perllib/cpan/${bitness}-bit" tofile="compiled/gs2build/perllib/cpan/XML-Parser"/>
|
---|
| 148 | </if>
|
---|
| 149 |
|
---|
[21842] | 150 | <!-- insert ant -->
|
---|
[27797] | 151 | <property name="insert.ant.version" value="1.8.2"/>
|
---|
[21842] | 152 | <mkdir dir="compiled/packages"/>
|
---|
[27797] | 153 | <get src="http://www.greenstone.org/gs3files/apache-ant-${insert.ant.version}-bin.tar.gz" dest="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz"/>
|
---|
| 154 | <untar src="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz" dest="compiled/packages/" compression="gzip"/>
|
---|
| 155 | <move file="compiled/packages/apache-ant-${insert.ant.version}" tofile="compiled/packages/ant"/>
|
---|
| 156 | <delete file="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz"/>
|
---|
[21630] | 157 |
|
---|
| 158 | <!-- put the uninstaller in place -->
|
---|
| 159 | <antcall target="insert-and-compile-uninstaller"/>
|
---|
| 160 |
|
---|
| 161 | <!-- (windows only) -->
|
---|
[20335] | 162 | <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
|
---|
[21630] | 163 | <!-- insert perl -->
|
---|
| 164 | <unzip src="${rk.home}/shared/windows/perl.zip" dest="compiled/gs2build/bin/windows"/>
|
---|
[20335] | 165 | </if>
|
---|
[21630] | 166 |
|
---|
| 167 | <!-- minify tomcat -->
|
---|
| 168 | <delete dir="compiled/packages/tomcat/webapps/docs"/>
|
---|
| 169 | <delete dir="compiled/packages/tomcat/webapps/examples"/>
|
---|
| 170 |
|
---|
| 171 | <!-- tidy up gli to make it smaller -->
|
---|
| 172 | <antcall target="gli-tidy-for-dist"><param name="glibasedir" value="compiled/gli"/></antcall>
|
---|
| 173 |
|
---|
| 174 | <!-- strip out .svn dirs -->
|
---|
| 175 | <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
|
---|
| 176 |
|
---|
[29236] | 177 | <!-- get rid of bin/formatconverter on windows and get rid of bin/formatconverter.exe on linux/mac -->
|
---|
| 178 | <if>
|
---|
| 179 | <bool><equals arg1="${rk.os}" arg2="windows"/></bool>
|
---|
| 180 | <delete file="compiled/bin/formatconverter"/>
|
---|
| 181 | <else>
|
---|
| 182 | <delete file="compiled/bin/formatconverter.exe"/>
|
---|
| 183 | </else>
|
---|
| 184 | </if>
|
---|
| 185 |
|
---|
[24089] | 186 | <!-- (linux only) -->
|
---|
| 187 | <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
|
---|
| 188 | <!-- grab imagemagick binaries -->
|
---|
| 189 | <delete dir="compiled/gs2build/bin/linux/imagemagick"/>
|
---|
[27731] | 190 |
|
---|
| 191 | <exec executable="svn">
|
---|
| 192 | <arg value="export"/>
|
---|
| 193 | <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-linux${extension-x64}.tar.gz"/>
|
---|
| 194 | <arg value="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
|
---|
| 195 | </exec>
|
---|
| 196 |
|
---|
| 197 | <exec executable="tar" dir="compiled/ext">
|
---|
| 198 | <arg value="xvzf"/>
|
---|
| 199 | <arg value="imagemagick-linux${extension-x64}.tar.gz"/>
|
---|
| 200 | </exec>
|
---|
| 201 | <delete file="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
|
---|
| 202 | <move todir="compiled/gs2build/bin/linux/imagemagick">
|
---|
| 203 | <fileset dir="compiled/ext/imagemagick/linux"/>
|
---|
| 204 | </move>
|
---|
| 205 | <delete dir="compiled/ext/imagemagick"/>
|
---|
| 206 |
|
---|
| 207 | <!--<delete dir="compiled/gs2build/bin/linux/imagemagick"/>
|
---|
[24089] | 208 | <exec executable="svn">
|
---|
| 209 | <arg value="export"/>
|
---|
| 210 | <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
|
---|
| 211 | <arg value="compiled/gs2build/bin/linux/imagemagick"/>
|
---|
[27731] | 212 | </exec>-->
|
---|
[24089] | 213 |
|
---|
| 214 | <!-- grab wv binaries -->
|
---|
| 215 | <delete dir="compiled/gs2build/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/gs2build/bin/linux/wv"/>
|
---|
| 220 | </exec>
|
---|
| 221 | <!-- (mac only) -->
|
---|
| 222 | <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
|
---|
| 223 | <!-- grab imagemagick binaries -->
|
---|
[27731] | 224 |
|
---|
| 225 | <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
|
---|
| 226 |
|
---|
[27888] | 227 | <!--<exec executable="svn">
|
---|
[27731] | 228 | <arg value="export"/>
|
---|
| 229 | <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.5.tar.gz"/>
|
---|
| 230 | <arg value="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
|
---|
| 231 | </exec>
|
---|
| 232 |
|
---|
| 233 | <exec executable="tar" dir="compiled/ext">
|
---|
| 234 | <arg value="xvzf"/>
|
---|
| 235 | <arg value="imagemagick-darwin-10.5.tar.gz"/>
|
---|
| 236 | </exec>
|
---|
| 237 | <delete file="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
|
---|
| 238 | <move todir="compiled/gs2build/bin/darwin/imagemagick">
|
---|
| 239 | <fileset dir="compiled/ext/imagemagick/darwin"/>
|
---|
| 240 | </move>
|
---|
[27888] | 241 | <delete dir="compiled/ext/imagemagick"/>-->
|
---|
[27731] | 242 |
|
---|
[27888] | 243 | <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
|
---|
[24089] | 244 | <exec executable="svn">
|
---|
| 245 | <arg value="export"/>
|
---|
| 246 | <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
|
---|
| 247 | <arg value="compiled/gs2build/bin/darwin/imagemagick"/>
|
---|
[27888] | 248 | </exec>
|
---|
[24089] | 249 |
|
---|
| 250 | <if><bool><not><equals arg1="${forward.install.flax}" arg2="true"/></not></bool>
|
---|
| 251 | <!-- grab ghostscript binaries -->
|
---|
| 252 | <delete dir="compiled/gs2build/bin/darwin/ghostscript"/>
|
---|
| 253 | <exec executable="svn">
|
---|
| 254 | <arg value="export"/>
|
---|
| 255 | <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
|
---|
| 256 | <arg value="compiled/gs2build/bin/darwin/ghostscript"/>
|
---|
| 257 | </exec>
|
---|
| 258 | </if>
|
---|
| 259 | </if></else></if>
|
---|
| 260 |
|
---|
[24053] | 261 | <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
|
---|
[24084] | 262 | <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
|
---|
[24053] | 263 | <arg line="-S"/>
|
---|
[24094] | 264 | <arg line="gs2build/bin/script/import.pl -removeold -site localsite lucene-jdbm-demo"/>
|
---|
[24053] | 265 | <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
|
---|
[24085] | 266 | <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
|
---|
| 267 | <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
|
---|
[24053] | 268 | <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
|
---|
[24094] | 269 | <env key="GSDLOS" value="windows"/>
|
---|
[24097] | 270 | <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
|
---|
[24053] | 271 | </exec>
|
---|
[24084] | 272 | <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
|
---|
[24053] | 273 | <arg line="-S"/>
|
---|
[24094] | 274 | <arg line="gs2build/bin/script/buildcol.pl -removeold -site localsite lucene-jdbm-demo"/>
|
---|
[24053] | 275 | <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
|
---|
[24085] | 276 | <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
|
---|
| 277 | <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
|
---|
[24053] | 278 | <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
|
---|
[24094] | 279 | <env key="GSDLOS" value="windows"/>
|
---|
[24097] | 280 | <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
|
---|
[24053] | 281 | </exec>
|
---|
[24088] | 282 | <delete dir="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
|
---|
[24092] | 283 | <move file="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building" tofile="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
|
---|
[24053] | 284 | <else>
|
---|
| 285 | <echo file="${basedir}/compiled/buildscript.sh">
|
---|
| 286 | #!/bin/bash
|
---|
| 287 | source gs3-setup.sh
|
---|
| 288 | /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/import.pl -site localsite lucene-jdbm-demo
|
---|
| 289 | /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/buildcol.pl -site localsite lucene-jdbm-demo
|
---|
| 290 | rm -rf ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
|
---|
| 291 | mv ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
|
---|
| 292 | </echo>
|
---|
| 293 | <chmod perm="775" file="${basedir}/compiled/buildscript.sh"/>
|
---|
| 294 | <exec dir="${basedir}/compiled" executable="/bin/bash">
|
---|
| 295 | <arg line="buildscript.sh"/>
|
---|
| 296 | </exec>
|
---|
| 297 | <delete file="${basedir}/compiled/buildscript.sh"/>
|
---|
| 298 | </else>
|
---|
| 299 | </if>
|
---|
[24089] | 300 |
|
---|
[20335] | 301 | </target>
|
---|
| 302 |
|
---|
| 303 | </project>
|
---|