source: other-projects/trunk/gs3-release-maker/build.xml@ 14762

Last change on this file since 14762 was 14762, checked in by oranfry, 15 years ago

fixed a buggy copy operation

File size: 40.5 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2
3<!--
4 ..........................................................
5 September 2007
6 Greenstone3 'release maker' script
7 Oran Fry
8 ..........................................................
9-->
10
11<project name="gs3-release-maker" default="help">
12
13 <!-- classpath -->
14 <path id="project.classpath">
15 <fileset dir="tasks">
16 <include name="**/*.jar"/>
17 </fileset>
18 <fileset dir="lib">
19 <include name="*.jar"/>
20 </fileset>
21 <pathelement path="tasks/orans"/>
22 </path>
23
24 <!-- svn root -->
25 <property name="svn.root" value="http://svn.greenstone.org"/>
26
27 <!-- self defined tasks -->
28 <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
29 <taskdef name="try" classname="ise.antelope.tasks.TryTask" classpathref="project.classpath"/>
30 <taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>
31 <taskdef name="setloglevel" classname="SetLogLevel" classpathref="project.classpath"/>
32 <typedef name="addressedcall" classname="TreeCallTarget" classpathref="project.classpath"/>
33 <typedef name="rsr" classname="RegexSearchReplace" classpathref="project.classpath"/>
34 <taskdef name="scp" classname="org.apache.tools.ant.taskdefs.optional.SCP" classpathref="project.classpath"/>
35 <taskdef name="sshexec" classname="org.apache.tools.ant.taskdefs.optional.SSHExec" classpathref="project.classpath"/>
36
37
38 <!-- target relations
39 <typedef name="isafter" classname="IsAfter" classpathref="project.classpath"/>
40 <typedef name="isdescendantof" classname="IsDescendantOf" classpathref="project.classpath"/>
41 <typedef name="isbetweenyandroot" classname="IsBetweenYAndRoot" classpathref="project.classpath"/> -->
42
43
44 <!-- load in static properties from build.properties -->
45 <property file="build.properties" />
46
47 <!-- stuff to do before all tasks -->
48 <target name="init">
49
50 <echo level="info">CHECKING PRE-CONDITIONS</echo>
51 <echo level="info"/>
52
53 <!-- version number -->
54 <echo level="info">Checking if version number is set...</echo>
55 <if>
56 <bool>
57 <or>
58 <not><isset property="version"/></not>
59 <not><isset property="version.minor"/></not>
60 </or>
61 </bool>
62 <echo level="error">No, not set</echo>
63 <echo level="error">Please specify a version number</echo>
64 <echo level="error">E.g., ant -Dversion=3.03 -Dversion.minor=03 create-release</echo>
65 <echo level="error">or, ant -Dversion=trunk -Dversion.minor=03 create-release</echo>
66 <fail>Version number not set</fail>
67 </if>
68 <echo level="info">Version number: ${version}</echo>
69 <property name="app.version" value="${version}"/>
70 <echo level="info"/>
71
72 <!-- where to put the release -->
73 <echo level="info">Determining where to put the release...</echo>
74 <if>
75 <bool>
76 <or>
77 <not><isset property="release.dir"/></not>
78 <not><isset property="mac.release.dir"/></not>
79 <not><isset property="windows.release.dir"/></not>
80 </or>
81
82 </bool>
83 <echo level="error">No release directory specified.</echo>
84 <echo level="error">Please specify release directory on the command line.</echo>
85 <echo level="error">E.g., ant -Drelease.dir=/research/me/releases/3.03 -Dmac.release.dir=/Users/me/releases/3.03 -Dwindows.release.dir=c:\research\me\releases\3.03 create-release</echo>
86 <fail>Release directorys not set</fail>
87 </if>
88 <echo level="info">Release directory: ${release.dir}</echo>
89 <echo level="info">Mac release directory: ${mac.release.dir}</echo>
90 <echo level="info">Windows release directory: ${windows.release.dir}</echo>
91 <echo level="info"/>
92
93 <!-- check start from -->
94 <echo level="info">Checking if we are resuming from a given target...</echo>
95 <if>
96 <bool>
97 <not><isset property="resume.from"/></not>
98 </bool>
99 <echo level="info">No, start from the beginning</echo>
100 <property name="resume.from" value="1"/>
101 <else>
102 <echo level="info">Yes, resuming from ${resume.from}</echo>
103 </else>
104 </if>
105 <echo level="info"/>
106
107 <!-- check resume mode-->
108 <echo level="info">Determining resume mode...</echo>
109 <if>
110 <bool>
111 <not><isset property="resume.mode"/></not>
112 </bool>
113 <echo level="info">Mode not set, defaulting to 'fallthrough'</echo>
114 <property name="resume.mode" value="fallthrough"/>
115 <else>
116 <echo level="info">Mode set to ${resume.mode}</echo>
117 <if>
118 <bool>
119 <and>
120 <not><equals arg1="${resume.mode}" arg2="descend"/></not>
121 <not><equals arg1="${resume.mode}" arg2="fallthrough"/></not>
122 </and>
123 </bool>
124 <echo level="error">You have not specified a valid resume mode.</echo>
125 <echo level="error">Valid modes are 'fallthrough' and 'descend'.</echo>
126 <fail>You have not specified a valid resume mode.</fail>
127 </if>
128 </else>
129 </if>
130 <echo level="info"/>
131
132 <!-- check username and password -->
133 <echo level="info">Checking if username and password set...</echo>
134 <if>
135 <bool>
136 <not><isset property="username"/></not>
137 </bool>
138 <echo level="info">Not set</echo>
139 <fail>You have not specified a username for ssh</fail>
140 </if>
141 <echo level="info"/>
142
143 <!-- execute target code or just traverse tree -->
144 <echo level="info">Determining execute mode...</echo>
145 <if>
146 <bool>
147 <not><isset property="execute"/></not>
148 </bool>
149 <echo level="info">Execute not set, defaulting to 'true'</echo>
150 <property name="execute" value="true"/>
151 <else>
152 <echo level="info">Execute set to ${execute}</echo>
153 <if>
154 <bool>
155 <and>
156 <not><equals arg1="${execute}" arg2="true"/></not>
157 <not><equals arg1="${execute}" arg2="false"/></not>
158 </and>
159 </bool>
160 <echo level="error">You have not specified a valid value for execute.</echo>
161 <echo level="error">Valid values are 'true' and 'false'.</echo>
162 <fail>You have not specified a valid value for execute.</fail>
163 </if>
164 </else>
165 </if>
166
167 <echo level="info"/>
168
169
170 <!-- the trunk or a branch -->
171 <echo level="info">Determining the branch path...</echo>
172 <if>
173 <bool>
174 <equals arg1="trunk" arg2="${version}"/>
175 </bool>
176 <property name="branch.path" value="trunk"/>
177
178 <else>
179 <property name="branch.path" value="branches/${version}"/>
180 </else>
181 </if>
182 <echo level="info">Branch Path: ${branch.path}</echo>
183 <echo level="info"/>
184
185 <!-- check branches exist -->
186 <property name="svn.greenstone3" value="${svn.root}/greenstone3/${branch.path}"/>
187 <property name="svn.gsdl" value="${svn.root}/gsdl/${branch.path}"/>
188 <property name="svn.gli" value="${svn.root}/gli/${branch.path}"/>
189 <property name="svn.indexers" value="${svn.root}/indexers/${branch.path}"/>
190 <property name="svn.documentation" value="${svn.root}/documentation/${branch.path}"/>
191
192 <tempfile property="temp.file" destdir="${java.io.tmpdir}" prefix="delete" suffix=".tmp"/>
193
194 <!-- greenstone3 branch -->
195 <echo level="info">Checking that ${svn.greenstone3} exists...</echo>
196 <!-- try to put the html index of the location into the temp file -->
197 <setloglevel level="error"/>
198 <try>
199 <get src="${svn.greenstone3}" dest="${temp.file}"/>
200 <catch>
201 <echo level="error">No, it does not exist</echo>
202 <property name="svn.greenstone3.unavailable" value="true"/>
203 </catch>
204 </try>
205 <setloglevel level="info"/>
206 <if>
207 <bool><not><istrue value="${svn.greenstone3.unavailable}"/></not></bool>
208 <echo level="info">Yes, it exists</echo>
209 </if>
210
211 <!-- greenstone3 branch -->
212 <echo level="info">Checking that ${svn.gsdl} exists...</echo>
213 <setloglevel level="error"/>
214 <try>
215 <get src="${svn.gsdl}" dest="${temp.file}"/>
216 <catch>
217 <echo level="error">No, it does not exist</echo>
218 <property name="svn.gsdl.unavailable" value="true"/>
219 </catch>
220 </try>
221 <setloglevel level="info"/>
222 <if>
223 <bool><not><istrue value="${svn.gsdl.unavailable}"/></not></bool>
224 <echo level="info">Yes, it exists</echo>
225 </if>
226
227
228 <!-- gli branch -->
229 <echo level="info">Checking that ${svn.gli} exists...</echo>
230 <!-- try to put the html index of the location into the temp file -->
231 <setloglevel level="error"/>
232 <try>
233 <get src="${svn.gli}" dest="${temp.file}"/>
234 <catch>
235 <echo level="error">No, does not exist</echo>
236 <property name="svn.gli.unavailable" value="true"/>
237 </catch>
238 </try>
239 <setloglevel level="info"/>
240 <if>
241 <bool><not><istrue value="${svn.gli.unavailable}"/></not></bool>
242 <echo level="info">Yes, it exists</echo>
243 </if>
244
245
246 <!-- indexers branch -->
247 <echo level="info">Checking that ${svn.indexers} exists...</echo>
248 <!-- try to put the html index of the location into the temp file -->
249 <setloglevel level="error"/>
250 <try>
251 <get src="${svn.indexers}" dest="${temp.file}"/>
252 <catch>
253 <echo level="error">No, it does not exist</echo>
254 <property name="svn.indexers.unavailable" value="true"/>
255 </catch>
256 </try>
257 <setloglevel level="info"/>
258 <if>
259 <bool><not><istrue value="${svn.indexers.unavailable}"/></not></bool>
260 <echo level="info">Yes, it exists</echo>
261 </if>
262
263 <!-- documentation branch -->
264 <echo level="info">Checking that ${svn.documentation} exists...</echo>
265 <!-- try to put the html index of the location into the temp file -->
266 <setloglevel level="error"/>
267 <try>
268 <get src="${svn.documentation}" dest="${temp.file}"/>
269 <catch>
270 <echo level="error">No, it does not exist</echo>
271 <property name="svn.documentation.unavailable" value="true"/>
272 </catch>
273 </try>
274 <setloglevel level="info"/>
275 <if>
276 <bool><not><istrue value="${svn.documentation.unavailable}"/></not></bool>
277 <echo level="info">Yes, it exists</echo>
278 </if>
279
280
281 <!-- clean up the temp file -->
282 <setloglevel level="error"/>
283 <delete file="${temp.file}"/>
284 <setloglevel level="info"/>
285
286
287 <!-- fail if some branches were missing -->
288 <if>
289 <bool>
290 <or>
291 <istrue value="${svn.greenstone3.unavailable}"/>
292 <istrue value="${svn.gsdl.unavailable}"/>
293 <istrue value="${svn.gli.unavailable}"/>
294 <istrue value="${svn.indexers.unavailable}"/>
295 <istrue value="${svn.documentation.unavailable}"/>
296 </or>
297 </bool>
298 <fail>Some branches do not exist, or you are unable to access them from where you are. Please review the list above and create any branches that are missing, or run this script from somewhere with access to the repository.</fail>
299 <else>
300 <echo level="info">All exist</echo>
301 </else>
302 </if>
303
304 </target>
305
306 <target name="help">
307
308 <echo level="info">Usage: ant -Dversion=VERSION_NUMBER -Drelease.dir=RELEASEDIR -Dusername=USERNAME -Dpassword=PASSWORD -Dmac.release.dir=OUTPUT_DIRECTORY [-Dresume.from=TARGET_ADDRESS] [-Dresume.mode=MODE] create-release</echo>
309 <echo level="info"/>
310
311 <echo level="info">This project creates releases of Greenstone3 from the subversion repository given a version number.</echo>
312 <echo level="info"/>
313
314 <echo level="info">Each target in this project's target tree has been given an address, like so:</echo>
315 <echo level="info"/>
316 <echo level="info">root</echo>
317 <echo level="info"> |-1</echo>
318 <echo level="info"> | |-1.1</echo>
319 <echo level="info"> | |-1.2</echo>
320 <echo level="info"> |</echo>
321 <echo level="info"> |-2</echo>
322 <echo level="info"> | |-2.1</echo>
323 <echo level="info"> | |-2.2</echo>
324 <echo level="info"> etc.</echo>
325
326 <echo level="info"/>
327
328
329 <echo level="info">PARAMETERS</echo>
330 <echo level="info">Parameters are specifiable on the command line or in build.properties</echo>
331 <echo level="info">Parameters which remain static throughout the release process should be stores in build.properties:</echo>
332 <echo level="info">version, version.minor, release.dir, mac.release.dir, windows.release.dir, username</echo>
333 <echo level="info">Other parameters will change each time you invoke the script, specify them on the command line:</echo>
334 <echo level="info">resume.from, resume.mode</echo>
335
336
337
338 <echo level="info"/>
339
340 <echo level="info">version=VERSION_NUMBER, where VERSION_NUMBER={x.xx|trunk}</echo>
341 <echo level="info"/>
342 <echo level="info">This project can either create a release from a greenstone3 branch, or from the development trunk.</echo>
343 <echo level="info">To create a branch release, specify the VERSION_NUMBER (e.g., 3.03), and ensure that the following</echo>
344 <echo level="info">branches exist in the repository:</echo>
345 <echo level="info"> greenstone3/branches/VERSION_NUMBER</echo>
346 <echo level="info"> gli/branches/VERSION_NUMBER</echo>
347 <echo level="info"> indexers/branches/VERSION_NUMBER</echo>
348 <echo level="info"> documentation/branches/VERSION_NUMBER</echo>
349 <echo level="info">To create a trunk release, specify 'trunk' as the version number.</echo>
350 <echo level="info">The project will use the trunk of greenstone3, gli, indexers and documentation for the release.</echo>
351 <echo level="info"/>
352 <echo level="info"/>
353
354 <echo level="info">release.dir=RELEASE_DIRECTORY</echo>
355 <echo level="info"/>
356 <echo level="info">Specifies the directory in the filesystem where the release files will be kept.</echo>
357 <echo level="info"/>
358 <echo level="info"/>
359
360 <echo level="info">resume.from=TARGET_ADDRESS, where TARGET_ADDRESS=x.y.z (e.g., 2.1.3)</echo>
361 <echo level="info"/>
362 <echo level="info">Allows you to specify a target address from which execution will resume.</echo>
363 <echo level="info">This is helpful for restarting the script after it has failed part-way through.</echo>
364 <echo level="info">By default, execution starts from the root target (create-release) and proceeds downwards.</echo>
365 <echo level="info">You can specify a different target to start from by setting the resume.from parameter.</echo>
366 <echo level="info"/>
367 <echo level="info"/>
368
369 <echo level="info">resume.mode=RESUME_MODE, where RESUME_MODE={fallthrough|descend}</echo>
370 <echo level="info"/>
371 <echo level="info">fallthrough (default): In fallthrough mode, execution proceeds downwards through the target tree</echo>
372 <echo level="info">1 -> 1.1 -> 1.2 -> 2 -> 2.1 -> 2.2 -> 3 -> 3.1 and so on.</echo>
373 <echo level="info">descend: In descend mode, execution descends a single branch of the target tree.</echo>
374 <echo level="info">For example, if resume.from was set to '2', execution would proceed thus:</echo>
375 <echo level="info">2 -> 2.1 -> 2.2 (exit)</echo>
376 <echo level="info">This is helpful when you want to debug a particular target, or fix some conditions to allow it to finish</echo>
377 <echo level="info">properly, and don't want to run the whole script from the start.</echo>
378 <echo level="info"/>
379 <echo level="info"/>
380
381 <echo level="info">release.dir, mac.release.dir, windows.release.dir</echo>
382 <echo level="info"/>
383 <echo level="info">The full path to the directories where release files will be stored on</echo>
384 <echo level="info">linux(your machine), mac(shuttle) and windows(kohekohe).</echo>
385 <echo level="info">E.g., -Drelease.dir=/research/oranfry/releases/3.03</echo>
386 <echo level="info">E.g., -Dmac.release.dir=/Users/oranfry/releases/3.03</echo>
387 <echo level="info">E.g., -Dwindows.release.dir=c:\\research\\oranfry\\releases\\3.03</echo>
388 <echo level="info"/>
389 <echo level="info"/>
390
391 <echo level="info">username</echo>
392 <echo level="info"/>
393 <echo level="info">Your username for ssh from your machine to shuttle and kohekohe.</echo>
394 <echo level="info">You will be prompted for your password a number of times while the script executes.</echo>
395 <echo level="info"/>
396 <echo level="info"/>
397
398
399 </target>
400
401
402
403
404 <!-- ADDRESSED TARGETS -->
405
406 <!-- root target -->
407 <target name="create-release" depends="init">
408 <echo>Creating Release '${version}'</echo>
409 <addressedcall target="prep"/>
410 <addressedcall target="compile-binaries"/>
411 <addressedcall target="create-distribution"/>
412 <addressedcall target="create-source-distribution"/>
413 <addressedcall target="compile-documentation"/>
414 <addressedcall target="create-installer-project"/>
415 <addressedcall target="build-installers"/>
416 <addressedcall target="aggregate-release-files"/>
417 </target>
418
419 <!-- first level targets -->
420 <target name="prep">
421 <addressedcall target="create-dir-structure" />
422 </target>
423
424 <target name="compile-binaries">
425 <addressedcall target="linux" />
426 <addressedcall target="windows" />
427 <addressedcall target="mac" />
428 </target>
429
430 <target name="create-distribution">
431 <!-- create distribution -->
432 <addressedcall target="export-greenstone3" />
433 <addressedcall target="dist-set-version-number-property" />
434 <addressedcall target="create-distributions-1" />
435 <addressedcall target="create-distributions-2" />
436 <addressedcall target="create-distributions-3" />
437 <addressedcall target="copy-over-build-xml" />
438 <addressedcall target="insert-user-manual"/>
439 <addressedcall target="insert-compiled-binaries"/>
440 </target>
441
442 <target name="create-source-distribution">
443 <!-- create distribution -->
444 <addressedcall target="source-export-greenstone3" />
445 <addressedcall target="source-set-version-number-property" />
446 <addressedcall target="source-create-distribution" />
447 <addressedcall target="source-copy-over-build-xml" />
448 <addressedcall target="source-insert-user-manual"/>
449 <addressedcall target="source-create-archive"/>
450 </target>
451
452 <target name="compile-documentation">
453 <!-- compile documentation -->
454 </target>
455
456 <target name="create-installer-project">
457 <if><bool><istrue value="${execute}"/></bool>
458
459 <delete dir="${release.dir}/installer"/>
460 <mkdir dir="${release.dir}/installer"/>
461 <exec executable="cp"><arg line="-r /home/nzdl/for-distributions/installers/greenstone3 ${release.dir}/installer"/></exec>
462
463 <!-- Edit the <installer-dir>/greenstone3/Greenstone3 Digital Library Software.uip file and change any absolute paths as needed. Make sure you change all paths. -->
464 <copy overwrite="true" file="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip.template" tofile="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip" />
465 <rsr file="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip" pattern="@release\.dir@" replacement="${release.dir}" />
466 <rsr file="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip" pattern="@version\.minor@" replacement="${version.minor}" />
467 <rsr file="/home/nzdl/installshieldX/alias.properties" pattern="(GSDL3_DISTRIBUTION_SOURCE)=.*" replacement="$1=${release.dir}/dist/greenstone3" />
468 <if>
469 <bool><equals arg1="${version}" arg2="trunk"/></bool>
470 <rsr file="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip" pattern="@version@" replacement="trunk" />
471 <else>
472 <rsr file="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip" pattern="@version@" replacement="v${version}" />
473 </else>
474 </if>
475
476 </if>
477 </target>
478
479 <target name="build-installers">
480 <if><bool><istrue value="${execute}"/></bool>
481
482 <!-- linux -->
483 <exec dir="${release.dir}/installer/greenstone3" executable="/home/nzdl/installshieldX/InstallShieldUniversalCommandLineBuild">
484 <arg value="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip" />
485 <arg value="-build" />
486 <arg value="Linux Distribution" />
487 </exec>
488
489 <!-- windows -->
490 <exec dir="${release.dir}/installer/greenstone3" executable="/home/nzdl/installshieldX/InstallShieldUniversalCommandLineBuild">
491 <arg value="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip" />
492 <arg value="-build" />
493 <arg value="Windows Distribution" />
494 </exec>
495
496 <!-- mac -->
497 <exec dir="${release.dir}/installer/greenstone3" executable="/home/nzdl/installshieldX/InstallShieldUniversalCommandLineBuild">
498 <arg value="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip" />
499 <arg value="-build" />
500 <arg value="Mac OS X Distribution" />
501 </exec>
502
503 </if>
504 </target>
505
506 <target name="aggregate-release-files">
507 <if><bool><istrue value="${execute}"/></bool>
508 <delete dir="${release.dir}/gs3-${version}-release" />
509 <mkdir dir="${release.dir}/gs3-${version}-release" />
510 <exec executable="cp"><arg line="${release.dir}/installer/greenstone3/linux-distribution/disk1/setupLinux.bin ${release.dir}/gs3-${version}-release/greenstone-3.${version.minor}-linux.bin"/></exec>
511 <exec executable="cp"><arg line="${release.dir}/installer/greenstone3/macOSx-distribution/disk1/setupMac.command ${release.dir}/gs3-${version}-release/greenstone-3.${version.minor}-macOSx.command"/></exec>
512 <exec executable="cp"><arg line="${release.dir}/installer/greenstone3/windows-distribution/disk1/setupwin32.exe ${release.dir}/gs3-${version}-release/greenstone-3.${version.minor}-win32.exe"/></exec>
513 <exec executable="cp"><arg line="${release.dir}/source-dist/greenstone-3.${version.minor}-src.tar.gz ${release.dir}/gs3-${version}-release"/></exec>
514 </if>
515 </target>
516
517
518 <!-- second level targets -->
519 <target name="create-dir-structure">
520 <if><bool><istrue value="${execute}"/></bool>
521 <mkdir dir="${release.dir}" />
522 <mkdir dir="${release.dir}/other-platforms" />
523 <mkdir dir="${release.dir}/dist" />
524 <mkdir dir="${release.dir}/source-dist" />
525 <mkdir dir="${release.dir}/installer" />
526 </if>
527 </target>
528
529
530 <target name="linux">
531 <!-- preparation -->
532 <addressedcall target="checkout-greenstone3" />
533 <addressedcall target="set-version-number-property" />
534 <addressedcall target="dist-prepare-unix" />
535 <addressedcall target="tweak-configure-scripts" />
536 <!-- update -->
537 <addressedcall target="dist-update-unix" />
538 <!-- configure -->
539 <addressedcall target="dist-configure-unix" />
540 <addressedcall target="tweak-makefiles" />
541 <!-- build -->
542 <addressedcall target="dist-build-unix" />
543 <addressedcall target="fix-wget" />
544 <addressedcall target="linux-strip-execs" />
545
546 <!-- documentation -->
547 <addressedcall target="prepare-documentation" />
548 </target>
549
550 <target name="mac">
551 <!-- preparation -->
552 <addressedcall target="mac-checkout-greenstone3" />
553 <addressedcall target="mac-set-gdbm-path" />
554
555 <addressedcall target="mac-prepare-unix" />
556 <!-- update -->
557 <addressedcall target="mac-update-unix" />
558 <!-- configure -->
559 <addressedcall target="mac-configure-unix" />
560 <addressedcall target="mac-tweak-makefiles" />
561 <!-- build -->
562 <addressedcall target="mac-build-unix" />
563 <addressedcall target="mac-strip-execs" />
564
565 <!-- grab the files -->
566 <addressedcall target="mac-grab-files" />
567 </target>
568
569
570 <target name="windows">
571 <if><bool><istrue value="${execute}"/></bool>
572
573 <mkdir dir="${release.dir}/other-platforms/win-gs2build-bin-windows"/>
574 <mkdir dir="${release.dir}/other-platforms/win-lib-jni"/>
575
576 <echo level="info">The windows compilation stage still has to be done manually.</echo>
577 <echo level="info">Please go to the kohekohe machine and follow the instructions found at:</echo>
578 <echo level="info">http://wesson.cs.waikato.ac.nz:7070/wiki/index.php/Creating_A_GS3_Release#Windows</echo>
579 <echo level="info">Do the 'Preparation' and 'Update and Build' sections</echo>
580 <echo level="info"/>
581
582 <echo level="info">Then copy (scp):</echo>
583 <echo level="info">Windows:greenstone3/lib/jni/* to Linux:${release.dir}/other-platforms/win-lib-jni</echo>
584 <echo level="info">Windows:greenstone3/gs2build/bin/windows/* to Linux:${release.dir}/other-platforms/win-gs2build-bin-windows</echo>
585 <echo level="info"/>
586 <input addproperty="windows.compilation.done" validargs="done">Type 'done' when you have finished.</input>
587
588 </if>
589 </target>
590
591
592
593 <!-- third level targets -->
594 <target name="checkout-greenstone3">
595 <if><bool><istrue value="${execute}"/></bool>
596 <svn>
597 <checkout url="${svn.root}/greenstone3/${branch.path}" destPath="${release.dir}/greenstone3"/>
598 </svn>
599 </if>
600 </target>
601
602 <target name="set-version-number-property">
603 <if><bool><istrue value="${execute}"/></bool>
604 <rsr file="${release.dir}/greenstone3/resources/java/global.properties.in" pattern="@gsdl3version@" replacement="${version}" />
605 </if>
606 </target>
607
608 <target name="dist-prepare-unix">
609 <if><bool><istrue value="${execute}"/></bool>
610 <ant antfile="${release.dir}/greenstone3/dist-resources/dist-build.xml" dir="${release.dir}/greenstone3" target="prepare-unix" />
611 </if>
612 </target>
613 <target name="tweak-configure-scripts">
614 <addressedcall target="mgpp-add-static" />
615 <addressedcall target="mg-add-static" />
616 <addressedcall target="gs2buildextra-add-static" />
617 </target>
618
619 <target name="dist-update-unix">
620 <if><bool><istrue value="${execute}"/></bool>
621 <ant antfile="${release.dir}/greenstone3/dist-resources/dist-build.xml" dir="${release.dir}/greenstone3" target="update-unix" />
622 </if>
623 </target>
624
625 <target name="dist-configure-unix">
626 <if><bool><istrue value="${execute}"/></bool>
627 <exec dir="${release.dir}/greenstone3/gs2build/gs2build-extra" executable="autoconf" output="${release.dir}/greenstone3/gs2build/configure">
628 <arg line="configure.in"/>
629 </exec>
630 <chmod file="${release.dir}/greenstone3/gs2build/configure" perm="+x"/>
631 <ant antfile="${release.dir}/greenstone3/dist-resources/dist-build.xml" dir="${release.dir}/greenstone3" target="configure-unix" />
632 </if>
633 </target>
634
635 <target name="tweak-makefiles">
636 <addressedcall target="wv-add-static" />
637 <addressedcall target="xlhtml-add-static" />
638 <addressedcall target="ppthtml-add-static" />
639 <addressedcall target="rtftohtml-add-static" />
640 <addressedcall target="gdbm-add-static" />
641 </target>
642
643 <target name="dist-build-unix">
644 <if><bool><istrue value="${execute}"/></bool>
645 <ant antfile="${release.dir}/greenstone3/dist-resources/dist-build.xml" dir="${release.dir}/greenstone3" target="build-unix" />
646 </if>
647 </target>
648
649 <target name="fix-wget">
650 <if><bool><istrue value="${execute}"/></bool>
651 <!-- fix this !!! -->
652 <delete file="${release.dir}/greenstone3/gs2build/packages/wget/wget-1.9/src/wget"/>
653 </if>
654 </target>
655
656 <target name="linux-strip-execs">
657 <if><bool><istrue value="${execute}"/></bool>
658 <exec dir="${release.dir}/greenstone3/gs2build/bin/linux" executable="find">
659 <arg line="! -name . -exec strip {} &#59;"/>
660 </exec>
661 </if>
662 </target>
663
664 <target name="prepare-documentation">
665 <if><bool><istrue value="${execute}"/></bool>
666 <mkdir dir="${release.dir}/greenstone3/gsdl-manuals"/>
667 <svn>
668 <checkout url="${svn.root}/documentation/${branch.path}/manuals" destPath="${release.dir}/greenstone3/gsdl-manuals/manuals"/>
669 <checkout url="${svn.root}/documentation/${branch.path}/shared" destPath="${release.dir}/greenstone3/gsdl-manuals/shared"/>
670 </svn>
671 <javac srcdir="${release.dir}/greenstone3/gsdl-manuals/shared"
672 destdir="${release.dir}/greenstone3/gsdl-manuals/shared"
673 debug="on">
674 <include name="*.java"/>
675 </javac>
676 <unzip src="${release.dir}/greenstone3/gsdl-manuals/shared/fop.zip" dest="${release.dir}/greenstone3/gsdl-manuals/shared"/>
677
678 <!-- classpath -->
679 <path id="documentation.compile.classpath">
680 <fileset dir="${release.dir}/greenstone3/gsdl-manuals">
681 <include name="**/*.jar"/>
682 </fileset>
683 <pathelement path="${release.dir}/greenstone3/gsdl-manuals/shared"/>
684 <pathelement path="${release.dir}/greenstone3/gsdl-manuals/manuals"/>
685 </path>
686
687 <java classname="ApplyXSLT" classpathref="documentation.compile.classpath" output="${release.dir}/greenstone3/gsdl-manuals/manuals/xml-source/en/help-en.xml">
688 <arg value="${release.dir}/greenstone3/gsdl-manuals/manuals/processing/gen-gli-help-to-manual-chapter.xsl" />
689 <arg value="${release.dir}/greenstone3/gli/help/en/help.xml" />
690 <arg value="${release.dir}/greenstone3" />
691 </java>
692
693 <chmod perm="a+x" file="${release.dir}/greenstone3/gsdl-manuals/shared/fop/fop.sh"/>
694 <exec dir="${release.dir}/greenstone3/gsdl-manuals/manuals" executable="${release.dir}/greenstone3/gsdl-manuals/manuals/generate-pdf.sh">
695 <arg line="u en" />
696 </exec>
697
698 </if>
699 </target>
700
701 <target name="mac-checkout-greenstone3">
702 <if><bool><istrue value="${execute}"/></bool>
703 <echo level="info">create release directory, if absent</echo>
704 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle if [ ! -e ${mac.release.dir} ]; then mkdir ${mac.release.dir}; fi" /></exec>
705
706 <echo level="info">checkout greenstone3</echo>
707 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cd ${mac.release.dir}; PATH=$PATH:/usr/local/bin svn co ${svn.root}/greenstone3/${branch.path} greenstone3" /></exec>
708 </if>
709 </target>
710
711 <target name="mac-set-gdbm-path">
712 <if><bool><istrue value="${execute}"/></bool>
713 <echo level="info">setting gdbm installed path stage 1</echo>
714 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cat ${mac.release.dir}/greenstone3/build.properties | sed 's@^gdbm.installed.path=/Users/kjdon/gdbm-1.8.3@gdbm.installed.path=@g' > ${mac.release.dir}/greenstone3/build.properties.tmp" /></exec>
715
716 <echo level="info">setting gdbm installed path stage 2</echo>
717 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cat ${mac.release.dir}/greenstone3/build.properties.tmp | sed 's@^gdbm.installed.path=@gdbm.installed.path=/Users/kjdon/gdbm-1.8.3@g' > ${mac.release.dir}/greenstone3/build.properties" /></exec>
718 </if>
719 </target>
720
721 <target name="mac-prepare-unix">
722 <if><bool><istrue value="${execute}"/></bool>
723 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cd ${mac.release.dir}/greenstone3; PATH=$PATH:/usr/local/bin JAVA_HOME=/Library/Java/Home ant -f dist-resources/dist-build.xml -Dapp.version=${version} prepare-unix" /></exec>
724 </if>
725 </target>
726
727 <target name="mac-update-unix">
728 <if><bool><istrue value="${execute}"/></bool>
729 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cd ${mac.release.dir}/greenstone3; PATH=$PATH:/usr/local/bin JAVA_HOME=/Library/Java/Home ant -f dist-resources/dist-build.xml -Dapp.version=${version} update-unix" /></exec>
730 </if>
731 </target>
732
733 <target name="mac-configure-unix">
734 <if><bool><istrue value="${execute}"/></bool>
735 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cd ${mac.release.dir}/greenstone3; PATH=$PATH:/usr/local/bin JAVA_HOME=/Library/Java/Home ant -f dist-resources/dist-build.xml -Dapp.version=${version} configure-unix" /></exec>
736 </if>
737 </target>
738
739 <target name="mac-tweak-makefiles">
740 <if><bool><istrue value="${execute}"/></bool>
741 <echo level="info">tweak ${mac.release.dir}/greenstone3/gs2build/src/db2txt/Makefile</echo>
742 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle /Users/oranfry/bin/fvsr.sh ${mac.release.dir}/greenstone3/gs2build/src/db2txt/Makefile LIBS '-L/Users/kjdon/gdbm-1.8.3/lib -lgdbm' '/Users/kjdon/gdbm-1.8.3/lib/libgdbm.a'" /></exec>
743
744 <echo level="info">tweak ${mac.release.dir}/greenstone3/gs2build/src/txt2db/Makefile</echo>
745 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle /Users/oranfry/bin/fvsr.sh ${mac.release.dir}/greenstone3/gs2build/src/txt2db/Makefile LIBS '-L/Users/kjdon/gdbm-1.8.3/lib -lgdbm' '/Users/kjdon/gdbm-1.8.3/lib/libgdbm.a'" /></exec>
746
747 <echo level="info">tweak ${mac.release.dir}/greenstone3/src/packages/javagdbm/jni/Makefile</echo>
748 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle /Users/oranfry/bin/fvsr.sh ${mac.release.dir}/greenstone3/src/packages/javagdbm/jni/Makefile GDBM_LIBS '-L/Users/kjdon/gdbm-1.8.3/lib -lgdbm' '/Users/kjdon/gdbm-1.8.3/lib/libgdbm.a'" /></exec>
749 </if>
750 </target>
751
752 <target name="mac-build-unix">
753 <if><bool><istrue value="${execute}"/></bool>
754 <echo level="info">mac: ant build-unix</echo>
755 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cd ${mac.release.dir}/greenstone3; PATH=$PATH:/usr/local/bin JAVA_HOME=/Library/Java/Home ant -f dist-resources/dist-build.xml -Dapp.version=${version} build-unix" /></exec>
756 </if>
757 </target>
758
759 <target name="mac-strip-execs">
760 <if><bool><istrue value="${execute}"/></bool>
761 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cd ${mac.release.dir}/greenstone3; strip gs2build/bin/darwin/*" /></exec>
762 </if>
763 </target>
764
765 <target name="mac-grab-files">
766 <if><bool><istrue value="${execute}"/></bool>
767 <delete dir="${release.dir}/other-platforms/mac-lib-jni"/>
768 <exec executable="/usr/bin/scp"><arg line="-r ${username}@shuttle:${mac.release.dir}/greenstone3/lib/jni ${release.dir}/other-platforms/mac-lib-jni" /></exec>
769
770 <delete dir="${release.dir}/other-platforms/mac-gs2build-bin-darwin"/>
771 <exec executable="/usr/bin/scp"><arg line="-r ${username}@shuttle:${mac.release.dir}/greenstone3/gs2build/bin/darwin ${release.dir}/other-platforms/mac-gs2build-bin-darwin" /></exec>
772 </if>
773 </target>
774
775 <target name="export-greenstone3">
776 <if><bool><istrue value="${execute}"/></bool>
777 <svn>
778 <export srcurl="${svn.root}/greenstone3/${branch.path}" destPath="${release.dir}/dist/greenstone3"/>
779 </svn>
780 </if>
781 </target>
782
783 <target name="dist-set-version-number-property">
784 <if><bool><istrue value="${execute}"/></bool>
785 <rsr file="${release.dir}/dist/greenstone3/resources/java/global.properties.in" pattern="@gsdl3version@" replacement="${version}" />
786 </if>
787 </target>
788
789 <target name="create-distributions-1">
790 <if><bool><istrue value="${execute}"/></bool>
791 <ant antfile="${release.dir}/dist/greenstone3/dist-resources/dist-build.xml" dir="${release.dir}/dist/greenstone3" target="create-distribution-1" />
792 </if>
793 </target>
794
795 <target name="create-distributions-2">
796 <if><bool><istrue value="${execute}"/></bool>
797 <ant antfile="${release.dir}/dist/greenstone3/dist-resources/dist-build.xml" dir="${release.dir}/dist/greenstone3" target="create-distribution-2" />
798 </if>
799 </target>
800
801 <target name="create-distributions-3">
802 <if><bool><istrue value="${execute}"/></bool>
803 <ant antfile="${release.dir}/dist/greenstone3/dist-resources/dist-build.xml" dir="${release.dir}/dist/greenstone3" target="create-distribution-3" />
804 </if>
805 </target>
806
807 <target name="copy-over-build-xml">
808 <if><bool><istrue value="${execute}"/></bool>
809 <move file="${release.dir}/dist/greenstone3/dist-build.xml" tofile="${release.dir}/dist/greenstone3/build.xml"/>
810 </if>
811 </target>
812
813 <target name="insert-user-manual">
814 <if><bool><istrue value="${execute}"/></bool>
815 <copy file="${release.dir}/greenstone3/gsdl-manuals/manuals/build/en/pdf/User_en.pdf" tofile="${release.dir}/dist/greenstone3/docs/manual/gs2_user_en.pdf"/>
816 </if>
817 </target>
818
819 <target name="insert-compiled-binaries">
820 <if><bool><istrue value="${execute}"/></bool>
821
822 <!-- windows -->
823 <mkdir dir="${release.dir}/dist/greenstone3/Windows/lib/jni"/>
824 <exec executable="cp"><arg line="${release.dir}/other-platforms/win-lib-jni/* ${release.dir}/dist/greenstone3/Windows/lib/jni"/></exec>
825
826 <mkdir dir="${release.dir}/dist/greenstone3/gs2build/Windows/bin/windows"/>
827 <exec executable="cp"><arg line="${release.dir}/other-platforms/win-gs2build-bin-windows/* ${release.dir}/dist/greenstone3/gs2build/Windows/bin/windows"/></exec>
828
829 <!-- mac -->
830 <mkdir dir="${release.dir}/dist/greenstone3/Darwin/lib/jni"/>
831 <exec executable="cp"><arg line="${release.dir}/other-platforms/mac-lib-jni/* ${release.dir}/dist/greenstone3/Darwin/lib/jni"/></exec>
832
833 <mkdir dir="${release.dir}/dist/greenstone3/gs2build/Unix/bin/darwin"/>
834 <exec executable="cp"><arg line="${release.dir}/other-platforms/mac-gs2build-bin-darwin/* ${release.dir}/dist/greenstone3/gs2build/Unix/bin/darwin"/></exec>
835
836 <!-- linux -->
837 <mkdir dir="${release.dir}/dist/greenstone3/Linux/lib/jni"/>
838 <exec executable="cp"><arg line="${release.dir}/greenstone3/lib/jni/* ${release.dir}/dist/greenstone3/Linux/lib/jni"/></exec>
839
840 <mkdir dir="${release.dir}/dist/greenstone3/gs2build/Unix/bin/linux"/>
841 <exec executable="cp"><arg line="${release.dir}/greenstone3/gs2build/bin/linux/* ${release.dir}/dist/greenstone3/gs2build/Unix/bin/linux"/></exec>
842
843 <mkdir dir="${release.dir}/dist/greenstone3/gs2build/bin/java"/>
844 <exec executable="cp"><arg line="${release.dir}/greenstone3/gs2build/bin/java/* ${release.dir}/dist/greenstone3/gs2build/bin/java"/></exec>
845
846 </if>
847 </target>
848
849
850 <target name="source-export-greenstone3">
851 <if><bool><istrue value="${execute}"/></bool>
852 <svn>
853 <export srcurl="${svn.root}/greenstone3/${branch.path}" destPath="${release.dir}/source-dist/greenstone3"/>
854 </svn>
855 </if>
856 </target>
857
858 <target name="source-set-version-number-property">
859 <if><bool><istrue value="${execute}"/></bool>
860 <rsr file="${release.dir}/source-dist/greenstone3/resources/java/global.properties.in" pattern="@gsdl3version@" replacement="${version}" />
861 </if>
862 </target>
863
864 <target name="source-create-distribution">
865 <if><bool><istrue value="${execute}"/></bool>
866 <ant antfile="${release.dir}/source-dist/greenstone3/dist-resources/dist-build.xml" dir="${release.dir}/source-dist/greenstone3" target="create-source-distribution" />
867 </if>
868 </target>
869
870 <target name="source-copy-over-build-xml">
871 <if><bool><istrue value="${execute}"/></bool>
872 <move file="${release.dir}/source-dist/greenstone3/dist-build.xml" tofile="${release.dir}/source-dist/greenstone3/build.xml"/>
873 </if>
874 </target>
875
876 <target name="source-insert-user-manual">
877 <if><bool><istrue value="${execute}"/></bool>
878 <copy file="${release.dir}/greenstone3/gsdl-manuals/manuals/build/en/pdf/User_en.pdf" tofile="${release.dir}/source-dist/greenstone3/docs/manual/gs2_user_en.pdf"/>
879 </if>
880 </target>
881
882 <target name="source-create-archive">
883 <if><bool><istrue value="${execute}"/></bool>
884 <tar compression="gzip" destfile="${release.dir}/source-dist/greenstone-3.${version.minor}-src.tar.gz" basedir="${release.dir}/source-dist/greenstone3"/>
885 </if>
886 </target>
887
888 <!-- fourth level targets -->
889 <target name="mgpp-add-static">
890 <if><bool><istrue value="${execute}"/></bool>
891 <rsr file="${release.dir}/greenstone3/gs2build/indexers/mgpp/configure.in" pattern="^LDFLAGS=$" replacement="LDFLAGS=-static" />
892 <exec dir="${release.dir}/greenstone3/gs2build/indexers/mgpp" executable="autoconf" output="${release.dir}/greenstone3/gs2build/indexers/mgpp/configure">
893 <arg line="configure.in"/>
894 </exec>
895 </if>
896 </target>
897 <target name="mg-add-static">
898 <if><bool><istrue value="${execute}"/></bool>
899 <rsr file="${release.dir}/greenstone3/gs2build/indexers/mg/configure.in" pattern="^LDFLAGS=$" replacement="LDFLAGS=-static" />
900 <exec dir="${release.dir}/greenstone3/gs2build/indexers/mg" executable="autoconf" output="${release.dir}/greenstone3/gs2build/indexers/mg/configure">
901 <arg line="configure.in"/>
902 </exec>
903 </if>
904 </target>
905 <target name="gs2buildextra-add-static">
906 <if><bool><istrue value="${execute}"/></bool>
907 <rsr file="${release.dir}/greenstone3/gs2build/gs2build-extra/packages.configure" pattern="^ENVIRONMENT=&quot;&quot;$" replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;" />
908 <rsr file="${release.dir}/greenstone3/gs2build/gs2build-extra/configure.in" pattern="^LDFLAGS=$" replacement="LDFLAGS=-static" />
909 </if>
910 </target>
911
912 <target name="wv-add-static">
913 <if><bool><istrue value="${execute}"/></bool>
914 <rsr file="${release.dir}/greenstone3/gs2build/packages/wv/wv-gs/Makefile" pattern="^LDFLAGS =\s*$" replacement="LDFLAGS = -static" />
915 </if>
916 </target>
917 <target name="xlhtml-add-static">
918 <if><bool><istrue value="${execute}"/></bool>
919 <rsr file="${release.dir}/greenstone3/gs2build/packages/xlhtml/xlhtml-0.4.9.0/xlhtml/Makefile" pattern="^LDFLAGS =\s*$" replacement="LDFLAGS = -static" />
920 </if>
921 </target>
922 <target name="ppthtml-add-static">
923 <if><bool><istrue value="${execute}"/></bool>
924 <rsr file="${release.dir}/greenstone3/gs2build/packages/xlhtml/xlhtml-0.4.9.0/ppthtml/Makefile" pattern="^LDFLAGS =\s*$" replacement="LDFLAGS = -static" />
925 </if>
926 </target>
927 <target name="rtftohtml-add-static">
928 <if><bool><istrue value="${execute}"/></bool>
929 <rsr file="${release.dir}/greenstone3/gs2build/packages/rtftohtml/rtftohtml_src/Makefile" pattern="-o rtftohtml.{2}EXEEXT.{1}" replacement="-o rtftohtml\$(EXEEXT) -static" />
930 </if>
931 </target>
932 <target name="gdbm-add-static">
933 <if><bool><istrue value="${execute}"/></bool>
934 <rsr file="${release.dir}/greenstone3/src/packages/javagdbm/jni/Makefile" pattern="^(GDBM_LIBS)\s*=\s*(.*)-lgdbm(.*)$" replacement="$1=$2/usr/lib/libgdbm.a$3" />
935 </if>
936 </target>
937
938 <target name="create-branches">
939 <if>
940 <bool>
941 <and>
942 <isset property="branch.path" />
943 <not><equals arg1="${branch.path}" arg2=""/></not>
944 <not><equals arg1="${branch.path}" arg2="trunk"/></not>
945 </and>
946 </bool>
947 <svn>
948 <copy srcUrl="${svn.root}/greenstone3/trunk" destUrl="${svn.root}/greenstone3/${branch.path}" message="creating a branch for the ${version} release" />
949 <copy srcUrl="${svn.root}/gli/trunk" destUrl="${svn.root}/gli/${branch.path}" message="creating a branch for the ${version} release" />
950 <copy srcUrl="${svn.root}/documentation/trunk" destUrl="${svn.root}/documentation/${branch.path}" message="creating a branch for the ${version} release" />
951 <copy srcUrl="${svn.root}/indexers/trunk" destUrl="${svn.root}/indexers/${branch.path}" message="creating a branch for the ${version} release" />
952 <copy srcUrl="${svn.root}/gsdl/trunk" destUrl="${svn.root}/gsdl/${branch.path}" message="creating a branch for the ${version} release" />
953 </svn>
954 <else><fail>please set the branch.path, e.g., -Dbranch.path=branches/3.03</fail></else>
955 </if>
956 </target>
957
958</project>
Note: See TracBrowser for help on using the repository browser.