source: gs3-extensions/fedora/trunk/src/build.xml@ 26420

Last change on this file since 26420 was 26420, checked in by ak19, 8 years ago

Additional corrections to README for when I tried to follow its instructions for manually creating (and building) a GS3 fedora collection.

File size: 8.8 KB
Line 
1<?xml version="1.0"?>
2<!-- ======================================================================
3 Oct 2012
4
5 Script to install Fedora and Fedora GSearch as extensions within Greenstone3
6 (using Greenstone's tomcat)
7 ak19
8 ====================================================================== -->
9
10<project name="fedora_for_gs3" default="usage" basedir=".">
11 <echo>
12 Tested for Linux.
13 Your os.name: ${os.name}
14 </echo>
15
16 <!-- PROPERTIES -->
17
18 <!-- need to have FEDORA_HOME env correctly defined -->
19
20 <!--<property name="gsdl3src.home" value="../..${basedir}"/>-->
21 <!--<property name="gsdl3src.home" location="." relative="true" basedir="../.."/>-->
22 <!--<property name="gsdl3src.home" value="/full/path/to/GS3" />-->
23
24 <!-- load the Greenstone properties file to have access to tomcat and fedora properties.
25 This assumes they have Greenstone installed (build.properties must exist). -->
26 <property file="${gsdl3src.home}/build.properties"/>
27
28 <available file="${gsdl3src.home}/packages/tomcat/webapps/fedoragsearch/FgsConfig/build.xml" property="fedoragsearch.deployed"/>
29
30
31 <!-- TARGETS -->
32 <target name="usage" description="Print a help message">
33 <echo message=" Execute 'ant -projecthelp' for a list of targets."/>
34 <echo message=" Execute 'ant -help' for Ant help."/>
35
36 <echo>
37 *********************************************************
38 1. ant -Dgsdl3src.home=&lt;Full-Path-To-GS3&gt; start-fedora-install
39
40 2. start tomcat by going into ${gsdl3src.home} and running: ant start
41
42 3. ant -Dgsdl3src.home=&lt;Full-Path-To-GS3&gt; continue-fedora-install
43
44 4. stop tomcat by going back into ${gsdl3src.home} and running: ant stop
45
46 5. ant -Dgsdl3src.home=&lt;Full-Path-To-GS3&gt; finish-fedora-install
47
48 The README.txt file will have more information about the Greenstone
49 Fedora extension's installation process.
50 *********************************************************
51 </echo>
52 </target>
53
54
55
56 <target name="start-fedora-install" description="Prepares the fedora war files and puts them into tomcat">
57
58 <!-- adjust template files -->
59 <filter token="GSDL3SRCHOME" value="${gsdl3src.home}"/>
60 <filter token="FEDORA_HOME" value="${gsdl3src.home}/ext/fedora3"/>
61 <filter token="tomcatserver" value="${tomcat.server}"/>
62 <filter token="tomcatport" value="${tomcat.port}"/>
63 <filter token="tomcatshutdownport" value="${tomcat.shutdown.port}"/>
64 <filter token="fedorapassw" value="${fedora.password}"/>
65 <filter token="indexwritelocktimeout" value="${index.writelock.timeout}"/>
66
67 <copy file="${basedir}/adjust_war_files/fedoragsearch/FgsConfig/fgsconfig-basic.properties.in" tofile="${basedir}/adjust_war_files/fedoragsearch/FgsConfig/fgsconfig-basic.properties" filtering="true" overwrite="true"/>
68 <copy file="${basedir}/adjust_war_files/fedoragsearch/FgsConfig/FgsConfigIndexTemplate/Lucene/index.properties.in" tofile="${basedir}/adjust_war_files/fedoragsearch/FgsConfig/FgsConfigIndexTemplate/Lucene/index.properties" filtering="true" overwrite="true"/>
69 <copy file="${basedir}/install/install.properties.in" tofile="${basedir}/install/install.properties" filtering="true" overwrite="true"/>
70 <copy file="${basedir}/server/config/fedora.fcfg.in" tofile="${basedir}/server/config/fedora.fcfg" filtering="true" overwrite="true"/>
71 <copy file="${basedir}/server/config/fedora-users.xml.in" tofile="${basedir}/server/config/fedora-users.xml" filtering="true" overwrite="true"/>
72 <copy file="${basedir}/server/config/spring/akubra-llstore.xml.in" tofile="${basedir}/server/config/spring/akubra-llstore.xml" filtering="true" overwrite="true"/>
73
74 <!-- zip up fedoragsearch, rename as .war file and put it in the install folder-->
75 <zip destfile="${basedir}/install/fedoragsearch.war"
76 basedir="${basedir}/adjust_war_files/fedoragsearch"
77 />
78
79 <!-- move fedora.xml and war files into tomcat -->
80 <copy file="${basedir}/adjust_war_files/fedora.xml.in" tofile="${gsdl3src.home}/packages/tomcat/conf/Catalina/localhost/fedora.xml" filtering="true" overwrite="true"/>
81
82 <copy todir="${gsdl3src.home}/packages/tomcat/webapps">
83 <fileset dir="${basedir}/install">
84 <include name="**/*.war"/>
85 </fileset>
86 </copy>
87
88 <!-- copy jar files needed by tomcat to run fedora from greenstone/web/WEB-INF/lib -->
89 <copy todir="${gsdl3src.home}/packages/tomcat/lib">
90 <filelist dir="${gsdl3src.home}/web/WEB-INF/lib">
91 <file name="xalan.jar"/>
92 <file name="serializer.jar"/>
93 <file name="xsltc.jar"/>
94 </filelist>
95 </copy>
96
97 <echo>
98 *********************************************************
99 1. Adjust ${gsdl3src.home}/build.properties to set up Fedora.
100 2. Then restart the Greenstone 3 tomcat. This will take some time the first time around.
101 3. Once tomcat's started up, return to this extension directory and run: ant continue-fedora-install
102 *********************************************************
103 </echo>
104 </target>
105
106
107
108 <!-- Only if fedoragsearch exists inside tomcat/webapps -->
109 <target name="continue-fedora-install"
110 description="When tomcat is running and has deployed the fedora war files, this stage configures Fedora GSearch"
111 if="fedoragsearch.deployed">
112
113 <!-- call the fgsconfig-basic.xml buildfile in GS3/packages/tomcat/webapps/fedoragsearch/FgsConfig's
114 ant -f fgsconfig-basic.xml -->
115 <echo>
116 Configuring Fedora GSearch
117 </echo>
118 <ant dir="${gsdl3src.home}/packages/tomcat/webapps/fedoragsearch/FgsConfig" antfile="fgsconfig-basic.xml"/>
119
120 <!-- give read execute permissions to all (755) for the fedoragsearch files -->
121 <echo>
122 Giving executable permissions to Fedora setup script and Fedora GSearch scripts
123 </echo>
124 <chmod file="${basedir}/gs3-setup.sh" perm="755"/>
125 <chmod file="${gsdl3src.home}/packages/tomcat/webapps/fedoragsearch/client/runRESTClient.sh" perm="755"/>
126 <chmod file="${gsdl3src.home}/packages/tomcat/webapps/fedoragsearch/client/runSOAPClient.sh" perm="755"/>
127
128 <!-- call Update EmptyIndex on GSearch to create the initial index (segments) file:
129 .../webapps/fedoragsearch/client/runRESTClient.sh <host:port> updateIndex createEmpty <indexName>
130
131 Where the indexName is FgsIndex. If it is made customisable, then template files need
132 to change to contain placeholders wherever the indexName is mentioned.
133 To run the upateIndex command, need GSearch username and pwd set in the environment. -->
134 <echo>
135 Calling UpdateIndex CreateEmpty on Fedora GSearch to create a new index
136 </echo>
137 <exec osfamily="unix" spawn="false"
138 executable="${gsdl3src.home}/packages/tomcat/webapps/fedoragsearch/client/runRESTClient.sh">
139 <env key="fgsUserName" value="fedoraAdmin"/>
140 <env key="fgsPassword" value="${fedora.password}"/>
141 <arg value="${tomcat.server}:${tomcat.port}"/>
142 <arg value="updateIndex"/>
143 <arg value="createEmpty"/>
144 <arg value="FgsIndex"/>
145 </exec>
146
147 <exec osfamily="windows" spawn="false"
148 executable="cmd">
149 <env key="fgsUserName" value="fedoraAdmin" />
150 <env key="fgsPassword" value="${fedora.password}" />
151 <arg value="/c"/>
152 <arg value="${gsdl3src.home}\\packages\\tomcat\\webapps\\fedoragsearch\\client\\runRESTClient.bat"/>
153 <arg value="${tomcat.server}:${tomcat.port}" />
154 <arg value="updateIndex" />
155 <arg value="createEmpty" />
156 <arg value="FgsIndex" />
157 </exec>
158
159 <echo>
160 *********************************************************
161 0. Don't worry about the IndexNotFoundException message. It always does this.
162 1. Stop your Greenstone 3 tomcat. (Check it's stopped: ps aux | grep tomcat)
163 2. Then, to complete fedora installation, return to this extension directory and run: ant finish-fedora-install.
164 This will clear the war files, since they have already been deployed by now.
165 *********************************************************
166 </echo>
167
168 </target>
169
170
171
172 <target name="finish-fedora-install"
173 description="Removes Fedora and GSearch war files from ${basedir}/tomcat/packages/webapps after deployment. Tomcat must not be running.">
174 <!-- clean up the war files -->
175 <delete file="${gsdl3src.home}/packages/tomcat/webapps/fedora.war"/>
176 <delete file="${gsdl3src.home}/packages/tomcat/webapps/fedora-demo.war"/>
177 <delete file="${gsdl3src.home}/packages/tomcat/webapps/fop.war"/>
178 <delete file="${gsdl3src.home}/packages/tomcat/webapps/imagemanip.war"/>
179 <delete file="${gsdl3src.home}/packages/tomcat/webapps/saxon.war"/>
180 <delete file="${gsdl3src.home}/packages/tomcat/webapps/fedoragsearch.war"/>
181
182 <echo>
183 *********************************************************
184 Fedora installation complete. Try running FLI.
185 *********************************************************
186 </echo>
187
188 </target>
189
190</project>
Note: See TracBrowser for help on using the repository browser.