1 | <?xml version="1.0" encoding="utf-8" ?>
|
---|
2 | <project name="lirk2-create-distribution" default="create-distribution">
|
---|
3 |
|
---|
4 |
|
---|
5 | <target name="create-distribution">
|
---|
6 | <addressedcall target="export-gsdl-gli-indexers" />
|
---|
7 | <addressedcall target="dist-set-version" />
|
---|
8 | <addressedcall target="dist-set-gli-version" />
|
---|
9 | <addressedcall target="drop-in-binaries" />
|
---|
10 | <addressedcall target="drop-in-demo-collection" />
|
---|
11 | <addressedcall target="drop-in-docs" />
|
---|
12 | <addressedcall target="compile-gli" />
|
---|
13 | <addressedcall target="create-gli-client-zip" />
|
---|
14 | <addressedcall target="tweak-files" />
|
---|
15 |
|
---|
16 | </target>
|
---|
17 |
|
---|
18 | <target name="export-gsdl-gli-indexers">
|
---|
19 | <if><bool><istrue value="${execute}"/></bool>
|
---|
20 |
|
---|
21 | <mkdir dir="distributions"/>
|
---|
22 | <delete dir="distributions/web"/>
|
---|
23 | <svn>
|
---|
24 | <export srcurl="${svn.root}/gsdl/${branch.path}" destPath="distributions/web"/>
|
---|
25 | <export srcurl="${svn.root}/gli/${branch.path}" destPath="distributions/web/gli"/>
|
---|
26 | <export srcurl="${svn.root}/indexers/${branch.path}" destPath="distributions/web/indexers"/>
|
---|
27 | </svn>
|
---|
28 |
|
---|
29 | </if>
|
---|
30 | </target>
|
---|
31 |
|
---|
32 | <target name="dist-set-version">
|
---|
33 | <if><bool><istrue value="${execute}"/></bool>
|
---|
34 |
|
---|
35 | <echo level="info">Setting version in src/lib/gsdlconf.h</echo>
|
---|
36 | <rsr file="${basedir}/distributions/web/src/lib/gsdlconf.h" pattern="(#define GSDL_VERSION) ".*"" replacement="$1 "${version}"" />
|
---|
37 |
|
---|
38 | <echo level="info">Setting version in Install.sh</echo>
|
---|
39 | <rsr file="${basedir}/distributions/web/Install.sh" pattern="(echo "Version: ).*(" .*)" replacement="$1${version}$2" />
|
---|
40 |
|
---|
41 | <echo level="info">Setting version in etc/VERSION</echo>
|
---|
42 | <rsr file="${basedir}/distributions/web/etc/VERSION" pattern="(gsdl version: ).*" replacement="$1${version}" />
|
---|
43 |
|
---|
44 | </if>
|
---|
45 | </target>
|
---|
46 |
|
---|
47 | <target name="dist-set-gli-version">
|
---|
48 | <if><bool><istrue value="${execute}"/></bool>
|
---|
49 | <ant antfile="${lirk2.home}/ant-scripts/shared-ant-scripts/operations-on-gli.xml" dir="${basedir}/distributions/web/gli" target="set-version-numbers"/>
|
---|
50 | </if>
|
---|
51 | </target>
|
---|
52 |
|
---|
53 | <target name="drop-in-binaries">
|
---|
54 | <if><bool><istrue value="${execute}"/></bool>
|
---|
55 | <echo level="info">Dropping compiled binaries into distribution</echo>
|
---|
56 | <delete dir="distributions/web/bin/linux" />
|
---|
57 | <exec dir="${basedir}" executable="cp"><arg line="-r gsdl/bin/linux distributions/web/bin"/></exec>
|
---|
58 | <exec dir="${basedir}" executable="cp"><arg line="gsdl/cgi-bin/library distributions/web/cgi-bin"/></exec>
|
---|
59 | <exec dir="${basedir}" executable="cp"><arg line="gsdl/cgi-bin/oaiserver distributions/web/cgi-bin"/></exec>
|
---|
60 | </if>
|
---|
61 | </target>
|
---|
62 |
|
---|
63 | <target name="drop-in-demo-collection">
|
---|
64 | <if><bool><istrue value="${execute}"/></bool>
|
---|
65 | <echo level="info">Dropping rebuilt demo collection into distribution</echo>
|
---|
66 | <delete dir="distributions/web/collect/demo" />
|
---|
67 | <exec dir="${basedir}" executable="cp"><arg line="-r gsdl/collect/demo distributions/web/collect"/></exec>
|
---|
68 | </if>
|
---|
69 | </target>
|
---|
70 |
|
---|
71 | <target name="drop-in-docs">
|
---|
72 | <if><bool><istrue value="${execute}"/></bool>
|
---|
73 | <echo level="info">Dropping gsdl docs into distribution</echo>
|
---|
74 | <copy todir="${basedir}/distributions/web" overwrite="true">
|
---|
75 | <fileset dir="${lirk2.home}/greenstone2/docs"/>
|
---|
76 | </copy>
|
---|
77 | </if>
|
---|
78 | </target>
|
---|
79 |
|
---|
80 | <target name="compile-gli">
|
---|
81 | <if><bool><istrue value="${execute}"/></bool>
|
---|
82 |
|
---|
83 | <echo>Compiling gli...</echo>
|
---|
84 | <exec dir="${basedir}/distributions/web/gli" executable="${basedir}/distributions/web/gli/makegli.sh"/>
|
---|
85 |
|
---|
86 | <echo>Creating jar...</echo>
|
---|
87 | <exec dir="${basedir}/distributions/web/gli" executable="${basedir}/distributions/web/gli/makejar.sh"/>
|
---|
88 |
|
---|
89 | <echo>Cleaning up intermediate files...</echo>
|
---|
90 | <delete dir="${basedir}/distributions/web/gli/jar"/>
|
---|
91 | <delete dir="${basedir}/distributions/web/gli/classes/org"/>
|
---|
92 |
|
---|
93 | <echo>Putting gli server jar in a better place</echo>
|
---|
94 | <exec dir="${basedir}/distributions/web" executable="mv" failonerror="true">
|
---|
95 | <arg line="gli/GLIServer.jar bin/java" />
|
---|
96 | </exec>
|
---|
97 |
|
---|
98 | </if>
|
---|
99 | </target>
|
---|
100 |
|
---|
101 | <target name="create-gli-client-zip">
|
---|
102 | <if><bool><istrue value="${execute}"/></bool>
|
---|
103 | <!--
|
---|
104 | # take a copy of GLI directory
|
---|
105 | &util::cp_r(&util::filename_cat($tmpdir, "gsdl", "gli"), $tmpdir);
|
---|
106 |
|
---|
107 | my $client_dirname = "gli-client-" . $version_num;
|
---|
108 | rename ("gli", $client_dirname);
|
---|
109 | chdir(&util::filename_cat($tmpdir, $client_dirname));
|
---|
110 |
|
---|
111 |
|
---|
112 | # delete unnecessary stuff
|
---|
113 | `rm -rf clean.* document.* gems.* gli*.sh gli*.bat make*.sh make*.bat lib src`;
|
---|
114 | # make sure permissions are ok
|
---|
115 | `chmod a+x client-gli.sh client-gli.bat`;
|
---|
116 | chdir($tmpdir);
|
---|
117 |
|
---|
118 | # zip up the client
|
---|
119 | &zip($client_dirname, $client_dirname, $tmpdir, 1);
|
---|
120 | -->
|
---|
121 | </if>
|
---|
122 | </target>
|
---|
123 |
|
---|
124 |
|
---|
125 | <target name="tweak-files">
|
---|
126 | <if><bool><istrue value="${execute}"/></bool>
|
---|
127 |
|
---|
128 | <echo level="info">Changing Install.sh to web release</echo>
|
---|
129 | <rsr file="${basedir}/distributions/web/Install.sh" pattern="^(iscdrom=).*" replacement="$1"no"" />
|
---|
130 |
|
---|
131 |
|
---|
132 | <echo level="info">Changing date and version in the docs</echo>
|
---|
133 | <!-- ar -->
|
---|
134 | <rsr file="${basedir}/distributions/web/READMEar.txt" pattern="(اÙتارÙØ® : \s*)(.*)" replacement="$1${month.ar} ${current.year}" />
|
---|
135 | <rsr file="${basedir}/distributions/web/READMEar.txt" pattern="(اÙÙسخ٠: \s*)(.*)" replacement="$1${version}" />
|
---|
136 |
|
---|
137 | <!-- es -->
|
---|
138 | <rsr file="${basedir}/distributions/web/READMEes.txt" pattern="^(Fecha\s*)(.*)" replacement="$1${month.es} de ${current.year}" />
|
---|
139 | <rsr file="${basedir}/distributions/web/READMEes.txt" pattern="^(Versi.?n\s*)(.*)" replacement="$1${version}" />
|
---|
140 | <!-- fr -->
|
---|
141 | <rsr file="${basedir}/distributions/web/READMEfr.txt" pattern="^(Date\s*)(.*)" replacement="$1${month.fr} ${current.year}" />
|
---|
142 | <rsr file="${basedir}/distributions/web/READMEfr.txt" pattern="^(Version\s*)(.*)" replacement="$1${version}" />
|
---|
143 | <!-- ru -->
|
---|
144 | <rsr file="${basedir}/distributions/web/READMEru.txt" pattern="^(ÐаÑа\s*)(.*)" replacement="$1${month.ru} ${current.year}" />
|
---|
145 | <rsr file="${basedir}/distributions/web/READMEru.txt" pattern="^(ÐеÑÑОÑ\s*)(.*)" replacement="$1${version}" />
|
---|
146 | <!-- en -->
|
---|
147 | <rsr file="${basedir}/distributions/web/READMEen.txt" pattern="^(Date\s*)(.*)" replacement="$1${month.default} ${current.year}" />
|
---|
148 | <rsr file="${basedir}/distributions/web/READMEen.txt" pattern="^(Version\s*)(.*)" replacement="$1${version}" />
|
---|
149 |
|
---|
150 | <!-- Support.htm -->
|
---|
151 | <rsr file="${basedir}/distributions/web/Support.htm" pattern="^(\s*Greenstone Digital Library version: ).*(<br>.*)" replacement="$1${version}$2"/>
|
---|
152 | <rsr file="${basedir}/distributions/web/Support.htm" pattern="^(\s*<input.* name="gsdl version".* value=").*(".*>)" replacement="$1${version}$2"/>
|
---|
153 |
|
---|
154 | <echo level="info">Removing signed gatherer</echo>
|
---|
155 | <delete file="${basedir}/distributions/web/bin/java/SignedGatherer.jar" />
|
---|
156 |
|
---|
157 | <echo level="info">Removing some unneeded stuff</echo>
|
---|
158 | <delete file="${basedir}/distributions/web/gli/.greenstonestore" />
|
---|
159 | <delete file="${basedir}/distributions/web/gli/gli4gs3.sh" />
|
---|
160 | <delete><fileset dir="${basedir}/distributions/web/gli" includes="*.bat"/></delete>
|
---|
161 | <delete><fileset dir="${basedir}/distributions/web" includes="*.bat"/></delete>
|
---|
162 |
|
---|
163 | </if>
|
---|
164 | </target>
|
---|
165 |
|
---|
166 | </project>
|
---|