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 | <!--<property name="gsdl3src.home" value="../..${basedir}"/>-->
|
---|
19 | <!--<property name="gsdl3src.home" location="." relative="true" basedir="../.."/>-->
|
---|
20 | <!--<property name="gsdl3src.home" value="/full/path/to/GS3" />-->
|
---|
21 |
|
---|
22 | <!-- load the Greenstone properties file to have access to tomcat and fedora properties.
|
---|
23 | This assumes they have Greenstone installed (build.properties must exist). -->
|
---|
24 | <property file="${gsdl3src.home}/build.properties"/>
|
---|
25 |
|
---|
26 | <available file="${gsdl3src.home}/packages/tomcat/webapps/fedoragsearch/FgsConfig/build.xml" property="fedoragsearch.deployed"/>
|
---|
27 |
|
---|
28 |
|
---|
29 | <!-- TARGETS -->
|
---|
30 | <target name="usage" description="Print a help message">
|
---|
31 | <echo message=" Execute 'ant -projecthelp' for a list of targets."/>
|
---|
32 | <echo message=" Execute 'ant -help' for Ant help."/>
|
---|
33 |
|
---|
34 | <echo>
|
---|
35 | *********************************************************
|
---|
36 | 1. ant -Dgsdl3src.home=<Full-Path-To-GS3> start-fedora-install
|
---|
37 |
|
---|
38 | 2. start tomcat by going into ${gsdl3src.home} and running: ant start
|
---|
39 |
|
---|
40 | 3. ant -Dgsdl3src.home=<Full-Path-To-GS3> continue-fedora-install
|
---|
41 |
|
---|
42 | 4. stop tomcat by going back into ${gsdl3src.home} and running: ant stop
|
---|
43 |
|
---|
44 | 5. ant -Dgsdl3src.home=<Full-Path-To-GS3> finish-fedora-install
|
---|
45 |
|
---|
46 | The README.txt file will have more information about the Greenstone
|
---|
47 | Fedora extension's installation process.
|
---|
48 | *********************************************************
|
---|
49 | </echo>
|
---|
50 | </target>
|
---|
51 |
|
---|
52 |
|
---|
53 |
|
---|
54 | <target name="start-fedora-install" description="Prepares the fedora war files and puts them into tomcat">
|
---|
55 |
|
---|
56 | <!-- adjust template files -->
|
---|
57 | <filter token="GSDL3SRCHOME" value="${gsdl3src.home}"/>
|
---|
58 | <filter token="FEDORA_HOME" value="${gsdl3src.home}/ext/fedora3"/>
|
---|
59 | <filter token="tomcatserver" value="${tomcat.server}"/>
|
---|
60 | <filter token="tomcatport" value="${tomcat.port}"/>
|
---|
61 | <filter token="tomcatshutdownport" value="${tomcat.shutdown.port}"/>
|
---|
62 | <filter token="fedorapassw" value="${fedora.password}"/>
|
---|
63 | <filter token="indexwritelocktimeout" value="${index.writelock.timeout}"/>
|
---|
64 |
|
---|
65 | <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"/>
|
---|
66 | <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"/>
|
---|
67 | <copy file="${basedir}/install/install.properties.in" tofile="${basedir}/install/install.properties" filtering="true" overwrite="true"/>
|
---|
68 | <copy file="${basedir}/server/config/fedora.fcfg.in" tofile="${basedir}/server/config/fedora.fcfg" filtering="true" overwrite="true"/>
|
---|
69 | <copy file="${basedir}/server/config/fedora-users.xml.in" tofile="${basedir}/server/config/fedora-users.xml" filtering="true" overwrite="true"/>
|
---|
70 | <copy file="${basedir}/server/config/spring/akubra-llstore.xml.in" tofile="${basedir}/server/config/spring/akubra-llstore.xml" filtering="true" overwrite="true"/>
|
---|
71 |
|
---|
72 | <!-- zip up fedoragsearch, rename as .war file and put it in the install folder-->
|
---|
73 | <zip destfile="${basedir}/install/fedoragsearch.war"
|
---|
74 | basedir="${basedir}/adjust_war_files/fedoragsearch"
|
---|
75 | />
|
---|
76 |
|
---|
77 | <!-- move fedora.xml and war files into tomcat -->
|
---|
78 | <copy file="${basedir}/adjust_war_files/fedora.xml.in" tofile="${gsdl3src.home}/packages/tomcat/conf/Catalina/localhost/fedora.xml" filtering="true" overwrite="true"/>
|
---|
79 |
|
---|
80 | <copy todir="${gsdl3src.home}/packages/tomcat/webapps">
|
---|
81 | <fileset dir="${basedir}/install">
|
---|
82 | <include name="**/*.war"/>
|
---|
83 | </fileset>
|
---|
84 | </copy>
|
---|
85 |
|
---|
86 | <!-- copy jar files needed by tomcat to run fedora from greenstone/web/WEB-INF/lib -->
|
---|
87 | <copy todir="${gsdl3src.home}/packages/tomcat/lib">
|
---|
88 | <filelist dir="${gsdl3src.home}/web/WEB-INF/lib">
|
---|
89 | <file name="xalan.jar"/>
|
---|
90 | <file name="serializer.jar"/>
|
---|
91 | <file name="xsltc.jar"/>
|
---|
92 | </filelist>
|
---|
93 | </copy>
|
---|
94 |
|
---|
95 | <echo>
|
---|
96 | *********************************************************
|
---|
97 | 1. Adjust ${gsdl3src.home}/build.properties to set up Fedora.
|
---|
98 | 2. Then restart the Greenstone tomcat. Once it's started up,
|
---|
99 | 3. Return to this extension directory and run: ant continue-fedora-install
|
---|
100 | *********************************************************
|
---|
101 | </echo>
|
---|
102 | </target>
|
---|
103 |
|
---|
104 |
|
---|
105 |
|
---|
106 | <!-- Only if fedoragsearch exists inside tomcat/webapps -->
|
---|
107 | <target name="continue-fedora-install"
|
---|
108 | description="When tomcat is running and has deployed the fedora war files, this stage configures Fedora GSearch"
|
---|
109 | if="fedoragsearch.deployed">
|
---|
110 |
|
---|
111 | <!-- call the fgsconfig-basic.xml buildfile in GS3/packages/tomcat/webapps/fedoragsearch/FgsConfig's
|
---|
112 | ant -f fgsconfig-basic.xml -->
|
---|
113 | <ant dir="${gsdl3src.home}/packages/tomcat/webapps/fedoragsearch/FgsConfig" antfile="fgsconfig-basic.xml"/>
|
---|
114 |
|
---|
115 | <!-- give read execute permissions to all (755) for the fedoragsearch files -->
|
---|
116 | <chmod file="${gsdl3src.home}/packages/tomcat/webapps/fedoragsearch/client/runRESTClient.sh" perm="755"/>
|
---|
117 | <chmod file="${gsdl3src.home}/packages/tomcat/webapps/fedoragsearch/client/runSOAPClient.sh" perm="755"/>
|
---|
118 |
|
---|
119 | <echo>
|
---|
120 | *********************************************************
|
---|
121 | 1. Stop the Greenstone Tomcat. (Check it's stopped: ps aux | grep tomcat)
|
---|
122 | 2. Then to complete fedora installation, return to this extension directory and run: ant finish-fedora-install.
|
---|
123 | This will clear the war files since they have already been deployed.
|
---|
124 | *********************************************************
|
---|
125 | </echo>
|
---|
126 |
|
---|
127 | </target>
|
---|
128 |
|
---|
129 |
|
---|
130 |
|
---|
131 | <target name="finish-fedora-install"
|
---|
132 | description="Removes Fedora and GSearch war files from ${basedir}/tomcat/packages/webapps after deployment. Tomcat must not be running.">
|
---|
133 | <!-- clean up the war files -->
|
---|
134 | <delete file="${gsdl3src.home}/packages/tomcat/webapps/fedora.war"/>
|
---|
135 | <delete file="${gsdl3src.home}/packages/tomcat/webapps/fedora-demo.war"/>
|
---|
136 | <delete file="${gsdl3src.home}/packages/tomcat/webapps/fop.war"/>
|
---|
137 | <delete file="${gsdl3src.home}/packages/tomcat/webapps/imagemanip.war"/>
|
---|
138 | <delete file="${gsdl3src.home}/packages/tomcat/webapps/saxon.war"/>
|
---|
139 | <delete file="${gsdl3src.home}/packages/tomcat/webapps/fedoragsearch.war"/>
|
---|
140 |
|
---|
141 | <echo>
|
---|
142 | *********************************************************
|
---|
143 | Fedora installation complete. Try running FLI.
|
---|
144 | *********************************************************
|
---|
145 | </echo>
|
---|
146 |
|
---|
147 | </target>
|
---|
148 |
|
---|
149 | </project>
|
---|