source: gs3-extensions/fedora/build.xml@ 26382

Last change on this file since 26382 was 26377, checked in by ak19, 11 years ago

The fedora3-gs3.tar.gz file already contains the build.xml file. This one is for being able to view and edit the file (and then put it back into the tar.gz file for distribution).

File size: 6.7 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 <!--<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=&lt;Full-Path-To-GS3&gt; start-fedora-install
37
38 2. start tomcat by going into ${gsdl3src.home} and running: ant start
39
40 3. ant -Dgsdl3src.home=&lt;Full-Path-To-GS3&gt; continue-fedora-install
41
42 4. stop tomcat by going back into ${gsdl3src.home} and running: ant stop
43
44 5. ant -Dgsdl3src.home=&lt;Full-Path-To-GS3&gt; 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
64 <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"/>
65 <copy file="${basedir}/install/install.properties.in" tofile="${basedir}/install/install.properties" filtering="true" overwrite="true"/>
66 <copy file="${basedir}/server/config/fedora.fcfg.in" tofile="${basedir}/server/config/fedora.fcfg" filtering="true" overwrite="true"/>
67 <copy file="${basedir}/server/config/fedora-users.xml.in" tofile="${basedir}/server/config/fedora-users.xml" filtering="true" overwrite="true"/>
68 <copy file="${basedir}/server/config/spring/akubra-llstore.xml.in" tofile="${basedir}/server/config/spring/akubra-llstore.xml" filtering="true" overwrite="true"/>
69
70 <!-- zip up fedoragsearch, rename as .war file and put it in the install folder-->
71 <zip destfile="${basedir}/install/fedoragsearch.war"
72 basedir="${basedir}/adjust_war_files/fedoragsearch"
73 />
74
75 <!-- move fedora.xml and war files into tomcat -->
76 <copy file="${basedir}/adjust_war_files/fedora.xml.in" tofile="${gsdl3src.home}/packages/tomcat/conf/Catalina/localhost/fedora.xml" filtering="true" overwrite="true"/>
77
78 <copy todir="${gsdl3src.home}/packages/tomcat/webapps">
79 <fileset dir="${basedir}/install">
80 <include name="**/*.war"/>
81 </fileset>
82 </copy>
83
84 <!-- copy jar files needed by tomcat to run fedora from greenstone/web/WEB-INF/lib -->
85 <copy todir="${gsdl3src.home}/packages/tomcat/lib">
86 <filelist dir="${gsdl3src.home}/web/WEB-INF/lib">
87 <file name="xalan.jar"/>
88 <file name="serializer.jar"/>
89 <file name="xsltc.jar"/>
90 </filelist>
91 </copy>
92
93 <echo>
94 *********************************************************
95 1. Adjust ${gsdl3src.home}/build.properties to set up Fedora.
96 2. Then restart the Greenstone tomcat. Once it's started up,
97 3. Return to this extension directory and run: ant continue-fedora-install
98 *********************************************************
99 </echo>
100 </target>
101
102
103
104 <!-- Only if fedoragsearch exists inside tomcat/webapps -->
105 <target name="continue-fedora-install"
106 description="When tomcat is running and has deployed the fedora war files, this stage configures Fedora GSearch"
107 if="fedoragsearch.deployed">
108
109 <!-- call the fgsconfig-basic.xml buildfile in GS3/packages/tomcat/webapps/fedoragsearch/FgsConfig's
110 ant -f fgsconfig-basic.xml -->
111 <ant dir="${gsdl3src.home}/packages/tomcat/webapps/fedoragsearch/FgsConfig" antfile="fgsconfig-basic.xml"/>
112
113 <!-- give read execute permissions to all (755) for the fedoragsearch files -->
114 <chmod file="${gsdl3src.home}/packages/tomcat/webapps/fedoragsearch/client/runRESTClient.sh" perm="755"/>
115 <chmod file="${gsdl3src.home}/packages/tomcat/webapps/fedoragsearch/client/runSOAPClient.sh" perm="755"/>
116
117 <echo>
118 *********************************************************
119 1. Stop the Greenstone Tomcat. (Check it's stopped: ps aux | grep tomcat)
120 2. Then to complete fedora installation, return to this extension directory and run: ant finish-fedora-install.
121 This will clear the war files since they have already been deployed.
122 *********************************************************
123 </echo>
124
125 </target>
126
127
128
129 <target name="finish-fedora-install"
130 description="Removes Fedora and GSearch war files from ${basedir}/tomcat/packages/webapps after deployment. Tomcat must not be running.">
131 <!-- clean up the war files -->
132 <delete file="${gsdl3src.home}/packages/tomcat/webapps/fedora.war"/>
133 <delete file="${gsdl3src.home}/packages/tomcat/webapps/fedora-demo.war"/>
134 <delete file="${gsdl3src.home}/packages/tomcat/webapps/fop.war"/>
135 <delete file="${gsdl3src.home}/packages/tomcat/webapps/imagemanip.war"/>
136 <delete file="${gsdl3src.home}/packages/tomcat/webapps/saxon.war"/>
137 <delete file="${gsdl3src.home}/packages/tomcat/webapps/fedoragsearch.war"/>
138
139 <echo>
140 *********************************************************
141 Fedora installation complete. Try running FLI.
142 *********************************************************
143 </echo>
144
145 </target>
146
147</project>
Note: See TracBrowser for help on using the repository browser.