[14982] | 1 | <?xml version="1.0"?>
|
---|
| 2 |
|
---|
| 3 | <!-- ======================================================================
|
---|
| 4 | March 2005
|
---|
| 5 |
|
---|
| 6 | Greenstone3 build and install script
|
---|
| 7 |
|
---|
| 8 | kjdon
|
---|
| 9 | ====================================================================== -->
|
---|
| 10 |
|
---|
| 11 | <project name="opeations-on-gs3home" default="usage">
|
---|
| 12 |
|
---|
| 13 | <!-- include standard build file -->
|
---|
| 14 | <import file="${basedir}/build.xml"/>
|
---|
| 15 |
|
---|
| 16 | <property name="documented.collections.home" value="/home/nzdl/for-distributions/collect"/>
|
---|
| 17 | <property name="greenstone3-change-date" value="Tue Feb 20 12:13:42 NZDT 2007"/>
|
---|
| 18 | <property name="gs2build-change-date" value="Wed Dec 13 10:35:57 NZDT 2006"/>
|
---|
| 19 |
|
---|
| 20 | <!-- ====================== DISTRIBUTION Targets ========================= -->
|
---|
| 21 |
|
---|
| 22 | <!-- Create the binaries for Unix/Mac distributions -->
|
---|
| 23 | <target name="prepare-unix" depends="init">
|
---|
| 24 | <antcall target="checkout-gs2build"/>
|
---|
| 25 | <antcall target="checkout-gli"/>
|
---|
| 26 | </target>
|
---|
| 27 |
|
---|
| 28 | <target name="update-unix" depends="init">
|
---|
| 29 | <antcall target="svnupdate-distribution"/>
|
---|
| 30 | <antcall target="delete-windows-files"/>
|
---|
| 31 | </target>
|
---|
| 32 |
|
---|
| 33 | <target name="configure-unix" depends="init">
|
---|
| 34 | <antcall target="configure-c++"/>
|
---|
| 35 | </target>
|
---|
| 36 | <target name="build-unix" depends="init">
|
---|
| 37 | <antcall target="compile-packages"/>
|
---|
| 38 | <antcall target="compile-gs2build"/>
|
---|
| 39 | </target>
|
---|
| 40 |
|
---|
| 41 |
|
---|
| 42 |
|
---|
| 43 | <!-- creates the base distribution. Needs binaries copied in to it from other greenstones (prepare-os targets) -->
|
---|
| 44 | <target name="create-distribution-1" depends="init" description="do all the initial downloading and setting up">
|
---|
| 45 |
|
---|
| 46 | <antcall target="checkout-gs2build"/>
|
---|
[16269] | 47 |
|
---|
| 48 | <!--
|
---|
| 49 | gli is now checked out by create-distribution.xml
|
---|
| 50 | so it already exists
|
---|
[14982] | 51 | <antcall target="checkout-gli"/>
|
---|
[16269] | 52 | -->
|
---|
[14982] | 53 |
|
---|
| 54 | <delete><fileset dir="." includes="*.bat"/></delete>
|
---|
[15967] | 55 | <!--<delete file="${gli.home}/gli.sh"/>-->
|
---|
[14982] | 56 | <delete file="${gli.home}/gems.sh"/>
|
---|
| 57 | <delete dir="${gs2build.home}/gs2build-extra"/>
|
---|
| 58 |
|
---|
| 59 | <antcall target="prepare-tomcat"/>
|
---|
| 60 | <delete file="${packages.home}/apache-tomcat-5.5.25.zip"/>
|
---|
| 61 | <delete file="${packages.home}/apache-tomcat-5.5.25-compat.zip"/>
|
---|
| 62 |
|
---|
| 63 | <antcall target="prepare-axis"/>
|
---|
| 64 | <delete file="${packages.home}/axis-bin-1_2_1.zip"/>
|
---|
| 65 |
|
---|
| 66 | <!-- delete old axis dir -->
|
---|
| 67 | <delete dir="${packages.home}/axis"/>
|
---|
| 68 | <mkdir dir="${web.home}/applet"/>
|
---|
| 69 | <mkdir dir="${web.home}/logs"/>
|
---|
| 70 | <antcall target="prepare-ant"/>
|
---|
| 71 | <delete file="${packages.home}/apache-ant-1.7.0-bin.zip"/>
|
---|
| 72 | <antcall target="prepare-collections"/>
|
---|
| 73 |
|
---|
| 74 | <!-- get good XML-Parser - does this work? -->
|
---|
| 75 | <antcall target="get-xml-parser"/>
|
---|
| 76 |
|
---|
| 77 | <!-- documented collections -->
|
---|
| 78 | <antcall target="get-documented-collections"/>
|
---|
| 79 |
|
---|
| 80 | <delete file="${basedir}/README-CVS.txt"/>
|
---|
| 81 | <delete file="${basedir}/TODO.txt"/>
|
---|
| 82 |
|
---|
| 83 | <!-- make the extra directories needed for a release -->
|
---|
| 84 | <!--<mkdir dir="${basedir}/Linux/lib/jni"/>
|
---|
| 85 | <mkdir dir="${gs2build.home}/Unix/bin/linux"/>-->
|
---|
| 86 |
|
---|
| 87 | </target>
|
---|
| 88 |
|
---|
| 89 | <target name="create-distribution-2" description="do all the compilation">
|
---|
| 90 |
|
---|
| 91 | <!-- compile the java stuff -->
|
---|
| 92 | <antcall target="compile-web"/>
|
---|
| 93 | <antcall target="configure-tomcat"/>
|
---|
| 94 | <antcall target="configure-packages-and-indexers"/>
|
---|
| 95 | <antcall target="compile-packages-and-indexers-javaonly"/>
|
---|
| 96 | <antcall target="distclean-packages"/>
|
---|
| 97 | <antcall target="compile-core"/>
|
---|
| 98 | <antcall target="compile-gli"/>
|
---|
| 99 |
|
---|
| 100 | </target>
|
---|
| 101 |
|
---|
| 102 | <target name="create-distribution-3" depends="init" description="Do the rearranging of source code and others">
|
---|
| 103 |
|
---|
| 104 | <!-- delete some source files -->
|
---|
| 105 | <delete dir="${gs2build.home}/source/src"/>
|
---|
| 106 | <delete dir="${gs2build.home}/source/lib"/>
|
---|
| 107 | <delete dir="${gs2build.home}/source/packages"/>
|
---|
| 108 | <delete dir="${gs2build.home}/source/indexers"/>
|
---|
| 109 |
|
---|
| 110 | <!-- generate modified build.xml file -->
|
---|
| 111 | <antcall target="run-xslt-binary"/>
|
---|
| 112 |
|
---|
| 113 | <!-- clean up -->
|
---|
| 114 | <delete><fileset dir="${basedir}" includes="**/.svn"/></delete>
|
---|
| 115 |
|
---|
| 116 | <delete><fileset dir="${basedir}" includes="*.bat"/></delete>
|
---|
| 117 | <delete><fileset dir="${basedir}/gli" includes="*.bat"/></delete>
|
---|
| 118 | <delete><fileset dir="${basedir}/gs2build" includes="*.bat"/></delete>
|
---|
| 119 | <delete><fileset dir="${basedir}/bin/script" includes="*.bat"/></delete>
|
---|
| 120 |
|
---|
| 121 | <delete dir="${basedir}/build"/>
|
---|
| 122 | <delete dir="${basedir}/lib/jni"/>
|
---|
| 123 | <delete dir="${basedir}/winutil"/>
|
---|
| 124 | <delete dir="${basedir}/dist-resources"/>
|
---|
| 125 | <delete dir="${basedir}/gs2build/source"/>
|
---|
| 126 |
|
---|
| 127 | <delete file="${basedir}/gs2build/WIN32cfg.h"/>
|
---|
| 128 | <delete file="${basedir}/gs2build/win32.mak"/>
|
---|
| 129 |
|
---|
| 130 | </target>
|
---|
| 131 |
|
---|
| 132 | <!-- Supplementary targets -->
|
---|
| 133 |
|
---|
| 134 | <target name="svnupdate-distribution" depends="init">
|
---|
| 135 | <antcall target="svnupdate-packages"/>
|
---|
| 136 | <antcall target="svnupdate-core"/>
|
---|
| 137 | <antcall target="svnupdate-gs2build"/>
|
---|
| 138 | <antcall target="svnupdate-web"/>
|
---|
| 139 | </target>
|
---|
| 140 |
|
---|
| 141 | <target name="run-xslt-binary" depends="init">
|
---|
[16172] | 142 | <xslt in="${basedir}/build.xml" out="${basedir}/modified-build.xml" style="${lirk3.home}/greenstone3/xsl/convert-build-xml.xsl"/>
|
---|
[14982] | 143 | </target>
|
---|
| 144 |
|
---|
| 145 | <target name="run-xslt-source" depends="init">
|
---|
[16172] | 146 | <xslt in="${basedir}/build.xml" out="${basedir}/modified-build.xml" style="${lirk3.home}/greenstone3/xsl/convert-build-xml-source.xsl"/>
|
---|
[14982] | 147 | </target>
|
---|
| 148 |
|
---|
| 149 | <target name="configure-packages-and-indexers" depends="init">
|
---|
| 150 | <exec executable="${indexers.home}/configure"
|
---|
| 151 | dir="${indexers.home}">
|
---|
| 152 | <arg value="--prefix=${basedir}"/>
|
---|
| 153 | <arg value="--libdir=${lib.jni}"/>
|
---|
| 154 | </exec>
|
---|
| 155 | <exec executable="${javagdbm.home}/configure"
|
---|
| 156 | dir="${javagdbm.home}">
|
---|
| 157 | <arg value="--prefix=${basedir}"/>
|
---|
| 158 | <arg value="--libdir=${lib.jni}"/>
|
---|
| 159 | </exec>
|
---|
| 160 |
|
---|
| 161 | </target>
|
---|
| 162 |
|
---|
| 163 | <target name="compile-packages-and-indexers-javaonly" depends="init">
|
---|
| 164 | <echo>Compiling Indexers</echo>
|
---|
| 165 | <exec executable="make" os="${os.unix}"
|
---|
| 166 | dir="${indexers.home}">
|
---|
| 167 | <arg value="javaonly"/>
|
---|
| 168 | </exec>
|
---|
| 169 | <exec executable="make" os="${os.unix}"
|
---|
| 170 | dir="${indexers.home}">
|
---|
| 171 | <arg value="install-javaonly"/>
|
---|
| 172 | </exec>
|
---|
| 173 | <!-- install the jar files -->
|
---|
| 174 | <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
|
---|
| 175 | <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
|
---|
| 176 | <copy file="${lucene.home}/LuceneWrapper.jar" todir="${web.lib}"/>
|
---|
| 177 |
|
---|
| 178 | <!-- javagdbm -->
|
---|
| 179 | <exec executable="make" os="${os.unix}"
|
---|
| 180 | dir="${javagdbm.home}">
|
---|
| 181 | <arg value="javaonly"/>
|
---|
| 182 | </exec>
|
---|
| 183 | <exec executable="make" os="${os.unix}"
|
---|
| 184 | dir="${javagdbm.home}">
|
---|
| 185 | <arg value="installjava"/>
|
---|
| 186 | </exec>
|
---|
| 187 | <!-- install the jar file -->
|
---|
| 188 | <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
|
---|
| 189 |
|
---|
| 190 | </target>
|
---|
| 191 |
|
---|
| 192 | <target name="delete-windows-files" depends="init" unless="current.os.iswindows">
|
---|
| 193 | <delete dir="${basedir}/winutil"/>
|
---|
| 194 | <delete>
|
---|
| 195 | <fileset dir="${lib.jni}" includes="*.dll"/>
|
---|
| 196 | </delete>
|
---|
| 197 | </target>
|
---|
| 198 |
|
---|
| 199 | <target name="get-perl-for-windows" depends="init" if="current.os.iswindows">
|
---|
| 200 | <mkdir dir="${gs2build.home}/bin/windows"/>
|
---|
| 201 | <get src="http://www.greenstone.org/gs3files/perl-for-windows.zip"
|
---|
| 202 | dest="${gs2build.home}/bin/windows/perl-for-windows.zip"
|
---|
| 203 | usetimestamp="true"/>
|
---|
| 204 | <unzip src="${gs2build.home}/bin/windows/perl-for-windows.zip"
|
---|
| 205 | dest="${gs2build.home}/bin/windows"/>
|
---|
| 206 | <delete file="${gs2build.home}/bin/windows/perl-for-windows.zip"/>
|
---|
| 207 | </target>
|
---|
| 208 |
|
---|
| 209 | <target name="distclean-packages" depends="init">
|
---|
| 210 | <!-- indexers : just call the make target -->
|
---|
| 211 | <exec executable="make" os="${os.unix}"
|
---|
| 212 | dir="${indexers.home}">
|
---|
| 213 | <arg value="distclean"/>
|
---|
| 214 | </exec>
|
---|
| 215 | <!-- javagdbm -->
|
---|
| 216 | <exec executable="make" os="${os.unix}"
|
---|
| 217 | dir="${javagdbm.home}">
|
---|
| 218 | <arg value="distclean"/>
|
---|
| 219 | </exec>
|
---|
| 220 | </target>
|
---|
| 221 |
|
---|
| 222 | <!-- copy the doc eg colls from /home/nzdl - note we don't include the formatting ones -->
|
---|
| 223 | <target name="get-documented-collections" depends="init">
|
---|
| 224 | <property name="collect.home" value="${basedir}/web/sites/localsite/collect"/>
|
---|
| 225 |
|
---|
| 226 | <!-- <copy todir="${collect.home}/authen-e">
|
---|
| 227 | <fileset dir="${documented.collections.home}/authen-e"/>
|
---|
| 228 | </copy>
|
---|
| 229 | <copy todir="${collect.home}/bibliog1">
|
---|
| 230 | <fileset dir="${documented.collections.home}/bibliog1"/>
|
---|
| 231 | </copy>
|
---|
| 232 | <copy todir="${collect.home}/bibliogr">
|
---|
| 233 | <fileset dir="${documented.collections.home}/bibliogr"/>
|
---|
| 234 | </copy>
|
---|
| 235 | <copy todir="${collect.home}/dls-e">
|
---|
| 236 | <fileset dir="${documented.collections.home}/dls-e"/>
|
---|
| 237 | </copy>
|
---|
| 238 | <copy todir="${collect.home}/dspace-e">
|
---|
| 239 | <fileset dir="${documented.collections.home}/dspace-e"/>
|
---|
| 240 | </copy>
|
---|
| 241 | <copy todir="${collect.home}/gsarch-e">
|
---|
| 242 | <fileset dir="${documented.collections.home}/gsarch-e"/>
|
---|
| 243 | </copy>
|
---|
| 244 | <copy todir="${collect.home}/image-e">
|
---|
| 245 | <fileset dir="${documented.collections.home}/image-e"/>
|
---|
| 246 | </copy>
|
---|
| 247 | <copy todir="${collect.home}/isis-e">
|
---|
| 248 | <fileset dir="${documented.collections.home}/isis-e"/>
|
---|
| 249 | </copy>
|
---|
| 250 | <copy todir="${collect.home}/oai-e">
|
---|
| 251 | <fileset dir="${documented.collections.home}/oai-e"/>
|
---|
| 252 | </copy>
|
---|
| 253 | <copy todir="${collect.home}/pagedimg-e">
|
---|
| 254 | <fileset dir="${documented.collections.home}/pagedimg-e"/>
|
---|
| 255 | </copy>
|
---|
| 256 | <copy todir="${collect.home}/wrdpdf-e">
|
---|
| 257 | <fileset dir="${documented.collections.home}/wrdpdf-e"/>
|
---|
| 258 | </copy>
|
---|
| 259 |
|
---|
| 260 | <copy todir="${collect.home}/garish">
|
---|
| 261 | <fileset dir="${documented.collections.home}/garish"/>
|
---|
| 262 | </copy>
|
---|
| 263 | <copy todir="${collect.home}/marcexam">
|
---|
| 264 | <fileset dir="${documented.collections.home}/marcexam"/>
|
---|
| 265 | </copy>
|
---|
| 266 | <copy todir="${collect.home}/style-e">
|
---|
| 267 | <fileset dir="${documented.collections.home}/style-e"/>
|
---|
| 268 | </copy>
|
---|
| 269 | <copy todir="${collect.home}/wiki">
|
---|
| 270 | <fileset dir="${documented.collections.home}/wiki"/>
|
---|
| 271 | </copy> -->
|
---|
| 272 | </target>
|
---|
| 273 |
|
---|
| 274 | <target name="get-xml-parser" depends="init">
|
---|
| 275 | <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz" dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz" usetimestamp="true"/>
|
---|
| 276 | <untar src="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz" dest="${gs2build.home}/perllib/cpan/" compression="gzip"/>
|
---|
| 277 | <delete file="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"/>
|
---|
| 278 | </target>
|
---|
| 279 |
|
---|
| 280 | <!-- <target name="create-changelog"> -->
|
---|
| 281 | <!-- generate greenstone 3 changelog -->
|
---|
| 282 | <!-- <exec executable="/home/nzdl/for-distributions/bin/script/cvs2cl.pl"
|
---|
| 283 | dir="${basedir}">
|
---|
| 284 | <arg value="-P"/>
|
---|
| 285 | <arg value="-F"/>
|
---|
| 286 | <arg value="trunk"/>
|
---|
| 287 | <arg value="-r"/>
|
---|
| 288 | <arg value="-S"/>
|
---|
| 289 | <arg value="-l"/>
|
---|
| 290 | <arg value="-d'${greenstone3-change-date}<tomorrow'"/>
|
---|
| 291 | <arg value="-f"/>
|
---|
| 292 | <arg value="greenstone-${app.version}-ChangeLog.txt"/>
|
---|
| 293 | <arg value="-I"/>
|
---|
| 294 | <arg value="gli/.*|gs2build/.*"/>
|
---|
| 295 | </exec> -->
|
---|
| 296 | <!-- generate coll building change log -->
|
---|
| 297 | <!-- <exec executable="/home/nzdl/for-distributions/bin/script/cvs2cl.pl"
|
---|
| 298 | dir="${basedir}">
|
---|
| 299 | <arg value="-P"/>
|
---|
| 300 | <arg value="-F"/>
|
---|
| 301 | <arg value="trunk"/>
|
---|
| 302 | <arg value="-r"/>
|
---|
| 303 | <arg value="-S"/>
|
---|
| 304 | <arg value="-l"/>
|
---|
| 305 | <arg value="-d'${gs2build-change-date}<tomorrow'"/>
|
---|
| 306 | <arg value="-f"/>
|
---|
| 307 | <arg value="greenstone-${app.version}-ChangeLog-collbuilding.txt"/>
|
---|
| 308 | <arg value="gli"/>
|
---|
| 309 | <arg value="gs2build"/>
|
---|
| 310 | </exec>
|
---|
| 311 | </target> -->
|
---|
| 312 |
|
---|
| 313 |
|
---|
| 314 | <!-- new targets to go in distribution build.xml files -->
|
---|
| 315 |
|
---|
| 316 | <!-- new usage target for binary release -->
|
---|
| 317 | <target name="usage-for-binary-dist" description="Print a help message">
|
---|
| 318 | <echo message=" Execute 'ant -projecthelp' for a list of targets."/>
|
---|
| 319 | <echo message=" Execute 'ant -help' for Ant help."/>
|
---|
| 320 | </target>
|
---|
| 321 |
|
---|
| 322 |
|
---|
| 323 | <!-- new install target for source distribution -->
|
---|
| 324 | <target name="install-for-source-dist" depends="init" description="install the source distribution. Includes configuring and compiling">
|
---|
| 325 | <antcall target="unzip-windows-packages"/>
|
---|
| 326 | <!-- do the java version dependent stuff -->
|
---|
| 327 | <antcall target="configure-java-version"/>
|
---|
| 328 | <antcall target="install-macos-extra"/>
|
---|
| 329 | <!-- set gsdlhome in setup.bat -->
|
---|
| 330 | <antcall target="gs2build-edit-setup-bat"/>
|
---|
| 331 | <antcall target="install-indexer-files"/>
|
---|
| 332 | <antcall target="configure"/>
|
---|
| 333 | <antcall target="configure-c++"/>
|
---|
| 334 | <antcall target="compile"/>
|
---|
| 335 | <!-- make sure we have execute permission for the .sh files -->
|
---|
| 336 | <chmod dir="${basedir}" perm="ugo+rx"
|
---|
| 337 | includes="*.sh"/>
|
---|
| 338 |
|
---|
| 339 | </target>
|
---|
| 340 |
|
---|
| 341 | </project>
|
---|