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

Last change on this file since 14677 was 14677, checked in by oranfry, 17 years ago

took out hard wired version numbers and the build directory

File size: 38.2 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.gli" value="${svn.root}/gli/${branch.path}"/>
188 <property name="svn.indexers" value="${svn.root}/indexers/${branch.path}"/>
189 <property name="svn.documentation" value="${svn.root}/documentation/${branch.path}"/>
190
191 <tempfile property="temp.file" destdir="${java.io.tmpdir}" prefix="delete" suffix=".tmp"/>
192
193 <!-- greenstone3 branch -->
194 <echo level="info">Checking that ${svn.greenstone3} exists...</echo>
195 <!-- try to put the html index of the location into the temp file -->
196 <setloglevel level="error"/>
197 <try>
198 <get src="${svn.greenstone3}" dest="${temp.file}"/>
199 <catch>
200 <echo level="error">No, it does not exist</echo>
201 <property name="svn.greenstone3.unavailable" value="true"/>
202 </catch>
203 </try>
204 <setloglevel level="info"/>
205 <if>
206 <bool><not><istrue value="${svn.greenstone3.unavailable}"/></not></bool>
207 <echo level="info">Yes, it exists</echo>
208 </if>
209
210 <!-- gli branch -->
211 <echo level="info">Checking that ${svn.gli} exists...</echo>
212 <!-- try to put the html index of the location into the temp file -->
213 <setloglevel level="error"/>
214 <try>
215 <get src="${svn.gli}" dest="${temp.file}"/>
216 <catch>
217 <echo level="error">No, does not exist</echo>
218 <property name="svn.gli.unavailable" value="true"/>
219 </catch>
220 </try>
221 <setloglevel level="info"/>
222 <if>
223 <bool><not><istrue value="${svn.gli.unavailable}"/></not></bool>
224 <echo level="info">Yes, it exists</echo>
225 </if>
226
227
228 <!-- indexers branch -->
229 <echo level="info">Checking that ${svn.indexers} 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.indexers}" dest="${temp.file}"/>
234 <catch>
235 <echo level="error">No, it does not exist</echo>
236 <property name="svn.indexers.unavailable" value="true"/>
237 </catch>
238 </try>
239 <setloglevel level="info"/>
240 <if>
241 <bool><not><istrue value="${svn.indexers.unavailable}"/></not></bool>
242 <echo level="info">Yes, it exists</echo>
243 </if>
244
245 <!-- documentation branch -->
246 <echo level="info">Checking that ${svn.documentation} exists...</echo>
247 <!-- try to put the html index of the location into the temp file -->
248 <setloglevel level="error"/>
249 <try>
250 <get src="${svn.documentation}" dest="${temp.file}"/>
251 <catch>
252 <echo level="error">No, it does not exist</echo>
253 <property name="svn.documentation.unavailable" value="true"/>
254 </catch>
255 </try>
256 <setloglevel level="info"/>
257 <if>
258 <bool><not><istrue value="${svn.documentation.unavailable}"/></not></bool>
259 <echo level="info">Yes, it exists</echo>
260 </if>
261
262
263 <!-- clean up the temp file -->
264 <setloglevel level="error"/>
265 <delete file="${temp.file}"/>
266 <setloglevel level="info"/>
267
268
269 <!-- fail if some branches were missing -->
270 <if>
271 <bool>
272 <or>
273 <istrue value="${svn.greenstone3.unavailable}"/>
274 <istrue value="${svn.gli.unavailable}"/>
275 <istrue value="${svn.indexers.unavailable}"/>
276 <istrue value="${svn.documentation.unavailable}"/>
277 </or>
278 </bool>
279 <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>
280 <else>
281 <echo level="info">All exist</echo>
282 </else>
283 </if>
284
285 </target>
286
287 <target name="help">
288
289 <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>
290 <echo level="info"/>
291
292 <echo level="info">This project creates releases of Greenstone3 from the subversion repository given a version number.</echo>
293 <echo level="info"/>
294
295 <echo level="info">Each target in this project's target tree has been given an address, like so:</echo>
296 <echo level="info"/>
297 <echo level="info">root</echo>
298 <echo level="info"> |-1</echo>
299 <echo level="info"> | |-1.1</echo>
300 <echo level="info"> | |-1.2</echo>
301 <echo level="info"> |</echo>
302 <echo level="info"> |-2</echo>
303 <echo level="info"> | |-2.1</echo>
304 <echo level="info"> | |-2.2</echo>
305 <echo level="info"> etc.</echo>
306
307 <echo level="info"/>
308
309
310 <echo level="info">PARAMETERS</echo>
311 <echo level="info">Parameters are specifiable on the command line or in build.properties</echo>
312 <echo level="info">Parameters which remain static throughout the release process should be stores in build.properties:</echo>
313 <echo level="info">version, version.minor, release.dir, mac.release.dir, windows.release.dir, username</echo>
314 <echo level="info">Other parameters will change each time you invoke the script, specify them on the command line:</echo>
315 <echo level="info">resume.from, resume.mode</echo>
316
317
318
319 <echo level="info"/>
320
321 <echo level="info">version=VERSION_NUMBER, where VERSION_NUMBER={x.xx|trunk}</echo>
322 <echo level="info"/>
323 <echo level="info">This project can either create a release from a greenstone3 branch, or from the development trunk.</echo>
324 <echo level="info">To create a branch release, specify the VERSION_NUMBER (e.g., 3.03), and ensure that the following</echo>
325 <echo level="info">branches exist in the repository:</echo>
326 <echo level="info"> greenstone3/branches/VERSION_NUMBER</echo>
327 <echo level="info"> gli/branches/VERSION_NUMBER</echo>
328 <echo level="info"> indexers/branches/VERSION_NUMBER</echo>
329 <echo level="info"> documentation/branches/VERSION_NUMBER</echo>
330 <echo level="info">To create a trunk release, specify 'trunk' as the version number.</echo>
331 <echo level="info">The project will use the trunk of greenstone3, gli, indexers and documentation for the release.</echo>
332 <echo level="info"/>
333 <echo level="info"/>
334
335 <echo level="info">release.dir=RELEASE_DIRECTORY</echo>
336 <echo level="info"/>
337 <echo level="info">Specifies the directory in the filesystem where the release files will be kept.</echo>
338 <echo level="info"/>
339 <echo level="info"/>
340
341 <echo level="info">resume.from=TARGET_ADDRESS, where TARGET_ADDRESS=x.y.z (e.g., 2.1.3)</echo>
342 <echo level="info"/>
343 <echo level="info">Allows you to specify a target address from which execution will resume.</echo>
344 <echo level="info">This is helpful for restarting the script after it has failed part-way through.</echo>
345 <echo level="info">By default, execution starts from the root target (create-release) and proceeds downwards.</echo>
346 <echo level="info">You can specify a different target to start from by setting the resume.from parameter.</echo>
347 <echo level="info"/>
348 <echo level="info"/>
349
350 <echo level="info">resume.mode=RESUME_MODE, where RESUME_MODE={fallthrough|descend}</echo>
351 <echo level="info"/>
352 <echo level="info">fallthrough (default): In fallthrough mode, execution proceeds downwards through the target tree</echo>
353 <echo level="info">1 -> 1.1 -> 1.2 -> 2 -> 2.1 -> 2.2 -> 3 -> 3.1 and so on.</echo>
354 <echo level="info">descend: In descend mode, execution descends a single branch of the target tree.</echo>
355 <echo level="info">For example, if resume.from was set to '2', execution would proceed thus:</echo>
356 <echo level="info">2 -> 2.1 -> 2.2 (exit)</echo>
357 <echo level="info">This is helpful when you want to debug a particular target, or fix some conditions to allow it to finish</echo>
358 <echo level="info">properly, and don't want to run the whole script from the start.</echo>
359 <echo level="info"/>
360 <echo level="info"/>
361
362 <echo level="info">release.dir, mac.release.dir, windows.release.dir</echo>
363 <echo level="info"/>
364 <echo level="info">The full path to the directories where release files will be stored on</echo>
365 <echo level="info">linux(your machine), mac(shuttle) and windows(kohekohe).</echo>
366 <echo level="info">E.g., -Drelease.dir=/research/oranfry/releases/3.03</echo>
367 <echo level="info">E.g., -Dmac.release.dir=/Users/oranfry/releases/3.03</echo>
368 <echo level="info">E.g., -Dwindows.release.dir=c:\\research\\oranfry\\releases\\3.03</echo>
369 <echo level="info"/>
370 <echo level="info"/>
371
372 <echo level="info">username</echo>
373 <echo level="info"/>
374 <echo level="info">Your username for ssh from your machine to shuttle and kohekohe.</echo>
375 <echo level="info">You will be prompted for your password a number of times while the script executes.</echo>
376 <echo level="info"/>
377 <echo level="info"/>
378
379
380 </target>
381
382
383
384
385 <!-- ADDRESSED TARGETS -->
386
387 <!-- root target -->
388 <target name="create-release" depends="init">
389 <echo>Creating Release '${version}'</echo>
390 <addressedcall target="prep"/>
391 <addressedcall target="compile-binaries"/>
392 <addressedcall target="create-distribution"/>
393 <addressedcall target="create-source-distribution"/>
394 <addressedcall target="compile-documentation"/>
395 <addressedcall target="create-installer-project"/>
396 <addressedcall target="build-installers"/>
397 <addressedcall target="aggregate-release-files"/>
398 </target>
399
400 <!-- first level targets -->
401 <target name="prep">
402 <addressedcall target="create-dir-structure" />
403 </target>
404
405 <target name="compile-binaries">
406 <addressedcall target="linux" />
407 <addressedcall target="windows" />
408 <addressedcall target="mac" />
409 </target>
410
411 <target name="create-distribution">
412 <!-- create distribution -->
413 <addressedcall target="export-greenstone3" />
414 <addressedcall target="create-distributions-1" />
415 <addressedcall target="create-distributions-2" />
416 <addressedcall target="create-distributions-3" />
417 <addressedcall target="copy-over-build-xml" />
418 <addressedcall target="insert-user-manual"/>
419 <addressedcall target="insert-compiled-binaries"/>
420 </target>
421
422 <target name="create-source-distribution">
423 <!-- create distribution -->
424 <addressedcall target="source-export-greenstone3" />
425 <addressedcall target="source-create-distribution" />
426 <addressedcall target="source-copy-over-build-xml" />
427 <addressedcall target="source-insert-user-manual"/>
428 <addressedcall target="source-create-archive"/>
429 </target>
430
431 <target name="compile-documentation">
432 <!-- compile documentation -->
433 </target>
434
435 <target name="create-installer-project">
436 <if><bool><istrue value="${execute}"/></bool>
437
438 <copy overwrite="true" todir="${release.dir}/installer">
439 <fileset dir="/home/nzdl/for-distributions/installers"><include name="greenstone3/**"/></fileset>
440 </copy>
441
442 <!-- Edit the <installer-dir>/greenstone3/Greenstone3 Digital Library Software.uip file and change any absolute paths as needed. Make sure you change all paths. -->
443 <copy overwrite="true" file="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip.template" tofile="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip" />
444 <rsr file="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip" pattern="@release\.dir@" replacement="${release.dir}" />
445 <rsr file="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip" pattern="@version\.minor@" replacement="${version.minor}" />
446
447 <if>
448 <bool><equals arg1="${version}" arg2="trunk"/></bool>
449 <rsr file="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip" pattern="@version@" replacement="trunk" />
450 <else>
451 <rsr file="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip" pattern="@version@" replacement="v${version}" />
452 </else>
453 </if>
454
455 </if>
456 </target>
457
458 <target name="build-installers">
459 <if><bool><istrue value="${execute}"/></bool>
460
461 <!-- linux -->
462 <exec dir="${release.dir}/installer/greenstone3" executable="/home/nzdl/installshieldX/InstallShieldUniversalCommandLineBuild">
463 <arg value="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip" />
464 <arg value="-build" />
465 <arg value="Linux Distribution" />
466 </exec>
467
468 <!-- windows -->
469 <exec dir="${release.dir}/installer/greenstone3" executable="/home/nzdl/installshieldX/InstallShieldUniversalCommandLineBuild">
470 <arg value="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip" />
471 <arg value="-build" />
472 <arg value="Windows Distribution" />
473 </exec>
474
475 <!-- mac -->
476 <exec dir="${release.dir}/installer/greenstone3" executable="/home/nzdl/installshieldX/InstallShieldUniversalCommandLineBuild">
477 <arg value="${release.dir}/installer/greenstone3/Greenstone3 Digital Library Software.uip" />
478 <arg value="-build" />
479 <arg value="Mac OS X Distribution" />
480 </exec>
481
482 </if>
483 </target>
484
485 <target name="aggregate-release-files">
486 <if><bool><istrue value="${execute}"/></bool>
487 <delete dir="${release.dir}/gs3-${version}-release" />
488 <mkdir dir="${release.dir}/gs3-${version}-release" />
489 <copy file="${release.dir}/installer/greenstone3/linux-distribution/disk1/setupLinux.bin" tofile="${release.dir}/gs3-${version}-release/greenstone-3.${version.minor}-linux.bin" />
490 <copy file="${release.dir}/installer/greenstone3/macOSx-distribution/disk1/setupMac.command" tofile="${release.dir}/gs3-${version}-release/greenstone-3.${version.minor}-macOSx.command" />
491 <copy file="${release.dir}/installer/greenstone3/windows-distribution/disk1/setupwin32.exe" tofile="${release.dir}/gs3-${version}-release/greenstone-3.${version.minor}-win32.exe" />
492 <copy file="${release.dir}/source-dist/greenstone-3.${version.minor}-src.tar.gz" todir="${release.dir}/gs3-${version}-release" />
493 </if>
494 </target>
495
496
497 <!-- second level targets -->
498 <target name="create-dir-structure">
499 <if><bool><istrue value="${execute}"/></bool>
500 <mkdir dir="${release.dir}" />
501 <mkdir dir="${release.dir}/other-platforms" />
502 <mkdir dir="${release.dir}/dist" />
503 <mkdir dir="${release.dir}/source-dist" />
504 <mkdir dir="${release.dir}/installer" />
505 </if>
506 </target>
507
508
509 <target name="linux">
510 <!-- preparation -->
511 <addressedcall target="checkout-greenstone3" />
512 <addressedcall target="dist-prepare-unix" />
513 <addressedcall target="tweak-configure-scripts" />
514 <!-- update -->
515 <addressedcall target="dist-update-unix" />
516 <!-- configure -->
517 <addressedcall target="dist-configure-unix" />
518 <addressedcall target="tweak-makefiles" />
519 <!-- build -->
520 <addressedcall target="dist-build-unix" />
521 <addressedcall target="fix-wget" />
522 <addressedcall target="linux-strip-execs" />
523
524 <!-- documentation -->
525 <addressedcall target="prepare-documentation" />
526 </target>
527
528 <target name="mac">
529 <!-- preparation -->
530 <addressedcall target="mac-checkout-greenstone3" />
531 <addressedcall target="mac-set-gdbm-path" />
532
533 <addressedcall target="mac-prepare-unix" />
534 <!-- update -->
535 <addressedcall target="mac-update-unix" />
536 <!-- configure -->
537 <addressedcall target="mac-configure-unix" />
538 <addressedcall target="mac-tweak-makefiles" />
539 <!-- build -->
540 <addressedcall target="mac-build-unix" />
541 <addressedcall target="mac-strip-execs" />
542
543 <!-- grab the files -->
544 <addressedcall target="mac-grab-files" />
545 </target>
546
547
548 <target name="windows">
549 <if><bool><istrue value="${execute}"/></bool>
550
551 <mkdir dir="${release.dir}/other-platforms/win-gs2build-bin-windows"/>
552 <mkdir dir="${release.dir}/other-platforms/win-lib-jni"/>
553
554 <echo level="info">The windows compilation stage still has to be done manually.</echo>
555 <echo level="info">Please go to the kohekohe machine and follow the instructions found at:</echo>
556 <echo level="info">http://wesson.cs.waikato.ac.nz:7070/wiki/index.php/Creating_A_GS3_Release#Windows</echo>
557 <echo level="info">Do the 'Preparation' and 'Update and Build' sections</echo>
558 <echo level="info"/>
559
560 <echo level="info">Then copy (scp):</echo>
561 <echo level="info">Windows:greenstone3/lib/jni/* to Linux:${release.dir}/other-platforms/win-lib-jni</echo>
562 <echo level="info">Windows:greenstone3/gs2build/bin/windows/* to Linux:${release.dir}/other-platforms/win-gs2build-bin-windows</echo>
563 <echo level="info"/>
564 <input addproperty="windows.compilation.done" validargs="done">Type 'done' when you have finished.</input>
565
566 </if>
567 </target>
568
569 <!-- third level targets -->
570 <target name="checkout-greenstone3">
571 <if><bool><istrue value="${execute}"/></bool>
572 <svn>
573 <checkout url="${svn.root}/greenstone3/${branch.path}" destPath="${release.dir}/greenstone3"/>
574 </svn>
575 </if>
576 </target>
577
578 <target name="dist-prepare-unix">
579 <if><bool><istrue value="${execute}"/></bool>
580 <ant antfile="${release.dir}/greenstone3/dist-resources/dist-build.xml" dir="${release.dir}/greenstone3" target="prepare-unix" />
581 </if>
582 </target>
583 <target name="tweak-configure-scripts">
584 <addressedcall target="mgpp-add-static" />
585 <addressedcall target="mg-add-static" />
586 <addressedcall target="gs2buildextra-add-static" />
587 </target>
588
589 <target name="dist-update-unix">
590 <if><bool><istrue value="${execute}"/></bool>
591 <ant antfile="${release.dir}/greenstone3/dist-resources/dist-build.xml" dir="${release.dir}/greenstone3" target="update-unix" />
592 </if>
593 </target>
594
595 <target name="dist-configure-unix">
596 <if><bool><istrue value="${execute}"/></bool>
597 <exec dir="${release.dir}/greenstone3/gs2build/gs2build-extra" executable="autoconf" output="${release.dir}/greenstone3/gs2build/configure">
598 <arg line="configure.in"/>
599 </exec>
600 <chmod file="${release.dir}/greenstone3/gs2build/configure" perm="+x"/>
601 <ant antfile="${release.dir}/greenstone3/dist-resources/dist-build.xml" dir="${release.dir}/greenstone3" target="configure-unix" />
602 </if>
603 </target>
604
605 <target name="tweak-makefiles">
606 <addressedcall target="wv-add-static" />
607 <addressedcall target="xlhtml-add-static" />
608 <addressedcall target="ppthtml-add-static" />
609 <addressedcall target="rtftohtml-add-static" />
610 <addressedcall target="gdbm-add-static" />
611 </target>
612
613 <target name="dist-build-unix">
614 <if><bool><istrue value="${execute}"/></bool>
615 <ant antfile="${release.dir}/greenstone3/dist-resources/dist-build.xml" dir="${release.dir}/greenstone3" target="build-unix" />
616 </if>
617 </target>
618
619 <target name="fix-wget">
620 <if><bool><istrue value="${execute}"/></bool>
621 <!-- fix this !!! -->
622 <delete file="${release.dir}/greenstone3/gs2build/packages/wget/wget-1.9/src/wget"/>
623 </if>
624 </target>
625
626 <target name="linux-strip-execs">
627 <if><bool><istrue value="${execute}"/></bool>
628 <exec dir="${release.dir}/greenstone3/gs2build/bin/linux" executable="find">
629 <arg line="! -name . -exec strip {} &#59;"/>
630 </exec>
631 </if>
632 </target>
633
634 <target name="prepare-documentation">
635 <if><bool><istrue value="${execute}"/></bool>
636 <mkdir dir="${release.dir}/greenstone3/gsdl-manuals"/>
637 <svn>
638 <checkout url="${svn.root}/documentation/${branch.path}/manuals" destPath="${release.dir}/greenstone3/gsdl-manuals/manuals"/>
639 <checkout url="${svn.root}/documentation/${branch.path}/shared" destPath="${release.dir}/greenstone3/gsdl-manuals/shared"/>
640 </svn>
641 <javac srcdir="${release.dir}/greenstone3/gsdl-manuals/shared"
642 destdir="${release.dir}/greenstone3/gsdl-manuals/shared"
643 debug="on">
644 <include name="*.java"/>
645 </javac>
646 <unzip src="${release.dir}/greenstone3/gsdl-manuals/shared/fop.zip" dest="${release.dir}/greenstone3/gsdl-manuals/shared"/>
647
648 <!-- classpath -->
649 <path id="documentation.compile.classpath">
650 <fileset dir="${release.dir}/greenstone3/gsdl-manuals">
651 <include name="**/*.jar"/>
652 </fileset>
653 <pathelement path="${release.dir}/greenstone3/gsdl-manuals/shared"/>
654 <pathelement path="${release.dir}/greenstone3/gsdl-manuals/manuals"/>
655 </path>
656
657 <java classname="ApplyXSLT" classpathref="documentation.compile.classpath" output="${release.dir}/greenstone3/gsdl-manuals/manuals/xml-source/en/help-en.xml">
658 <arg value="${release.dir}/greenstone3/gsdl-manuals/manuals/processing/gen-gli-help-to-manual-chapter.xsl" />
659 <arg value="${release.dir}/greenstone3/gli/help/en/help.xml" />
660 <arg value="${release.dir}/greenstone3" />
661 </java>
662
663 <chmod perm="a+x" file="${release.dir}/greenstone3/gsdl-manuals/shared/fop/fop.sh"/>
664 <exec dir="${release.dir}/greenstone3/gsdl-manuals/manuals" executable="${release.dir}/greenstone3/gsdl-manuals/manuals/generate-pdf.sh">
665 <arg line="u en" />
666 </exec>
667
668 </if>
669 </target>
670
671 <target name="mac-checkout-greenstone3">
672 <if><bool><istrue value="${execute}"/></bool>
673 <echo level="info">create release directory, if absent</echo>
674 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle if [ ! -e ${mac.release.dir} ]; then mkdir ${mac.release.dir}; fi" /></exec>
675
676 <echo level="info">checkout greenstone3</echo>
677 <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>
678 </if>
679 </target>
680
681 <target name="mac-set-gdbm-path">
682 <if><bool><istrue value="${execute}"/></bool>
683 <echo level="info">setting gdbm installed path stage 1</echo>
684 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cat ${mac.release.dir}/greenstone3/build.properties | sed 's@^gdbm.installed.path=/Users/kjdon/[email protected]=@g' > ${mac.release.dir}/greenstone3/build.properties.tmp" /></exec>
685
686 <echo level="info">setting gdbm installed path stage 2</echo>
687 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cat ${mac.release.dir}/greenstone3/build.properties.tmp | sed 's@^[email protected]=/Users/kjdon/gdbm-1.8.3@g' > ${mac.release.dir}/greenstone3/build.properties" /></exec>
688 </if>
689 </target>
690
691 <target name="mac-prepare-unix">
692 <if><bool><istrue value="${execute}"/></bool>
693 <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>
694 </if>
695 </target>
696
697 <target name="mac-update-unix">
698 <if><bool><istrue value="${execute}"/></bool>
699 <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>
700 </if>
701 </target>
702
703 <target name="mac-configure-unix">
704 <if><bool><istrue value="${execute}"/></bool>
705 <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>
706 </if>
707 </target>
708
709 <target name="mac-tweak-makefiles">
710 <if><bool><istrue value="${execute}"/></bool>
711 <echo level="info">tweak ${mac.release.dir}/greenstone3/gs2build/src/db2txt/Makefile</echo>
712 <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>
713
714 <echo level="info">tweak ${mac.release.dir}/greenstone3/gs2build/src/txt2db/Makefile</echo>
715 <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>
716
717 <echo level="info">tweak ${mac.release.dir}/greenstone3/src/packages/javagdbm/jni/Makefile</echo>
718 <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>
719 </if>
720 </target>
721
722 <target name="mac-build-unix">
723 <if><bool><istrue value="${execute}"/></bool>
724 <echo level="info">mac: ant build-unix</echo>
725 <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>
726 </if>
727 </target>
728
729 <target name="mac-strip-execs">
730 <if><bool><istrue value="${execute}"/></bool>
731 <exec executable="/usr/bin/ssh"><arg line="${username}:${password}@shuttle cd ${mac.release.dir}/greenstone3; strip gs2build/bin/darwin/*" /></exec>
732 </if>
733 </target>
734
735 <target name="mac-grab-files">
736 <if><bool><istrue value="${execute}"/></bool>
737 <delete dir="${release.dir}/other-platforms/mac-lib-jni"/>
738 <exec executable="/usr/bin/scp"><arg line="-r ${username}@shuttle:${mac.release.dir}/greenstone3/lib/jni ${release.dir}/other-platforms/mac-lib-jni" /></exec>
739
740 <delete dir="${release.dir}/other-platforms/mac-gs2build-bin-darwin"/>
741 <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>
742 </if>
743 </target>
744
745 <target name="export-greenstone3">
746 <if><bool><istrue value="${execute}"/></bool>
747 <svn>
748 <export srcurl="${svn.root}/greenstone3/${branch.path}" destPath="${release.dir}/dist/greenstone3"/>
749 </svn>
750 </if>
751 </target>
752
753 <target name="create-distributions-1">
754 <if><bool><istrue value="${execute}"/></bool>
755 <ant antfile="${release.dir}/dist/greenstone3/dist-resources/dist-build.xml" dir="${release.dir}/dist/greenstone3" target="create-distribution-1" />
756 </if>
757 </target>
758
759 <target name="create-distributions-2">
760 <if><bool><istrue value="${execute}"/></bool>
761 <ant antfile="${release.dir}/dist/greenstone3/dist-resources/dist-build.xml" dir="${release.dir}/dist/greenstone3" target="create-distribution-2" />
762 </if>
763 </target>
764
765 <target name="create-distributions-3">
766 <if><bool><istrue value="${execute}"/></bool>
767 <ant antfile="${release.dir}/dist/greenstone3/dist-resources/dist-build.xml" dir="${release.dir}/dist/greenstone3" target="create-distribution-3" />
768 </if>
769 </target>
770
771 <target name="copy-over-build-xml">
772 <if><bool><istrue value="${execute}"/></bool>
773 <move file="${release.dir}/dist/greenstone3/dist-build.xml" tofile="${release.dir}/dist/greenstone3/build.xml"/>
774 </if>
775 </target>
776
777 <target name="insert-user-manual">
778 <if><bool><istrue value="${execute}"/></bool>
779 <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"/>
780 </if>
781 </target>
782
783 <target name="insert-compiled-binaries">
784 <if><bool><istrue value="${execute}"/></bool>
785
786 <!-- windows -->
787 <copy todir="${release.dir}/dist/greenstone3/Windows/lib/jni">
788 <fileset dir="${release.dir}/other-platforms/win-lib-jni" />
789 </copy>
790 <copy todir="${release.dir}/dist/greenstone3/gs2build/Windows/bin/windows">
791 <fileset dir="${release.dir}/other-platforms/win-gs2build-bin-windows" />
792 </copy>
793
794 <!-- mac -->
795 <copy todir="${release.dir}/dist/greenstone3/gs2build/Unix/bin/darwin">
796 <fileset dir="${release.dir}/other-platforms/mac-gs2build-bin-darwin" />
797 </copy>
798 <copy todir="${release.dir}/dist/greenstone3/Darwin/lib/jni">
799 <fileset dir="${release.dir}/other-platforms/mac-lib-jni" />
800 </copy>
801
802 <!-- linux -->
803 <copy todir="${release.dir}/dist/greenstone3/Linux/lib/jni">
804 <fileset dir="${release.dir}/greenstone3/lib/jni" />
805 </copy>
806 <copy todir="${release.dir}/dist/greenstone3/gs2build/Unix/bin/linux">
807 <fileset dir="${release.dir}/greenstone3/gs2build/bin/linux" />
808 </copy>
809 <copy todir="${release.dir}/dist/greenstone3/gs2build/bin/java">
810 <fileset dir="${release.dir}/greenstone3/gs2build/bin/java" />
811 </copy>
812
813 </if>
814 </target>
815
816
817 <target name="source-export-greenstone3">
818 <if><bool><istrue value="${execute}"/></bool>
819 <svn>
820 <export srcurl="${svn.root}/greenstone3/${branch.path}" destPath="${release.dir}/source-dist/greenstone3"/>
821 </svn>
822 </if>
823 </target>
824
825 <target name="source-create-distribution">
826 <if><bool><istrue value="${execute}"/></bool>
827 <ant antfile="${release.dir}/source-dist/greenstone3/dist-resources/dist-build.xml" dir="${release.dir}/source-dist/greenstone3" target="create-source-distribution" />
828 </if>
829 </target>
830
831 <target name="source-copy-over-build-xml">
832 <if><bool><istrue value="${execute}"/></bool>
833 <move file="${release.dir}/source-dist/greenstone3/dist-build.xml" tofile="${release.dir}/source-dist/greenstone3/build.xml"/>
834 </if>
835 </target>
836
837 <target name="source-insert-user-manual">
838 <if><bool><istrue value="${execute}"/></bool>
839 <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"/>
840 </if>
841 </target>
842
843 <target name="source-create-archive">
844 <if><bool><istrue value="${execute}"/></bool>
845 <tar compression="gzip" destfile="${release.dir}/source-dist/greenstone-3.${version.minor}-src.tar.gz" basedir="${release.dir}/source-dist/greenstone3"/>
846 </if>
847 </target>
848
849 <!-- fourth level targets -->
850 <target name="mgpp-add-static">
851 <if><bool><istrue value="${execute}"/></bool>
852 <rsr file="${release.dir}/greenstone3/gs2build/indexers/mgpp/configure.in" pattern="^LDFLAGS=$" replacement="LDFLAGS=-static" />
853 <exec dir="${release.dir}/greenstone3/gs2build/indexers/mgpp" executable="autoconf" output="${release.dir}/greenstone3/gs2build/indexers/mgpp/configure">
854 <arg line="configure.in"/>
855 </exec>
856 </if>
857 </target>
858 <target name="mg-add-static">
859 <if><bool><istrue value="${execute}"/></bool>
860 <rsr file="${release.dir}/greenstone3/gs2build/indexers/mg/configure.in" pattern="^LDFLAGS=$" replacement="LDFLAGS=-static" />
861 <exec dir="${release.dir}/greenstone3/gs2build/indexers/mg" executable="autoconf" output="${release.dir}/greenstone3/gs2build/indexers/mg/configure">
862 <arg line="configure.in"/>
863 </exec>
864 </if>
865 </target>
866 <target name="gs2buildextra-add-static">
867 <if><bool><istrue value="${execute}"/></bool>
868 <rsr file="${release.dir}/greenstone3/gs2build/gs2build-extra/packages.configure" pattern="^ENVIRONMENT=&quot;&quot;$" replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;" />
869 <rsr file="${release.dir}/greenstone3/gs2build/gs2build-extra/configure.in" pattern="^LDFLAGS=$" replacement="LDFLAGS=-static" />
870 </if>
871 </target>
872
873 <target name="wv-add-static">
874 <if><bool><istrue value="${execute}"/></bool>
875 <rsr file="${release.dir}/greenstone3/gs2build/packages/wv/wv-gs/Makefile" pattern="^LDFLAGS =\s*$" replacement="LDFLAGS = -static" />
876 </if>
877 </target>
878 <target name="xlhtml-add-static">
879 <if><bool><istrue value="${execute}"/></bool>
880 <rsr file="${release.dir}/greenstone3/gs2build/packages/xlhtml/xlhtml-0.4.9.0/xlhtml/Makefile" pattern="^LDFLAGS =\s*$" replacement="LDFLAGS = -static" />
881 </if>
882 </target>
883 <target name="ppthtml-add-static">
884 <if><bool><istrue value="${execute}"/></bool>
885 <rsr file="${release.dir}/greenstone3/gs2build/packages/xlhtml/xlhtml-0.4.9.0/ppthtml/Makefile" pattern="^LDFLAGS =\s*$" replacement="LDFLAGS = -static" />
886 </if>
887 </target>
888 <target name="rtftohtml-add-static">
889 <if><bool><istrue value="${execute}"/></bool>
890 <rsr file="${release.dir}/greenstone3/gs2build/packages/rtftohtml/rtftohtml_src/Makefile" pattern="-o rtftohtml.{2}EXEEXT.{1}" replacement="-o rtftohtml\$(EXEEXT) -static" />
891 </if>
892 </target>
893 <target name="gdbm-add-static">
894 <if><bool><istrue value="${execute}"/></bool>
895 <rsr file="${release.dir}/greenstone3/src/packages/javagdbm/jni/Makefile" pattern="^(GDBM_LIBS)\s*=\s*(.*)-lgdbm(.*)$" replacement="$1=$2/usr/lib/libgdbm.a$3" />
896 </if>
897 </target>
898
899 <target name="create-branches">
900 <if>
901 <bool>
902 <and>
903 <not><equals arg1="${branch.path}" arg2=""/></not>
904 <not><equals arg1="${branch.path}" arg2="trunk"/></not>
905 </and>
906 </bool>
907 <svn>
908 <copy srcUrl="${svn.root}/greenstone3/trunk" destUrl="${svn.root}/greenstone3/${branch.path}" message="creating a branch for the ${version} release" />
909 <copy srcUrl="${svn.root}/gli/trunk" destUrl="${svn.root}/gli/${branch.path}" message="creating a branch for the ${version} release" />
910 <copy srcUrl="${svn.root}/documentation/trunk" destUrl="${svn.root}/documentation/${branch.path}" message="creating a branch for the ${version} release" />
911 <copy srcUrl="${svn.root}/indexers/trunk" destUrl="${svn.root}/indexers/${branch.path}" message="creating a branch for the ${version} release" />
912 <copy srcUrl="${svn.root}/gsdl/trunk" destUrl="${svn.root}/gsdl/${branch.path}" message="creating a branch for the ${version} release" />
913 </svn>
914 </if>
915 </target>
916
917</project>
Note: See TracBrowser for help on using the repository browser.