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="lirk2-create-distribution" default="create-distribution">
|
---|
12 |
|
---|
13 |
|
---|
14 | <target name="create-distribution">
|
---|
15 | <addressedcall target="export-gsdl-gli-indexers" />
|
---|
16 | <addressedcall target="dist-set-version" />
|
---|
17 | <addressedcall target="drop-in-binaries" />
|
---|
18 | <addressedcall target="drop-in-demo-collection" />
|
---|
19 | <addressedcall target="compile-gli" />
|
---|
20 | <addressedcall target="create-gli-client-zip" />
|
---|
21 | <addressedcall target="tweak-files" />
|
---|
22 | </target>
|
---|
23 |
|
---|
24 | <target name="export-gsdl-gli-indexers">
|
---|
25 | <if><bool><istrue value="${execute}"/></bool>
|
---|
26 |
|
---|
27 | <mkdir dir="distributions"/>
|
---|
28 | <delete dir="distributions/web"/>
|
---|
29 | <svn>
|
---|
30 | <export srcurl="${svn.root}/gsdl/${branch.path}" destPath="distributions/web"/>
|
---|
31 | </svn>
|
---|
32 |
|
---|
33 | <svn>
|
---|
34 | <export srcurl="${svn.root}/gli/${branch.path}" destPath="distributions/web/gli"/>
|
---|
35 | </svn>
|
---|
36 |
|
---|
37 | <svn>
|
---|
38 | <export srcurl="${svn.root}/indexers/${branch.path}" destPath="distributions/web/indexers"/>
|
---|
39 | </svn>
|
---|
40 |
|
---|
41 | </if>
|
---|
42 | </target>
|
---|
43 |
|
---|
44 | <target name="dist-set-version">
|
---|
45 | <if><bool><istrue value="${execute}"/></bool>
|
---|
46 |
|
---|
47 | <echo level="info">Setting version in src/lib/gsdlconf.h</echo>
|
---|
48 | <rsr file="${basedir}/distributions/web/src/lib/gsdlconf.h" pattern="(#define GSDL_VERSION) ".*"" replacement="$1 "${version}"" />
|
---|
49 |
|
---|
50 | <echo level="info">Setting version in Install.sh</echo>
|
---|
51 | <rsr file="${basedir}/distributions/web/Install.sh" pattern="(echo "Version: ).*(" .*)" replacement="$1${version}$2" />
|
---|
52 |
|
---|
53 | <echo level="info">Setting version in etc/VERSION</echo>
|
---|
54 | <rsr file="${basedir}/distributions/web/etc/VERSION" pattern="(gsdl version: ).*" replacement="$1${version}" />
|
---|
55 |
|
---|
56 | </if>
|
---|
57 | </target>
|
---|
58 |
|
---|
59 | <target name="drop-in-binaries">
|
---|
60 | <if><bool><istrue value="${execute}"/></bool>
|
---|
61 | <echo level="info">Dropping compiled binaries into distribution</echo>
|
---|
62 | <delete dir="distributions/web/bin/linux" />
|
---|
63 | <exec dir="${basedir}" executable="cp"><arg line="-r gsdl/bin/linux distributions/web/bin"/></exec>
|
---|
64 | <exec dir="${basedir}" executable="cp"><arg line="gsdl/cgi-bin/library distributions/web/cgi-bin"/></exec>
|
---|
65 | <exec dir="${basedir}" executable="cp"><arg line="gsdl/cgi-bin/oaiservr distributions/web/cgi-bin"/></exec>
|
---|
66 | </if>
|
---|
67 | </target>
|
---|
68 |
|
---|
69 | <target name="drop-in-demo-collection">
|
---|
70 | <if><bool><istrue value="${execute}"/></bool>
|
---|
71 | <echo level="info">Dropping compiled binaries into distribution</echo>
|
---|
72 | <delete dir="distributions/web/collect/demo" />
|
---|
73 | <exec dir="${basedir}" executable="cp"><arg line="-r gsdl/collect/demo distributions/web/collect"/></exec>
|
---|
74 | </if>
|
---|
75 | </target>
|
---|
76 |
|
---|
77 |
|
---|
78 | <target name="compile-gli">
|
---|
79 | <if><bool><istrue value="${execute}"/></bool>
|
---|
80 |
|
---|
81 | <echo>Compiling gli...</echo>
|
---|
82 | <exec dir="${basedir}/distributions/web/gli" executable="${basedir}/distributions/web/gli/makegli.sh"/>
|
---|
83 |
|
---|
84 | <echo>Creating jar...</echo>
|
---|
85 | <exec dir="${basedir}/distributions/web/gli" executable="${basedir}/distributions/web/gli/makejar.sh"/>
|
---|
86 |
|
---|
87 | <echo>Cleaning up intermediate files...</echo>
|
---|
88 | <delete dir="${basedir}/distributions/web/gli/jar"/>
|
---|
89 | <delete dir="${basedir}/distributions/web/gli/classes/org"/>
|
---|
90 |
|
---|
91 | <echo>Putting gli server jar in a better place</echo>
|
---|
92 | <exec dir="${basedir}/distributions/web" executable="mv" failonerror="true">
|
---|
93 | <arg line="gli/GLIServer.jar bin/java" />
|
---|
94 | </exec>
|
---|
95 |
|
---|
96 | </if>
|
---|
97 | </target>
|
---|
98 |
|
---|
99 | <target name="create-gli-client-zip">
|
---|
100 | <if><bool><istrue value="${execute}"/></bool>
|
---|
101 | <!--
|
---|
102 | # take a copy of GLI directory
|
---|
103 | &util::cp_r(&util::filename_cat($tmpdir, "gsdl", "gli"), $tmpdir);
|
---|
104 |
|
---|
105 | my $client_dirname = "gli-client-" . $version_num;
|
---|
106 | rename ("gli", $client_dirname);
|
---|
107 | chdir(&util::filename_cat($tmpdir, $client_dirname));
|
---|
108 |
|
---|
109 |
|
---|
110 | # delete unnecessary stuff
|
---|
111 | `rm -rf clean.* document.* gems.* gli*.sh gli*.bat make*.sh make*.bat lib src`;
|
---|
112 | # make sure permissions are ok
|
---|
113 | `chmod a+x client-gli.sh client-gli.bat`;
|
---|
114 | chdir($tmpdir);
|
---|
115 |
|
---|
116 | # zip up the client
|
---|
117 | &zip($client_dirname, $client_dirname, $tmpdir, 1);
|
---|
118 | -->
|
---|
119 | </if>
|
---|
120 | </target>
|
---|
121 |
|
---|
122 |
|
---|
123 | <target name="tweak-files">
|
---|
124 | <if><bool><istrue value="${execute}"/></bool>
|
---|
125 |
|
---|
126 | <echo level="info">Changing Install.sh to web release</echo>
|
---|
127 | <rsr file="${basedir}/distributions/web/Install.sh" pattern="^(iscdrom=).*" replacement="$1"no"" />
|
---|
128 |
|
---|
129 | <echo level="info">Putting the COPYING file into distribution</echo>
|
---|
130 | <copy file="${lirk2.home}/resources/COPYING" tofile="${basedir}/distributions/web/COPYING" />
|
---|
131 |
|
---|
132 | <echo level="info">Removing signed gatherer</echo>
|
---|
133 | <delete file="${basedir}/distributions/web/bin/java/SignedGatherer.jar" />
|
---|
134 |
|
---|
135 | <echo level="info">Removing some unneeded stuff</echo>
|
---|
136 | <delete file="${basedir}/distributions/web/gli/.greenstonestore" />
|
---|
137 | <delete file="${basedir}/distributions/web/gli/gli4gs3.sh" />
|
---|
138 | <delete><fileset dir="${basedir}/distributions/web/gli" includes="*.bat"/></delete>
|
---|
139 | <delete><fileset dir="${basedir}/distributions/web" includes="*.bat"/></delete>
|
---|
140 |
|
---|
141 | </if>
|
---|
142 | </target>
|
---|
143 |
|
---|
144 | </project>
|
---|